Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 07-10-2010, 05:57 PM   #1
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default 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?
ben hobden is offline   Reply With Quote
Old 07-10-2010, 06:12 PM   #2
bendingiscool
Subscriber
 
bendingiscool's Avatar
 
Join Date: Jul 2006
Location: London
Posts: 567
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
bendingiscool is offline   Reply With Quote
Old 07-10-2010, 06:20 PM   #3
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

Originally posted by bendingiscool
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
Hi Chris. Thanks. I never use Python or MEL, and dont know how to use either. Can I just copy and paste all that into the python box under the viewport and hit enter? Will I need all the objects selected when doing so? Will I not need to add any semi-colons anywhere? at the end of each line? (I have a vague familiarity with php)
ben hobden is offline   Reply With Quote
Old 07-10-2010, 07:13 PM   #4
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

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])'))
ben hobden is offline   Reply With Quote
Old 07-10-2010, 10:12 PM   #5
stwert
EduSciVis-er
 
Join Date: Dec 2005
Location: Toronto
Posts: 3,371
Thanks: 74
Thanked 709 Times in 642 Posts
Default

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
stwert is offline   Reply With Quote
Old 07-10-2010, 10:26 PM   #6
ben hobden
Subscriber
 
ben hobden's Avatar
 
Join Date: Jul 2008
Location: Chelmsford, Essex, UK
Posts: 1,162
Thanks: 13
Thanked 89 Times in 85 Posts
Default

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.
ben hobden is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Problem - Unable to change attributes for multiple objects anthonysw3 Technical Issues 4 04-12-2010 11:56 PM
New Feature: Multiple Image Upload David Members Lounge 0 30-11-2010 09:40 PM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.