Object not staying rotated

Object not staying rotated

Anonymous
Not applicable
263 Views
3 Replies
Message 1 of 4

Object not staying rotated

Anonymous
Not applicable
I am trying to write a script that rotates a object 90 degrees facing down. What I see happen is once the script is run, the object is created and has the proper rotation, but instantly reverts back to the default. The translate script seems to work on it just fine. I have used both the setattr and .r methods.
I am just getting started with MEL, so I don't if this is a common problem, but I couldn't find anything online.
Please help, I have no idea what I'm doing.
0 Likes
264 Views
3 Replies
Replies (3)
Message 2 of 4

lee.dunham
Collaborator
Collaborator
try posting your script (or the part that your having trouble with), its much easier for us to see what your problem may be.
0 Likes
Message 3 of 4

Anonymous
Not applicable
I wish I could. I am testing some things for a company and am trying to automate as much as possible. That means I can't post their stuff online. But what I am trying to rotate is some thing that is created and imported through python. I was just wondering if this was a common thing and if there was a work around.
0 Likes
Message 4 of 4

lee.dunham
Collaborator
Collaborator
Hmm could be the case if the object has keyframes/constraints/cache etc, setAttr will set the attribute, i dont think it'll set a keyframe (so as soon as you move the timeslider it'll revert back to keyframe)

try using rotate command instead, or use setKeyframe command after you have rotated to set one.
http://download.autodesk.com/global/docs/maya2013/en_us/Commands/rotate.html

if not
0 Likes