Beer glass scene creation
This course contains a little bit of everything with modeling, UVing, texturing and dynamics in Maya, as well as compositing multilayered EXR's in Photoshop.
# 1 04-08-2006 , 04:54 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095

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 05:00 PM.
# 2 04-08-2006 , 05:08 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
`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.
# 3 04-08-2006 , 05:25 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
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.
# 4 04-08-2006 , 10:03 PM
MattTheMan's Avatar
Registered User
Join Date: Apr 2005
Location: Fairfield, CT
Posts: 2,436
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
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads