PDA

View Full Version : animation through script


mradfo21
08-25-2010, 06:58 AM
Hey guys,

I have a bit of a conceptual question, though it is only that way due to my lack of experience.

I'm using maya and python. I'm attempting to make a procedural effect where the faces of a polygonal mesh shrink in on themselves and disappear.

On one level, it seems like:

I loop through through each face and perform the scaling operation, using - i believe - the timerX command as a sort of "hold".

but what i cant really grasp yet, is how i set nice keyframes. Scale = 1, then 1 second later, scale = 0, interpolate with a spline curve.

i'm not really sure how to translate that last bit into code. I'm not saying "hey do this for me", but what are the general concepts of setting keyframes with scripting?

I'm sure I sound like a total n00b here (I am very inexperience at the programming/scripting side of things). And I'm also sorry if this should have been in the Maya only section, but even if someone wanted to share an experience in Houdini, or XSI, or whatever, i'd be greatfull !

Creepfree
08-25-2010, 08:21 AM
Hey.
Do you want to scale each face of your poly model independently,right?
If so,you can try this.
-select your mesh and with "Keep faces together" option turned off,go to Mesh->Extract tool
-once you have your model split into separate pieces,you might want to loop over them with to perform a "CenterPivot" command.
-now you can set keyframes (setKeyframe mel command) ) on each piece

If you have problems with mel (or python) commands,you can always try to find it in Maya Docs (also available online,for Maya 8.5):
http://www.autodesk.com/us/maya/docs/Maya85/wwhelp/wwhimpl/js/html/wwhelp.htm

mradfo21
08-28-2010, 10:19 PM
Hey thanks for your help Creepfree. I got something working and it was a really interesting experience. Using "extract" places a node called "polyChipOff" on to the selected face. This attribute can be animated - which is what I did.

heres a result:

http://vimeo.com/14484326

unfortunately, I've run into some real performance issues. I haven't come up with a solution to ridding the scene of the polyChipOff nodes, as they're only needed for 2 seconds. I realy need to find a way to keyframe the deletion of the node or the face - I'm gonna have to think about this.

CGTalk Moderation
08-28-2010, 10:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.