CGTalk > Software > Autodesk Maya
Login register
reply share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 08-19-2013, 02:59 PM   #1
artcross
Frequenter
portfolio
Jonathan Reyes
New York City, USA
 
Join Date: Jan 2007
Posts: 108
Inertia bounce in Maya

I've been using an expression in after effects that calculates inertia based on 2 keyframes on a given property. You can find the expression here under inertial bounce:

http://www.motion-graphics-exchange...s/4ad0f32a944ad

I'm not too keen on scripting in Maya, so I was wondering if it's possible to convert this expression to something Maya can use. Here's the expression if the link isn't working:
// Inertial Bounce (moves settle into place after bouncing around a little)
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
}
if (n == 0){
t = 0;
}else{
t = time - key(n).time;
}

if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = .05;
freq = 4.0;
decay = 2.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}

Thank you!
 
Old 08-20-2013, 05:36 AM   #2
ristopuukko
Earthling
 
ristopuukko's Avatar
portfolio
Risto Puukko
Senior fx td
FrameStore
London, United%2BKingdom
 
Join Date: Nov 2003
Posts: 809
__________________
- Oh no, it's me -
 
Old 08-20-2013, 03:52 PM   #3
artcross
Frequenter
portfolio
Jonathan Reyes
New York City, USA
 
Join Date: Jan 2007
Posts: 108
Not quite what i'm looking for. This expression would take 2 keyframes and calculate inertia, then automatically create a sort of decaying sine wave until it settles into the value of the last keyframe. For example, if i added it to 2 rotation keyframes, it would overshoot the last value of the keyframe, then bounce back to a little before the value of the last keyframe, the bounce forward again etc. until it finally settles into place. It could be applied to any keyframe w/ numerical value including scale, position, rotation, even bend handle values, etc..
 
Old 08-20-2013, 04:39 PM   #4
mustique
Expert
copywriter
 
Join Date: Jul 2002
Posts: 2,014
There's an usefull free set of tools called red9 for animation purposes, it has a key randomizer feature, well take a look and decide by yourself

http://red9-consultancy.blogspot.co...filter-and.html
__________________
"Any intelligent fool can make things bigger, more complex & more violent..." Einstein
 
Old 10-03-2013, 05:50 PM   #5
artcross
Frequenter
portfolio
Jonathan Reyes
New York City, USA
 
Join Date: Jan 2007
Posts: 108
Thanks mustique, finally had a chance to check out that pack and while definitely useful, isn't what I'm looking for.
 
Old 10-06-2013, 10:17 AM   #6
ristopuukko
Earthling
 
ristopuukko's Avatar
portfolio
Risto Puukko
Senior fx td
FrameStore
London, United%2BKingdom
 
Join Date: Nov 2003
Posts: 809
Jonathan, if you're still looking for a way to accomplish something like this , I thought I should share some insights on the matter.

The main problem on doing a wiggle like you suggested in Maya arises from the fact that an attiribute can only be plugged in from one source ie. keyframe ( which is an animation node's output btw ) or an expression , not both.

You can of course build up huge networks of nodes which contribute to your final animation and then connect that to your attribute but to build up this kinda "works with any keyed attribute anywhere in Maya" - solution would be insanely laborious, in my humble opinion.

Instead I encourage you to seek solutions based on your exact needs, for example if you need a wiggle on transformation, use the deformer or if you need a wiggle in scale, write an expression. You can use animation layers, character nodes to get nonlinear trax clips and so on and so forth. The way you can animate in Maya is so much more broader than in AE.

In time you'll learn how Maya's DG works and you can refine the methods used but for starters I recommend on reading about it from the manuals.

perhaps this :

http://download.autodesk.com/global...mber=d30e216203

and about the basics of Maya's DG & DAG :

http://download.autodesk.com/global...umber=d30e21133

and finally about the technicalities, MEL & expression :

http://download.autodesk.com/global...mber=d30e700414


I know that the road may seem long but trust me, it's well worth it :-)

Hope this helps.

/risto
__________________
- Oh no, it's me -
 
Old 06-24-2014, 02:51 PM   #7
RickToxik
Expert
 
RickToxik's Avatar
portfolio
Eric Mc Guire
Canada
 
Join Date: May 2010
Posts: 560
You'll be a happier man if you buy Maya MASH:
https://mash.mainframe.co.uk/

I have lost track of all the things you can do with it, but inertia effects is one of them since the beginning (the spring node). Also, the guy who is behind MASH I believe is one of the few who made an inertia expression for maya many years ago. I am serious, MASH is one of the top plugins ever invented for maya : )
 
Old 06-24-2014, 10:56 PM   #8
djx
Where's my pony?
 
djx's Avatar
David Johnson
vfx & creature td
Melbourne, Australia
 
Join Date: Jun 2003
Posts: 3,389
Adam Burke wrote a script years ago called jabPendulate that did something similar to what your expression does. I cant find it online anywhere, so I hope Adam doesn't mind me uploading it here.

If you feel like spending $35, Chad Vernon has a great jiggle deformer tutorial on cgcircuit that would really be of interest to you if you did want to learn some python api coding. Possibly too advanced if you are just starting out. Or maybe not. The deformer works on component level, but he also does some prototyping that shows the same math applied at a transform level. Its a great tutorial

David
Attached Files
File Type: zip jabPendulate.zip (1.3 KB, 44 views)
__________________
http://www.djx.com.au
 
reply share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:11 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.