I'm having issue grabbing the all of the curves in a hierarchy and setting their rotations back to 0. I've been trying for the past hour and only recently learned about using PyMel. Any help is appreciated. I've had different variations that didn't give me an error but didn't do anything as well... so far the error with this code is "rotation" is not an attribute to x. I don't think I implemented the PyMel quite correctly.
Thanks once again for any help:
import maya.cmds as cmds
from pymel.core import *
mySelect = cmds.select(cmds.ls(dag = 1, ap = 1, sl = 1, type = "nurbsCurve"))
AddtoList = cmds.ls(sl =1)
for x in AddtoList:
if setAttr(x.rotate) == True:
x.rotate(0,0,0)
else:
pass
I'm also a bit of a noob when it comes to coding. So there is a mix of just python and PyMel. I only just tried PyMel a moment ago and didn't feel like deleting some older code.
Replies
I added delete keyframes in there for good measure. Maybe someone will find this mildly useful. Takes into account namespaces