<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting unexpected indent error when executing python script in script edito in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8380830#M8821</link>
    <description>&lt;P&gt;The code in the _init_() method is indented two levels deep. It should only be indented one level deep. Compare it to the code in the addlightgroup() method.&lt;/P&gt;&lt;P&gt;It might be that the code in _init_ has been indented with TAB characters while the code in addlightgroup() has been indented with spaces. You shouldn't mix the two forms of indentation in the same script so ensure that all of the code is indented using just tabs or just spaces.&lt;/P&gt;&lt;P&gt;You should also check the empty lines to make sure that they really are empty and don't contain spaces, TABs or other invisible characters.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Nov 2018 16:06:27 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-11-05T16:06:27Z</dc:date>
    <item>
      <title>Getting unexpected indent error when executing python script in script editor.</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8373408#M8818</link>
      <description>&lt;P&gt;i am getting an unexpected indent error in the script editor when trying to execute this python script.i didnt write this script just copied it from somewhere else cause i dont know how to write code.i want to create lpe for the light groups automatically.I will attach the script down below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import pymel.core as pmc&lt;BR /&gt;import mtoa&lt;/P&gt;&lt;P&gt;interface = mtoa.aovs.AOVInterface()&lt;/P&gt;&lt;P&gt;class Aov(object):&lt;BR /&gt;def _init_(self,name,lpe):&lt;BR /&gt;self.name = name&lt;BR /&gt;self.lpe = lpe&lt;BR /&gt;self.lpeGroup = None&lt;BR /&gt;&lt;BR /&gt;def addlightgroup(self,lightgroup):&lt;BR /&gt;self.ipegroup = self.lpe.replace('L.', *L.'()'*.format(lightgroup))&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;aovkeys = [ Aov("diffuse_direct". lpe = "C&amp;lt;RD&amp;gt;L"),&lt;BR /&gt;Aov("diffuse_indirect". lpe = "C&amp;lt;RD&amp;gt;[DSVOB].*"),&lt;BR /&gt;Aov("specular_direct". lpe = "C&amp;lt;RS[^'coat']&amp;gt;L"),&lt;BR /&gt;Aov("specular_indirect". lpe = "C&amp;lt;RS[^'coat']&amp;gt;[DSVOB].*"),&lt;BR /&gt;Aov("transmission_direct". lpe = "C&amp;lt;TS&amp;gt;L"),&lt;BR /&gt;Aov("transmission_indirect". lpe = "C&amp;lt;TS&amp;gt;[DSVOB].*"),&lt;BR /&gt;]&lt;/P&gt;&lt;P&gt;def getlights():&lt;BR /&gt;return pmc.ls(type['aiAreaLight', 'aiSkyDomeLight'])&lt;BR /&gt;&lt;BR /&gt;def getlightgroup():&lt;BR /&gt;groups = []&lt;BR /&gt;for light in getlights():&lt;BR /&gt;groups.append(light.aiAov.get())&lt;BR /&gt;return groups&lt;BR /&gt;&lt;BR /&gt;for aovKey in aovKeys:&lt;BR /&gt;for lightgroup in getlightgroups():&lt;BR /&gt;sceneAov = interface.addAOV("{}_{}*.format(lightgroup,aovKey.name))&lt;BR /&gt;aiAov = pmc.Pynode(sceneAov.node)&lt;BR /&gt;aovkey.addlightgroup(lightgroup)&lt;BR /&gt;aiAov.lightPathExpression.set(aovkey.lpeGroup)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;also im attaching the the screen shot of the script editor.Please help ASAP!!!.&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="lpe script error.jpg" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/564341i572235A57B9AD09C/image-size/large?v=v2&amp;amp;px=999" role="button" title="lpe script error.jpg" alt="lpe script error.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 12:12:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8373408#M8818</guid>
      <dc:creator>hitecom8172</dc:creator>
      <dc:date>2018-11-01T12:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8376600#M8819</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6417472"&gt;@hitecom8172&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Python uses spacing at the start of the line to determine when code blocks start and end. Errors you can get are:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Unexpected indent.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;This line of code has more spaces at the start than the one before, but the one before is not the start of a subblock (e.g. if/while/for statement). All lines of code in a block must start with exactly the same string of whitespace. For instance:&lt;/P&gt;
&lt;PRE class="lang-py prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;def&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; a&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;():&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;...&lt;/SPAN&gt;   &lt;SPAN class="kwd"&gt;print&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"foo"&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;...&lt;/SPAN&gt;     &lt;SPAN class="kwd"&gt;print&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"bar"&lt;/SPAN&gt;
&lt;SPAN class="typ"&gt;IndentationError&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; unexpected indent&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This one is especially common when running python interactively: make sure you don't put any extra spaces before your commands. (Very annoying when copy-and-pasting example code!)&lt;/P&gt;
&lt;PRE class="lang-py prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;   &lt;SPAN class="kwd"&gt;print&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"hello"&lt;/SPAN&gt;
&lt;SPAN class="typ"&gt;IndentationError&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; unexpected indent&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Unindent does not match any outer indentation level.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;This line of code has fewer spaces at the start than the one before, but equally it does not match any other block it could be part of. Python cannot decide where it goes. For instance, in the following, is the final print supposed to be part of the if clause, or not?&lt;/P&gt;
&lt;PRE class="lang-py prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;if&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; user &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;==&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"Joey"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;...&lt;/SPAN&gt;     &lt;SPAN class="kwd"&gt;print&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"Super secret powers enabled!"&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;...&lt;/SPAN&gt;   &lt;SPAN class="kwd"&gt;print&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"Revealing super secrets"&lt;/SPAN&gt;
&lt;SPAN class="typ"&gt;IndendationError&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; unindent does &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;not&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; match any outer indentation level&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Expected an indented block.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;This line of code has the same number of spaces at the start as the one before, but the last line was expected to start a block (e.g. if/while/for statement, function definition).&lt;/P&gt;
&lt;PRE class="lang-py prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;def&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; foo&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;():&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;...&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;print&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"Bar"&lt;/SPAN&gt;
&lt;SPAN class="typ"&gt;IndentationError&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; expected an indented block&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want a function that doesn't do anything, use the "no-op" command&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;pass&lt;/EM&gt;:&lt;/P&gt;
&lt;PRE class="lang-py prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="pun"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;def&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; foo&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;():&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;...&lt;/SPAN&gt;     &lt;SPAN class="kwd"&gt;pass&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Mixing tabs and spaces is allowed (at least on my version of Python), but Python assumes tabs are 8 characters long, which may not match your editor.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Just say "no" to tabs.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Most editors allow them to be automatically replaced by spaces.&lt;/P&gt;
&lt;P&gt;The best way to avoid these issues is to always use a consistent number of spaces when you indent a subblock, and ideally use a good IDE that solves the problem for you. This will also make your code more readable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a link for where you got the code from we might be able to copy the format properly and fix this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 15:27:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8376600#M8819</guid>
      <dc:creator>sean.heasley</dc:creator>
      <dc:date>2018-11-02T15:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8377849#M8820</link>
      <description>&lt;P&gt;I got this from a youtube video i retyped the code as i did not have access to the source files&amp;nbsp; I copied it from a screenshot of the video.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link :&lt;A href="https://youtu.be/8Q35eXqkjWM" target="_blank"&gt;https://youtu.be/8Q35eXqkjWM&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can reformat it properly and give it to me i would be very grateful.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Nov 2018 11:21:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8377849#M8820</guid>
      <dc:creator>hitecom8172</dc:creator>
      <dc:date>2018-11-03T11:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8380830#M8821</link>
      <description>&lt;P&gt;The code in the _init_() method is indented two levels deep. It should only be indented one level deep. Compare it to the code in the addlightgroup() method.&lt;/P&gt;&lt;P&gt;It might be that the code in _init_ has been indented with TAB characters while the code in addlightgroup() has been indented with spaces. You shouldn't mix the two forms of indentation in the same script so ensure that all of the code is indented using just tabs or just spaces.&lt;/P&gt;&lt;P&gt;You should also check the empty lines to make sure that they really are empty and don't contain spaces, TABs or other invisible characters.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 16:06:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8380830#M8821</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-05T16:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8381565#M8822</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6417472"&gt;@hitecom8172&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have time to go through the script manually and resolve it for you however&amp;nbsp;@Anonymous&amp;nbsp;made some good suggestions and I recommend following his advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 21:24:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8381565#M8822</guid>
      <dc:creator>sean.heasley</dc:creator>
      <dc:date>2018-11-05T21:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8381759#M8823</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want someone to check your code then please add it again with the &amp;lt;/&amp;gt;&amp;nbsp; (Insert Code) feature, so formatting will not be lost.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Test
	indent
		indent&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Nov 2018 22:58:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8381759#M8823</guid>
      <dc:creator>mspeer</dc:creator>
      <dc:date>2018-11-05T22:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8382730#M8824</link>
      <description>&lt;PRE&gt;import pymel.core as pmc
import mtoa

interface = mtoa.aovs.AOVInterface()

class Aov(object)
    def _init_(self,name,lpe) :
        self.name = name
        self.lpe = lpe
        self.lpegroup = None

    def addlightgroup(self,lightgroup):
        self.lpegroup = self.lpe.replace('L.',"L.'()'".format(lightgroup))


aovkeys = [ Aov("RGBA", lpe = "C.*"),
]

def getlights():
    return pmc.ls(type['aiArealight', 'aiSkydomelight'])

def getlightgroup():
    groups = []
    for light in getlights():
        groups.append(light.aiAov.get())
    return groups

for aovkey in aovkeys:
    for lightgroup in getlightgroups():
        sceneAov = interface.addAOV("{}_{}".format(lightgroup,aovkey.name))
        aiAov = pmc.Pynode(sceneAov.node)
        aovkey.addlightgroup(lightgroup)
        aiAov.lightPathExpression.set(aovkey.lpegroup)&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 11:25:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8382730#M8824</guid>
      <dc:creator>hitecom8172</dc:creator>
      <dc:date>2018-11-06T11:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8389594#M8825</link>
      <description>&lt;P&gt;This line:&lt;/P&gt;&lt;PRE&gt;class Aov(object)&lt;/PRE&gt;&lt;P&gt;should have a ':' at the end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This line:&lt;/P&gt;&lt;PRE&gt;    def _init_(self,name,lpe) :&lt;/PRE&gt;&lt;P&gt;should not have a space before the ':'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After making those changes I no longer get any syntax or indent errors, but there are errors when executing the code which I don't have time to debug.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 18:23:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8389594#M8825</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-08T18:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8391115#M8826</link>
      <description>&lt;P&gt;oh um i get his error now .TypeError: file &amp;lt;maya console&amp;gt; line 16: object() takes no parameters # .sorry abot the problems i am 13 and i dont know how to write python&lt;/P&gt;</description>
      <pubDate>Fri, 09 Nov 2018 10:18:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8391115#M8826</guid>
      <dc:creator>hitecom8172</dc:creator>
      <dc:date>2018-11-09T10:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8393609#M8827</link>
      <description>&lt;P&gt;um any solutions to this&lt;/P&gt;</description>
      <pubDate>Sat, 10 Nov 2018 16:14:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8393609#M8827</guid>
      <dc:creator>hitecom8172</dc:creator>
      <dc:date>2018-11-10T16:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8396407#M8828</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6417472"&gt;@hitecom8172&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe that error is also linked to mixing tabs and spaces like&amp;nbsp;@Anonymous&amp;nbsp;mentioned above. You would need to go through and pretty much clean up the indents and make sure that they are all done either via spaces or tabs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This forum is primarily dedicated to support issues&amp;nbsp;for problems with Maya or things not working as expected. Not many users have the time to go in depth with this code and potentially re write it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you&amp;nbsp;&lt;EM&gt;really&lt;/EM&gt; need this script, you could rewrite the code yourself by just copying what you see and just make to either use spaces or tabs to avoid the issue that you're currently seeing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 15:59:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8396407#M8828</guid>
      <dc:creator>sean.heasley</dc:creator>
      <dc:date>2018-11-12T15:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8396499#M8829</link>
      <description>&lt;P&gt;Also, the error is likely a generic Python one rather than something specific to Maya, so you could post the code and error message on a Python programming forum and they would likely be able to spot the problem pretty quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 16:29:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8396499#M8829</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-11-12T16:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8396580#M8830</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6417472"&gt;@hitecom8172&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@Anonymous&amp;nbsp;has the right idea. If you take your error and do a quick google search with it one of the first links is to stack overflow (which is a really solid site for getting help with programming issues) and it specifically mentions the spaces vs tabs issue. Like&amp;nbsp;@Anonymous&amp;nbsp;said the issue is most likely specific to Python and not Maya itself and I also recommend reaching out to a specific programming forum for more in depth help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Nov 2018 16:51:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8396580#M8830</guid>
      <dc:creator>sean.heasley</dc:creator>
      <dc:date>2018-11-12T16:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8396758#M8831</link>
      <description>&lt;P&gt;The "ls" command is also being used incorrectly. "type" is an argument so you should have this:&lt;/P&gt;
&lt;PRE&gt;def getlights():
    return pmc.ls(type=['aiArealight', 'aiSkydomelight'])&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Nov 2018 18:04:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8396758#M8831</guid>
      <dc:creator>kevin.picott</dc:creator>
      <dc:date>2018-11-12T18:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398027#M8832</link>
      <description>&lt;P&gt;i checked the code line after line and where you pointed out is the place where i start to get errors how do i solve that?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 08:47:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398027#M8832</guid>
      <dc:creator>hitecom8172</dc:creator>
      <dc:date>2018-11-13T08:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398407#M8833</link>
      <description>&lt;P&gt;I would recommend you post the errors you are getting. When it comes to debugging code it's next to impossible to do blind (like when I'm debugging my mother's email problems over the phone).&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 12:13:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398407#M8833</guid>
      <dc:creator>kevin.picott</dc:creator>
      <dc:date>2018-11-13T12:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398410#M8834</link>
      <description>Unexpected indent error right where you mentioned. Every thing before that&lt;BR /&gt;works fine.&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Nov 2018 12:15:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398410#M8834</guid>
      <dc:creator>hitecom8172</dc:creator>
      <dc:date>2018-11-13T12:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398416#M8835</link>
      <description>&lt;P&gt;Did you ensure that your script only contains either spaces or tabs but not both? It could visually look the same but Python does not like it when they are mixed.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 12:17:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398416#M8835</guid>
      <dc:creator>kevin.picott</dc:creator>
      <dc:date>2018-11-13T12:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398424#M8836</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Yep i have only spaces as i converted everything in sublime. As i said before everything before def getlights is fine. Somewhere in that command is the error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 12:21:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398424#M8836</guid>
      <dc:creator>hitecom8172</dc:creator>
      <dc:date>2018-11-13T12:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Getting unexpected indent error when executing python script in script edito</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398442#M8837</link>
      <description>&lt;P&gt;Can you repost your modified code with the &amp;lt;/&amp;gt; formatting? This type of error is always caused by a misplaced character or two so it's impossible to tell from a description what is going wrong.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 12:28:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/getting-unexpected-indent-error-when-executing-python-script-in/m-p/8398442#M8837</guid>
      <dc:creator>kevin.picott</dc:creator>
      <dc:date>2018-11-13T12:28:56Z</dc:date>
    </item>
  </channel>
</rss>

