Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've been Googling for two days now and trying every suggestion, so far nothing is working.
I've tried append, add, insert, in every syntax I can think of and nothing works.
I'm using Python script because there are things (working) that I couldn't figure out with MEL
I's starting out with a polymesh array with a length of 1 called 'transforms'
And a matrix array with 3 xforms called matrices
This is the current error
# Error: AttributeError: file <maya console> line 1: 'unicode' object has no attribute 'insert'
And here is the code snippit
num = 1
print '-------------------------Starting Outer Loop\n'
for x in range(2):
print '-------------------------Starting Inner Loop\n'
print '===loop:' + str(x)
for matrix in matrices:
cmds.select(transforms)
cmds.duplicate()
cmds.xform( m = matrix )
cmds.makeIdentity( apply=True )
num += 1
print 'Number of objects = ' + str(num)
obj = cmds.ls(sl=True)
transforms.insert(num, obj)
print(matrix)
Surely someone has figured this out?
Solved! Go to Solution.