PDA

View Full Version : Change Pivot Multiple faces and Ramp driven rotation


fatsumo
09-23-2009, 03:18 PM
Hi guys,

in the process of making a script for a job im working on and am falling short on two hurdles.
So far I am using colourAtPoint to drive a ramp through my object turning on the vis as it goes. Works great!

Next I want it to change the pivots on my objects so they rotate from the last one displayed.
After this I want them to rotate from 180 to 0 but with the interpolation inbetween. So far I can just get them to snap and that's all.

Any ideas would be amazing!

This is my code after colourAtPoint

//
for( $i = 1; $i < size( $offsets ); $i++ )

{

$attrib = ($obj + $i + ".visibility");

setAttr $attrib ($offsets[$i]);

setKeyframe $attrib;

}

};

//

fatsumo
09-23-2009, 04:03 PM
Okay cool,

got this sort of working for the moving pivot, but how can I get it to go through my list of objects and not just have to define pSphere1.rotatePivot ???

Still stuck on implementing the animation. It can be three seperate scripts I suppose.

{

string $vertIndex;

float $vertTemp[3];

string $vertices[];

$vertices = `filterExpand -sm 31`;

if (`size $vertices` == 0) {

print "\n** No vertices selected **\n";

}

for ($vertIndex in $vertices){

$vertTemp= `pointPosition $vertIndex`;

move -a $vertTemp[0] $vertTemp[1] $vertTemp[2] pSphere.rotatePivot ;

}

};

fatsumo
09-23-2009, 04:38 PM
Okay this is starting to be a one man band here, so any help would be great. Im bodging it at the mo BUT have got a little further


{

string $vertIndex;

float $vertTemp[3];

string $vertices[];

string $objs[] = `ls -tr`;

$vertices = `filterExpand -sm 31`;

if (`size $vertices` == 0) {

print "\n** Select Verts UDF **\n";

}

for ($vertIndex in $vertices){

$vertTemp= `pointPosition $vertIndex`;

move -a $vertTemp[0] $vertTemp[1] $vertTemp[2] $objs.rotatePivot ;

}

};



////////////////

All is fine, but now because I am in component mode it doesnt recognise anything being selected. Any ways around this? ? ?

fatsumo
09-23-2009, 05:43 PM
mwuhahahah, i've done it!!!

YAY.

Pointless thread over.

CGTalk Moderation
09-23-2009, 05:43 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.