Creating multiple proxy onjects
Does anyone know of a way I can speed up creating proxy objects of the geometry in a scene. Say I have a scene where ther are 100 seperate pieces of geometry. If I want to smooth them all, I have to convert each one to a sub div surface or create a proxy object, in turn, one by one. You dont seem to be able to select more than object and smooth them. Am I right...and I just have to do each one in turn?
|
This sounds like a very simple MEL/Python task, select all your objects, and in a python tab run this...
import maya.cmds as mc sel = mc.ls(sl=True) for i in range(len(sel)): polyToSub = mc.polyToSubdiv(sel[i]) mc.hide(sel[i]) give me a shout if have problems... cheers, Chris |
Quote:
|
Enetered this into the Python Tab of the Script editor, and this is the error message I got on execution
# Error: ('expected an indented block', ('<maya console>', 5, 9, 'polyToSub = mc.polyToSubdiv(sel[i])')) |
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 ;) |
Cheers stwert, I know it must be doable cause Ive just seen a tutorial where the guy uses a smooth button he has created on his shelf from a MEL script.
I did each piece individually in the end, but I will have to go through the process again at some point over the next few days and wil give this a try again then. |
All times are GMT. The time now is 05:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018