Forum: Autodesk Maya
Posted By: elmagnificocg
Post Time: 03 March 2018 at 07:26 AM
Text:
ok,i just want to show the speed of a moudle move in graph editor.
i know the translateX,Y,Z , but i just want to show the speed !!!
eg:
a ploygon at 1 frame (0,0,0)
a ploygon at 101 frame (10,0,0)
and the translate tangent is line ,so the speed should a line (value is 2.4, 24 frame one second )
i add four Attr, pos_x,y,z and speed .
the pos is the last position value
the speed is what i need .
so i created a expression at here:
float $x = dmd1.translateX - dmd1.pos_x;
float $y = dmd1.translateY - dmd1.pos_y;
float $z = dmd1.translateZ - dmd1.pos_z;
dmd1.speed = $x * $x + $y * $y + $z * $z;
dmd1.speed = sqrt(dmd1.speed)*24;
dmd1.pos_x = dmd1.translateX;
dmd1.pos_y = dmd1.translateY;
dmd1.pos_z = dmd1.translateZ;
but the speed value in channel is right,but in graph editor wrong .
it shows a translateXYZ's graph in speed's position.
maybe ,i couldnt discribe the situation clearly,you could have a try like what i set.
if the method is not right, is there any otherway than could show the speed curve in graph editor???
Thank you
Posted By: elmagnificocg
Post Time: 03 March 2018 at 07:26 AM
Text:
ok,i just want to show the speed of a moudle move in graph editor.
i know the translateX,Y,Z , but i just want to show the speed !!!
eg:
a ploygon at 1 frame (0,0,0)
a ploygon at 101 frame (10,0,0)
and the translate tangent is line ,so the speed should a line (value is 2.4, 24 frame one second )
i add four Attr, pos_x,y,z and speed .
the pos is the last position value
the speed is what i need .
so i created a expression at here:
float $x = dmd1.translateX - dmd1.pos_x;
float $y = dmd1.translateY - dmd1.pos_y;
float $z = dmd1.translateZ - dmd1.pos_z;
dmd1.speed = $x * $x + $y * $y + $z * $z;
dmd1.speed = sqrt(dmd1.speed)*24;
dmd1.pos_x = dmd1.translateX;
dmd1.pos_y = dmd1.translateY;
dmd1.pos_z = dmd1.translateZ;
but the speed value in channel is right,but in graph editor wrong .
it shows a translateXYZ's graph in speed's position.
maybe ,i couldnt discribe the situation clearly,you could have a try like what i set.
if the method is not right, is there any otherway than could show the speed curve in graph editor???
Thank you