View Single Post
# 5 07-10-2010 , 09:12 PM
EduSciVis-er
Join Date: Dec 2005
Location: Toronto
Posts: 3,374
Python doesn't require end of line syntax, such as semi-colons, however, it does require you to define grouped statements by way of whitespace.
What this means is that you will have to tab in the two lines after "for in in range..."

The whitespace was obviously lost when bendingiscool pasted in the code here.

Edit: Should be like this:

import maya.cmds as mc

sel = mc.ls(sl=True)

for i in range(len(sel)):
[tab] polyToSub = mc.polyToSubdiv(sel[i])
[tab] mc.hide(sel[i])

#replace the [tab] with an actual tab user added image


-stwert

Website - Blog - YouTube - Vimeo - Facebook - Twitter

-->How to Effectively Ask Questions on Forums<--