Hello everyone, I am trying to allow the user to hit a button and it creates a nurbs circle but every time I hit the button it replaces the old curve with the new one and increments the name by 1 e.g. “nurbsCircle1”, “nurbsCircle2”, “nurbsCircle3” instead of just creating multiple nurbs circles. My guess is that I might need to iterate it within the code to create multiple nurbs but Im not sure where to start the iteration if that is the case, I would appreciate any help.
The Code described above is:
def sphereControllerInit(self):
curve_01 = cmds.circle(center=(0, 0, 0), normal=(0, 1, 0), sweep=360, radius=1, degree=3, useTolerance=False, constructionHistory=True) or []
curve_02 = cmds.circle(center=(0, 0, 0), normal=(0, 1, 0), sweep=360, radius=1, degree=3, useTolerance=False, constructionHistory=True) or []
curve_03 = cmds.circle(center=(0, 0, 0), normal=(0, 1, 0), sweep=360, radius=1, degree=3, useTolerance=False, constructionHistory=True) or []
cmds.rotate(90, 0, 0, curve_02[0], relative=True, objectSpace=True)
cmds.rotate(0, 0, 90, curve_03[0], relative=True, objectSpace=True)
cmds.makeIdentity(curve_02[0], apply=True, rotate=True)
cmds.makeIdentity(curve_03[0], apply=True, rotate=True)
curveShape_02 = cmds.listRelatives(curve_02[0], shapes=True) or []
curveShape_03 = cmds.listRelatives(curve_03[0], shapes=True) or []
cmds.parent(curveShape_02[0], curve_01[0], relative=True, shape=True)
cmds.parent(curveShape_03[0], curve_01[0], relative=True, shape=True)
transformList = cmds.ls(typ='transform') or []
transformList.remove("front")
transformList.remove(curve_01[0])
transformList.remove("persp")
transformList.remove("side")
transformList.remove("top")
curveTransform = transformList[:]
cmds.delete(curveTransform)