Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

gopisvara krsna
30 Points# Error: IndentationError: file <maya console> line 1: unindent does not match any outer indentation level #
hello hi , im new here. im a python newbie using with maya 2018... i can't seem to get my code to work. i have been following this tutorial (https://www.youtube.com/watch?v=bF-PFPacs88) am i doing anything wrong ? pls helppp
at the last part when i put my below mentioned code. i can't seem to make it work. im using sublime btw. plus help import new_auto_rig reload(new_auto_rig) new_auto_rig.gui()
''' import new_auto_rig reload(new_auto_rig) new_auto_rig.gui() '''
import pymel.core as pm scriptName = name newWindow = 'Auto_armRig_Maker'
def showUI(): if(pm.window(newWindow, q=True, exists=True)): pm.deleteUI(newWindow)
if(pm.windowPref(newWindow, q=True, exists=True)):
pm.deletePref(newWindow, r=True)
myWindow = pm.window(newWindow, t= 'Auto Arm Rig', w=150, h=325)
main_layout = pm.columnLayout('Main Header')
# naming options (option menu)
pm.text('naming_Text', l='Name')
pm.rowColumnLayout(nc=4, cw=[(1,20),(2,40),(3,40),(4,50)])
pm.text('side_Text', label='?:')
pm.optionMenu('side_Menu')
pm.menuItem(label='LF_')
pm.menuItem(label='RT_')
pm.menuItem(label='CT_')
pm.text('label_Txt', label= 'Part:')
pm.optionMenu('side_Menu')
pm.menuItem(label= 'Arm')
pm.menuItem(label= 'Leg')
pm.setParent(main_layout)
pm.separator('name_Sep', w=150, h=5)
# set the rig type (radio button)
pm.text('rigType_Text', l='Rig Type')
pm.radioButtonGrp('armType_Btn',labelArray3=('IK', 'FK', 'IKFK'), numberOfRadioButtons=3, columnWidth3=[50,50,50], select=3)
pm.separator('type_Sep', width=150, height=5)
# set icon options (option menu
pm.text('ctrlSet_Text', label='Controller')
pm.rowColumnLayout(nc=2,cw=[(1,90),(2,60)])
pm.text('ikStyle_Text', label='IK')
pm.optionMenu('ikIcon_Menu')
pm.menuItem(label= 'Box')
pm.menuItem(label= '4 Arrows')
pm.menuItem(label= '4 Pin')
pm.text('fkStyle_Text', label='FK')
pm.optionMenu('fkIcon_Menu')
pm.menuItem(label= 'Circle')
pm.menuItem(label= 'Turn Arrows')
pm.text('Style_Text', label='Ctrl')
pm.menuItem(label= 'Circle')
pm.menuItem(label= 'COG')
pm.text('pvStyle_Text', label='PoleVector')
pm.optionMenu('pvCtrl_Menu')
pm.menuItem(label= '<>')
pm.menuItem(label= '->')
pm.setParent(main_Layout)
pm.button('testIcon_Btn', l='Test Scale', w=150)
pm.separator('style_Sep', w=150, h=5)
# pick the color (iconTextButton and colorSlider)
pm.text('armColor_Text', l='Controller Color')
pm.gridLayout(nr=1, nc=5, cellWidthHeigh=[30,20])
pm.iconTextButton('darkBlue_Btn', bgc=[.000,.016,.373])
pm.iconTextButton('lightBlue_Btn', bgc=[0,0,1])
pm.iconTextButton('brown_Btn', bgc=[.537,.278,.2])
pm.iconTextButton('red_Btn', bgc=[1,0,0])
pm.iconTextButton('yellow_Btn', bgc=[1,1,0])
pm.setParent(main_Layout)
pm.colorIndexSliderGrp('Color', w=150, h=20, cw2=(150,0), min=0, max=31, value=7)
pm.separator('color_Sep', w=150, h=5)
# pole vector options ( radio button )
pm.text('PV_Text', label= 'PV Option')
pm.radioButtonGrp('addPVE_Btn', labelArray2=('Twist','PoleVector'), numberOfRadioButtons=2, columnWidth2=[65,85], select=2)
pm.separator('pv_Sep', w=150, h=5)
pm.button('final_Btn', l='Tadaaaaaa!', width=150)
pm.showWindow()
1 Answer

Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsWhitespace (spaces and tabs) matters in python. We indent to start a block, and if you're coming from other programming languages that use curly braces, it can take some getting used to because whitespace is invisible. You can also have tricky errors that are hard to debug if you're using tabs and spaces to indent inconsistently (and if you're copying and pasting code from other sources this can lead to these kinds of bugs, in my experience).
I can't help you with the exact error here - the code isn't coming through formatted in a way that let's me see the problem. But maybe this article will help you understand the general issue.
https://stackoverflow.com/questions/13884499/what-is-python-whitespace-and-how-does-it-work