SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / filter selection for quick edit
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 04-08-2006, 04: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 05:00 PM.
Falott is offline   Reply With Quote
Old 04-08-2006, 05: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, 05: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, 10: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
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.