48 import maya.cmds
as cmds
52 def testBasicObjectSet():
53 failures = testBasicObjectSetMain()
55 print(
"basicObjectSetTest: %d FAILED tests\n" % failures)
59 def testBasicObjectSetMain():
71 cmds.file(f=
True, new=
True)
72 sphere = cmds.polySphere(r=1, sx=20, sy=20, ax=(0, 1, 0), tx=1, ch=1)
73 cube = cmds.polyCube(w=1, h=1, d=1, sx=1, sy=1, sz=1, ax=(0, 1, 0), tx=1, ch=1)
74 cmds.select(sphere[0], cube[0])
75 objSet = maya.mel.eval(
"spBasicObjectSetTest")
77 cmds.delete(sphere[0])
78 if not cmds.objExists(objSet):
82 if cmds.objExists(objSet):
86 print(
"testBasicObjectSetMain (Test #1): FAILED\n")
97 cmds.file(f=
True, new=
True)
98 sphere = cmds.polySphere(r=1, sx=20, sy=20, ax=(0, 1, 0), tx=1, ch=1)
99 cube = cmds.polyCube(w=1, h=1, d=1, sx=1, sy=1, sz=1, ax=(0, 1, 0), tx=1, ch=1)
100 cmds.select(sphere[0])
101 objSet = maya.mel.eval(
"spBasicObjectSetTest")
102 cmds.connectAttr(
"%s.message" % cube[0],
"%s.usedBy[0]" % objSet)
103 cmds.delete(sphere[0])
104 if not cmds.objExists(objSet):
108 print(
"testBasicObjectSetMain (Test #1): FAILED\n")