Python脚本错误

时间:2017-11-03 06:00:22

标签: python maya

我在Python中做了一个简单的Maya脚本,而且我经常遇到语法错误。我的剧本需要改变什么?

select = ls(sl)
if (len(sel) == 0):
    error("Nothing was selected.")
else:
    rotate - relative 1 2 3
    scale - relative 4 5 6
    translate - relative 7 8 9

1 个答案:

答案 0 :(得分:2)

试试这个:

import maya.cmds as cmds

cmds.sphere(n='sphere1')
select = cmds.ls(selection=True)

if (len(select)==0):
    cmds.error("Nothing was selected.")
else:
    cmds.xform(r=True, ro=(0, 90, 0))
    cmds.xform(r=True, s=(1.2, 1.5, 0.5))
    cmds.xform(r=True, t=(-9, 3, 0))