Python code help please
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey guys,
For the life of me I can't figure out why this script isn't working. If anyone can help it would be great.
The error I'm getting is # Error: invalid syntax # and # Error: line 1: invalid syntax # .
But I can't see where my error is. It's probably staring me right in the face.
Thanks.
from maya import cmds
sel = cmds.ls(sl=1)
controller = None
preParent = None
for i in sel:
cmds.select(cl=1)
if controller == None or cmds.objExists(controller) == False:
controller1 = cmds.circle( nr=(1, 0, 0 ), name = i +"CTRL")[0]
else:
controller1 = cmds.duplicate(controller, name = i + "CTRL"[0]
grp = cmds.group(em =1, name = i+"GRP")
cmds.parent(controller1, grp)
pc = cmds.parentConstraint(i, grp, mo=0)
cmds.delete(pc)
cmds.pointConstraint(controller1, i, mo=0)
cmds.orientConstraint(controller1, i, mo=0)
if preParent != None
cmds.parent(grp, preParent)
preParent = controller1