SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / Scripting Question
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 18-08-2003, 09:00 PM   #1
RenardMF
Registered User
 
RenardMF's Avatar
 
Join Date: May 2003
Location: Orlando, FL
Posts: 13
Thanks: 0
Thanked 3 Times in 3 Posts
Default Scripting Question

Does anyone know of the expression to use to adjust and objects velocity/acceleration. For example i have a ring and i want to make it start spinning really fast and gradualy come to a halt slowing down speed over time. What would be the easist way to script this?
RenardMF is offline   Reply With Quote
Old 18-08-2003, 09:48 PM   #2
mtmckinley
The Maya Mountain
 
mtmckinley's Avatar
 
Join Date: Aug 2002
Location: Seattle, WA
Posts: 8,245
Thanks: 1
Thanked 25 Times in 25 Posts
Default

OBJECTNAME.rotateY = 100/(frame/500);

You'd substitute the rotation direction with whichever direction you want.

You'd also want to experiment with the number amounts to get the speed you want.
__________________
-Mike
www.mtmckinley.net
The Maya Toolbelt
mtmckinley is offline   Reply With Quote
Old 18-08-2003, 09:53 PM   #3
RenardMF
Registered User
 
RenardMF's Avatar
 
Join Date: May 2003
Location: Orlando, FL
Posts: 13
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Thanks ill try that now.
RenardMF is offline   Reply With Quote
Old 18-08-2003, 10:03 PM   #4
RenardMF
Registered User
 
RenardMF's Avatar
 
Join Date: May 2003
Location: Orlando, FL
Posts: 13
Thanks: 0
Thanked 3 Times in 3 Posts
Default

How bout make it spin like that and slow and then come to a complete stop at its original location?
RenardMF is offline   Reply With Quote
Old 19-08-2003, 02:06 AM   #5
mtmckinley
The Maya Mountain
 
mtmckinley's Avatar
 
Join Date: Aug 2002
Location: Seattle, WA
Posts: 8,245
Thanks: 1
Thanked 25 Times in 25 Posts
Default

You'd have to figure out the math for that, I'm afraid. I'm not sure what you'd need to do to get it to stop on a dime.
__________________
-Mike
www.mtmckinley.net
The Maya Toolbelt
mtmckinley is offline   Reply With Quote
Old 21-08-2003, 02:34 AM   #6
mark_wilkins
Registered User
 
mark_wilkins's Avatar
 
Join Date: Jan 2003
Posts: 161
Thanks: 0
Thanked 1 Time in 1 Post
Default

The easiest way to do this is by keyframing the animation. Set a few keys, mess with the tangents a bit, and you'll get the result you need.

Alternatively, if you're looking for a generalized velocity/acceleration solution, consider using particle or solid body dynamics. You can apply forces or accelerations and rely on the dynamics solver to figure out the resulting motion.

Finally, you can try using a mathematical expression for the rotation. This is my least favorite approach because it requires figuring out how you want the velocity to change and then essentially analytically integrating it, which if you don't recall your calculus very well is going to be a trouble-filled, trial-and-error endeavor.

-- Mark
__________________
Mark R. Wilkins
author of MEL Scripting for Maya Animators
www.melscripting.com
mark_wilkins is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.