Requesting a tiny script : )

Requesting a tiny script : )

Anonymous
Not applicable
681 Views
4 Replies
Message 1 of 5

Requesting a tiny script : )

Anonymous
Not applicable

I was hoping someone would be able to write something up for me really quickly - I only ask because I know it won't be difficult for someone with mel or python knowledge

 

-for each object (skeletal joint) selected

-disable "Segment Scale Compensate" from the attribute editor 

 

i currently have this, but its throwing array errors 

 

string $sel[] = `ls -sl`;

int $i = 0;
int $size = size($sel);
for($i = 0; $i < $size; $i++)
{
setAttr ($sel[$i] + ".segmentScaleCompensate") 1;
}

 

You will earn 1 million virtual high fives and my love for eternity 

 

0 Likes
682 Views
4 Replies
Replies (4)
Message 2 of 5

Cory_XD
Autodesk
Autodesk

I think you just need to filter for joints in your first line:

 

string $sel[] = `ls -sl -type "joint"`;

 

I tried with a simple joint chain and some primitives parented in and had an error that pCone1 doesn't have segmentScaleCompensate so give this a shot.

Cory "Mr. Entertainment" Mogk
http://area.autodesk.com/blogs/cory
0 Likes
Message 3 of 5

Anonymous
Not applicable

It's still saying that $sel is not an array (line 6)

 

I'm going to try restarting maya

0 Likes
Message 4 of 5

Anonymous
Not applicable

yea.. I restarted maya and the original script works. yours does too! 

 

Thanks

0 Likes
Message 5 of 5

Cory_XD
Autodesk
Autodesk

I wonder if you did something like:

 

string $sel;

 

and then:

 

string $sel[];

 

Maya doesn't llike you redelaring the type. Other than restarting you could make a new variable name.

Cory "Mr. Entertainment" Mogk
http://area.autodesk.com/blogs/cory
0 Likes