Maya Strenge Rotation when using Rigidbody Active

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
smallpixel
Posts: 2
Joined: Wed Sep 17, 2008 12:34 am

Maya Strenge Rotation when using Rigidbody Active

Post by smallpixel »

Hi freind, i think that maya user have notice the strange translation and rotation that happen when we convert object to Rigidbody,
i have created a script but it want work cause the object newly created a maded to 0 0 0 on every think so if any can help plz.

if any one can chek the script or test it plz


//Get The selection
string $mySelection[] = `ls -sl`;
string $selectionRB;

//Translation Scaling Rotation Variable Declaration
float $transX ;
float $transY ;
float $transZ ;

float $rotX ;
float $rotY ;
float $rotZ ;

float $scaleX ;
float $scaleY ;
float $scaleZ ;
int $z=1;

//Get the number of selected object
float $numSelection = `size ($mySelection)`;

//Get Intial Rot Pos Scale Stored into those Var and the convert the object to RB and restore the Initial Pause
for ($i=0;$i<$numSelection;$i++)
{

//Initialising all Var to zero
$transX = 0;
$transY = 0;
$transZ = 0;
$rotX = 0;
$rotY = 0;
$rotZ = 0;
$scaleX = 0;
$scaleY = 0;
$scaleZ = 0;

//Get Position XYZ stored
$transX = `getAttr ($mySelection[$i]+".translateX")`;
$transy = `getAttr ($mySelection[$i]+".translateY")`;
$transy = `getAttr ($mySelection[$i]+".translateZ")`;

//Get Rotation XYZ stored
$rotX = `getAttr ($mySelection[$i]+".rotateX")`;
$roty = `getAttr ($mySelection[$i]+".rotateY")`;
$roty = `getAttr ($mySelection[$i]+".rotateZ")`;

//Get Scale XYZ stored
$scaleX = `getAttr ($mySelection[$i]+".scaleX")`;
$scaleY = `getAttr ($mySelection[$i]+".scaleY")`;
$scaleZ = `getAttr ($mySelection[$i]+".scaleZ")`;

//Convert Object To Bubble RigidBody
dynamicaUI_createActiveMeshRB;

//Restore the inital State of the translate
setAttr (("dRigidBody"+$z) + ".translateX") $transX;
setAttr (("dRigidBody"+$z) + ".translateY") $transY;
setAttr (("dRigidBody"+$z) + ".translateZ") $transZ;

//Restore the inital State of the Rotation
setAttr (("dRigidBody"+$z) + ".rotateX") $rotX;
setAttr (("dRigidBody"+$z) + ".rotateY") $rotY;
setAttr (("dRigidBody"+$z) + ".rotateZ") $rotZ;

//Restore the inital State of the Scale
setAttr (("dRigidBody"+$z) + ".scaleX") $scaleX;
setAttr (("dRigidBody"+$z) + ".scaleY") $scaleY;
setAttr (("dRigidBody"+$z) + ".scaleZ") $scaleZ;

$z+=1;

}


actualy the script may crash some time,this is made to be used with all selected object in one time.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Maya Strenge Rotation when using Rigidbody Active

Post by Erwin Coumans »

It is a known Dynamica bug, and is on the todo list to be fixed:

http://code.google.com/p/bullet/issues/detail?id=103

Thanks for the report,
Erwin