Complex UV Layout in Maya
Over the last couple of years UV layout in Maya has changed for the better. In this course we're going to be taking a look at some of those changes as we UV map an entire character
# 1 18-08-2003 , 09:00 PM
RenardMF's Avatar
Registered User
Join Date: May 2003
Location: Orlando, FL
Posts: 13

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?

# 2 18-08-2003 , 09:48 PM
mtmckinley's Avatar
The Maya Mountain
Join Date: Aug 2002
Location: Seattle, WA
Posts: 8,245
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.

# 3 18-08-2003 , 09:53 PM
RenardMF's Avatar
Registered User
Join Date: May 2003
Location: Orlando, FL
Posts: 13
Thanks ill try that now.user added image

# 4 18-08-2003 , 10:03 PM
RenardMF's Avatar
Registered User
Join Date: May 2003
Location: Orlando, FL
Posts: 13
How bout make it spin like that and slow and then come to a complete stop at its original location?

# 5 19-08-2003 , 02:06 AM
mtmckinley's Avatar
The Maya Mountain
Join Date: Aug 2002
Location: Seattle, WA
Posts: 8,245
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.

# 6 21-08-2003 , 02:34 AM
mark_wilkins's Avatar
Registered User
Join Date: Jan 2003
Posts: 161
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
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads