newguy4life

03-11-2011, 07:33 PM

Hello everybody,

I am very new to scripting, and I'm sure this has been covered before but I had a hard time knowing what to search for to find my answer, so I apologize if this is redundant.

I am trying to basically have a bunch of objects in a string rotate by a fraction of what the object before it does. So if I have objects A B and C, and I rotate A 100, B would be 90, C would be 81 etc.

I have it working where I hit the button, and it positions them correctly, but I can't figure out how link them via an expression or something so that I can move object A and the other objects would move in relation to that without hitting the button.

Here is my current script:

// rotates the object 90% of object below

string $feathers[] = `ls -sl`; int $i = 0;

for ($i=1; $i<size($feathers); $i++)

{

float $ro = `getAttr($feathers[$i-1] + ".rotateY")`;

setAttr ($feathers[$i]+".rotateY") ($ro*.9);

};

If anybody can point me in the right direction, you would be helping me out BIG time!

Thanks a lot!

I am very new to scripting, and I'm sure this has been covered before but I had a hard time knowing what to search for to find my answer, so I apologize if this is redundant.

I am trying to basically have a bunch of objects in a string rotate by a fraction of what the object before it does. So if I have objects A B and C, and I rotate A 100, B would be 90, C would be 81 etc.

I have it working where I hit the button, and it positions them correctly, but I can't figure out how link them via an expression or something so that I can move object A and the other objects would move in relation to that without hitting the button.

Here is my current script:

// rotates the object 90% of object below

string $feathers[] = `ls -sl`; int $i = 0;

for ($i=1; $i<size($feathers); $i++)

{

float $ro = `getAttr($feathers[$i-1] + ".rotateY")`;

setAttr ($feathers[$i]+".rotateY") ($ro*.9);

};

If anybody can point me in the right direction, you would be helping me out BIG time!

Thanks a lot!