Introduction to Maya - Rendering in Arnold
This course will look at the fundamentals of rendering in Arnold. We'll go through the different light types available, cameras, shaders, Arnold's render settings and finally how to split an image into render passes (AOV's), before we then reassemble it i
# 1 14-07-2014 , 04:36 PM
Subscriber
Join Date: Sep 2013
Posts: 3

Keyframe simple maya loops in python?

Hey,

I have this very simple python script in Maya that I want to "animate".
I first want to adapt the end time of the animation to the number of iterations, in order to have enough keyframes for the animation.
After that I want to add a keyframe for the movement of the polyCube at each loop iteration to produce the moving animation.

Code:
import maya.cmds as mc

iterations = 10 #number of keyframes
transVal = 1 #translation value for each iteration

mc.polyCube(constructionHistory=True, width=1, height=1, depth=1)

for i in range(iterations):
    mc.move(transVal, cube, relative=True, moveZ=True)
    mc.setKeyframe(insert=True, value=i)
Would it alternatively be possible to add a keyframe at the beginning and one at the end and let maya calculate the motion tweens (like it does when using the UI)?

Any ideas?

Thanks.

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