Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   filter selection for quick edit (https://simplymaya.com/forum/showthread.php?t=22610)

Falott 04-08-2006 04:54 PM

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?

Falott 04-08-2006 05:08 PM

`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?

Falott 04-08-2006 05:25 PM

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.

MattTheMan 04-08-2006 10:03 PM

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


All times are GMT. The time now is 01:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018