Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good morning all,
i have been trying for a couple of days now to set the rotationaccumulation by layer in python but cant seem to get it to work
what i have tyried so far
def create_anim_layer():
# Create an animation layer
anim_layer = cmds.animLayer("Idle_AnimLayer", override=True)
# Set the rotation accumulation to "by layer" using MEL
mel_command = 'editAnimLayer -e -rotationAccumulation "byLayer" "{}";'.format(anim_layer)
mel.eval(mel_command)
# Adjust the number of frames to the maximum frame count
max_time = cmds.playbackOptions(q=True, max=True)
cmds.animLayer(anim_layer, edit=True, override=True, at=max_time)
def create_anim_layer():
# Create an animation layer
anim_layer = cmds.animLayer("Idle_AnimLayer", override=True)
# Set the rotation accumulation to "by layer" using cmds.setAttr
cmds.setAttr('{}.rotationAccumulation'.format(anim_layer), 'byLayer')
# Adjust the number of frames to the maximum frame count
max_time = cmds.playbackOptions(q=True, max=True)
cmds.animLayer(anim_layer, edit=True, override=True, at=max_time)
def create_anim_layer():
# Create an animation layer
anim_layer = cmds.animLayer("Idle_AnimLayer", override=True)
# Set the rotation accumulation to "by layer" using the SEToolsPlugin module
mel_command = 'animLayer -edit -rotationAccumulation "byLayer" "{}";'.format(anim_layer)
mel.eval(mel_command)
# Adjust the number of frames to the maximum frame count
max_time = cmds.playbackOptions(q=True, max=True)
cmds.animLayer(anim_layer, edit=True, override=True, at=max_time)
however i cant seem to get the correct name it keeps coming up with errors like
# Error: AttributeError: file <maya console> line 44: module 'maya.cmds' has no attribute 'editAnimLayer'
this is the current one i was working on but still no luck
def create_anim_layer():
# Create an animation layer
anim_layer = cmds.animLayer("Idle_AnimLayer", override=True)
# Set the rotation accumulation to "by layer" using MEL
mel_command = 'editAnimLayer -e -rotationAccumulation "byLayer" "{}";'.format(anim_layer)
mel.eval(mel_command)
# Adjust the number of frames to the maximum frame count
max_time = cmds.playbackOptions(q=True, max=True)
cmds.animLayer(anim_layer, edit=True, override=True, at=max_time)
all i really need to do is change the anim layer to by layer does anyone here know how that could be acchived in python ?
thank you in advance
elfenliedtopfan5
Solved! Go to Solution.