PDA

View Full Version : n00b question about Shelf button


DrYo
10-17-2007, 01:05 AM
Hi,

Please be gentle with me, it's my first time.

I wanted to make a shelf button to enable or disable the NURBS shape attribute called "Display Render Tessellation." Unfortunately, the Script Editor echoed a setAttr command which was specific to the object I had selected, so that was useless.

My question is, how do I set attributes for any and all selected objects?

Thanks

r4inm4ker
10-17-2007, 02:13 AM
string $allDag[] = `ls -sl -dag`;
for($currDag in $allDag)
if(`objectType -i "nurbsSurface" $currDag`)
{
int $value = !(`getAttr ($currDag+".displayRenderTessellation")`);
setAttr ($currDag+".displayRenderTessellation") $value;
};


this should work.

DrYo
10-17-2007, 06:02 PM
Cool, thanks so much! I'll study this to learn.

CGTalk Moderation
10-17-2007, 06:02 PM
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.