View Full Version : Setting multiple attributes for multiple objects

04 April 2006, 04:47 AM
Unfortunatly, I'm not a guru when it comes to mel or any programing for that matter. What I would like to do is select multiple objects and change there display attributes specifically the drawing overides subsection. I have been searching through the command reference but cant seem to find specifics relating to changing these attributes. If anyone has some recommendations or point me in the right direction it would be great.


04 April 2006, 08:28 AM
this will make all selected object into bounding box mod

string $shape[];
// list all selected objects
string $SelectedObjects[] = `ls -sl`;

// loop through all selected objects
for ( $obj in $SelectedObjects )
// get the shape node
$shape = `listRelatives -s $obj`;
// enable the override
setAttr ($shape[0]+".overrideEnabled") 1;
// set the level of detail to bounding box mode
setAttr ($shape[0]+".overrideLevelOfDetail") 1;

use the script editor too see the name off the attribute that you want to change, the name will be printed when you click in the attribute editor.

Robert Bateman
04 April 2006, 08:28 AM
setAttr to set the value on a node's attribute. Check the node & DG reference for details on the attribute names you want...

04 April 2006, 02:32 PM
Thanks all that replied I'll take those recommendations and give them a shot.

04 April 2006, 08:58 AM
I've created a script that deals with all the renderStats and I'm also writing a tutorial about it. This will probably be useful to you. Check the maya forums occationally, should be out this week/weekend.

CGTalk Moderation
04 April 2006, 08:58 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.