I am confused, If I remove the part that says mc.setAttr(dupObj+
".translate",trX,trY,trZ,type="double3") I will get 10 duplicates of my
object. But if I add back in I only get 2 duplicates? Could someone
explain whats going on here.
def makeStairs(number=10):
import random
if number >= 1:
masterGroup = mc.group(empty=True, name='MasterGroup')
for x in range (10):
step = mc.polyCube(name='TED_'+str((x)+1))
mc.parent(step[0], masterGroup)
print 'making step_' + str((x)+1)
stepsAreReady = (1)
if stepsAreReady == (1) :
trX = random.uniform (-30,30)
trY = random.uniform (-30,30)
trZ = random.uniform (-30,30)
# duplicate and position steps #
for x in range (number):
dupObj = mc.duplicate(masterGroup)
mc.setAttr(dupObj+".translate",trX,trY,trZ,type="double3")
print "duplicate and position steps"
else:
print 'Dont make stairs'
makeStairs(10)
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/eae0aaa7-441a-4b83-9e32-ce653bc88594%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.