Maya 2020 fundamentals - modelling the real world
Get halfway through a model and find it's an unworkable mess? Can't add edge loops where you need them? Can't subdivide a mesh properly? If any of this sounds familiar check this course out.
# 1 30-09-2015 , 04:01 PM
Registered User
Join Date: Sep 2015
Posts: 4

Maya Python begginer

Hello, i'm new in maya and special in Python, im traying to make a button, when I press on the button my selected object will rotate 5, 5, 5 (or "and" translate =] )
her is code for object what is work fine but it need to be named =[

my code - work well but with name
PHP Code:
import maya.cmds as mc
mc
.setAttr("cube.rotate"000)
mc.setAttr("cube.translate"000
and my code doesn't work =]]]
PHP Code:
import maya.cmds as mc
selection 
mc.ls(sl 1)
for 
obj in selection:
    
mc.setAttr("obj.rotate"555
Thx

# 2 30-09-2015 , 04:09 PM
Registered User
Join Date: Sep 2015
Posts: 4
I found

PHP Code:
import maya.cmds as cmds
cmds
.rotate(555,) 
works fine for all obj =]]

# 3 01-10-2015 , 01:08 AM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
I haven't looked at python syntax for a while, but I suspect you will need something like:

mc.setAttr((obj + ".rotate"), 5, 5, 5)

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