List index out of range(line 5)
<p>Code:</p>

<pre><code>selObj = mc.ls(sl=True)
sizeSel = len(selObj)
for a in range(sizeSel):
    if a &lt; sizeSel:
        mc.parent( selObj[a +1], selObj[a])
</code></pre>

<p>I don't know enough about your code to test, but its clear that since <code>a</code> counts to the end of your list, <code>a+1</code> overflows. Just reduce the index counter by one. And no need to check it twice.</p>

<pre><code>selObj = mc.ls(sl=True)
sizeSel = len(selObj)
for a in range(sizeSel-1):
    mc.parent( selObj[a +1], selObj[a])
</code></pre>

python