PDA

View Full Version : Primary visibilty on multiple objects at once


kAzIDamUI
04-24-2009, 03:57 AM
Hello,
I would like to have a piece of mel that get all my selected objects and change the primary visibility value in the render stats of each one at once.

I know it should work with "a simple loop" but unfortunately I only understand enough to modify variables and values but not write/modify syntax.

Could anyone help me to build this little script ?

Thank you very much

tbaypaul
04-25-2009, 05:33 PM
This will toggle visability, if you want OFF only then replace the last line with this new set Attribute line.....
setAttr ($node + ".primaryVisibility") 0;// OFF ONLY

// Primary Visability
{
string $nodes[] = `ls -sl`;
for($node in $nodes){
string $shape[] = `listRelatives -shapes`;
setAttr ($node + ".primaryVisibility") (!`getAttr ($node + ".primaryVisibility")`);// Toggles Vis
}
}

kAzIDamUI
04-26-2009, 01:12 AM
hey, thank you very much for your help, but actually, I've found how to do it within Maya :

- select your objects
- go to window > general editors > attribute spread sheet
- display the render tab and then you have access to a crossed list of your objects and all their render stats

ftaswin
04-27-2009, 11:50 PM
hey, thank you very much for your help, but actually, I've found how to do it within Maya :

- select your objects
- go to window > general editors > attribute spread sheet
- display the render tab and then you have access to a crossed list of your objects and all their render stats


Trust me you don't wanna do that on regular basis. Use the script and bind it to a hotkey. Mine is "h". You'll never look back :P

ft

kAzIDamUI
04-28-2009, 01:46 AM
yep, it is pretty handy.
I just like to know different ways to do things... with maya, you never know...
thx for the tip, h is a good choice ^^

CGTalk Moderation
04-28-2009, 01:46 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.