PDA

View Full Version : unindent error, stumped


gauranga108
12-08-2012, 02:53 AM
Hi,

I'm trying to write a little tool that will loop through my list of sets, select the verts from each set, mirror the selection(via someones else's tool n_mirrorComponents great tool) then put the mirrored selection into a new set and rename the set. But I keep getting this error on unindent.

# Error: line 1: unindent does not match any outer indentation level #


after entering my code

codeA
l_indexSets = [ 'l_index_01_set', 'l_index_02_set', 'l_index_03_set', 'l_index_04_set', 'l_index_05_set', 'l_index_06_set', 'l_index_07_set', 'l_index_08_set', 'l_index_09_set', 'l_index_10_set']

for i in range(len(l_indexSets)):
cmds.select(l_indexSets[i])

mc = n_mirrorComponents()
mc.doIt()
print mc.mirroredComponents
cmds.sets(n='r_'+l_indexSets[i])

if I just do

codeB
l_indexSets = [ 'l_index_01_set', 'l_index_02_set', 'l_index_03_set', 'l_index_04_set', 'l_index_05_set', 'l_index_06_set', 'l_index_07_set', 'l_index_08_set', 'l_index_09_set', 'l_index_10_set']

for i in range(len(l_indexSets)):
cmds.select(l_indexSets[i])


cmds.sets(n='r_'+l_indexSets[i])

it works and if I do

codeC
mc = n_mirrorComponents()
mc.doIt()
print mc.mirroredComponents

it works, so why the unindent error for codeA, which is just codeC under the for loop in cobeB?


Please help, thanks a lot for your time.

gauranga108
12-08-2012, 07:02 AM
Sorry never mind, maya wasn't working, needed a reboot.

gauranga108
12-08-2012, 08:26 AM
Actually is wasn't maya it was textMate the app i was using to copy and paste code from to the scrip editor.

It all look indented but the indentation was corrupt or something.

not sure about textMate anymore.

nookie
12-08-2012, 10:50 AM
You were probably just mixing tabs and spaces in the indentation.
I usually use notepad++ and there is and option that let you use 4 spaces when you pres the tab button on your keyboard.
Check if you have something similar in your IDE :)

CGTalk Moderation
12-08-2012, 10:50 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.