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 04-08-2006, 05:54 PM   #1
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default filter selection for quick edit

I often have to make the same corrections like change backface culling to a bunch of objects. instead of doing it all manually it would be great to use a simple line of mel like


$sel = `filterExpand -sm Mask)` ;
setAttr $sel+Shape.backfaceCulling 0;


the filterExpand command doesn´t return me a shapeType or the objects name tho..? how would I go in MEL to apply an operation to my current selection?
__________________
everything starts and ends in the right place at the right time.

Last edited by Falott : 04-08-2006 at 06:00 PM.
Falott is offline   Reply With Quote
Old 04-08-2006, 06:08 PM   #2
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

`ls -s`returns me all the shape nodes of all objects tho just one is selected. this should not happen? `ls -sl` returns my selected object which I need for connecting it to .backfaceCulling.

I still can´t find the answer. how do I connect an attribute to the selected object?
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 04-08-2006, 06:25 PM   #3
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

string $cmd = "(setAttr $itemList + ".backfaceCulling 0")";
string $itemList[] = `ls -sl`;
select -d;
string $results[] = executeForEachObject($itemList, $cmd);


still the first line does not compute. please somebody help.
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 04-08-2006, 11:03 PM   #4
MattTheMan
Registered User
 
MattTheMan's Avatar
 
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
Thanks: 0
Thanked 18 Times in 18 Posts
Default

you could do this:
Code:
string $shapes[] = `ls -sl`;
for ($one in $shapes[]){
`setAttr $one+".backfaceCulling 0"`;
}
you can change the middle thing with setAttr, but this script gets all the shapes, puts them into an array. Then it picks the first one, uses it, next one, uses it, next one... and so on. This is what I use for the core of me and arneoog's Maya to Indigo XML converter.

tell me if it works
__________________
Live the life you love, love the life you live
MattTheMan is offline   Reply With Quote

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.