// create a null and translate, rotate and scale it
GetPrim("Null", null, null);
Translate(null, 1.73296599336766, 3.21359046016228, -0.321359046016228, siRelative, siView, siObj, siXYZ, null, null, null, null, null);
Rotate(null, -102.375, 0, 0, siRelative, siLocal, siObj, siXYZ, null, null, null);
Rotate(null, 0, -22.5, 0, siRelative, siLocal, siObj, siXYZ, null, null, null);
Scale(null, 1.55705996131528, 1.55705996131528, 1.55705996131528, siRelative, siLocal, siObj, siXYZ, null, null, null);
// get object from selection
var o = selection(0);
// get global transform from object
var t = o.kinematics.global.transform;
var q = XSIMath.CreateQuaternion();
t.GetRotationQuaternion( q );
var cCrLf = String.fromCharCode(13,10);
Application.LogMessage( cCrLf +
round(q.w,3) + " " + round(q.x,3) + " " + round(q.y,3) + " " + round(q.z,3) + cCrLf +
round(q(0),3) + " " + round(q(1),3) + " " + round(q(2),3) + " " + round(q(3),3) + cCrLf );
function round( n, numdecplaces )
{
var f = Math.pow(10, numdecplaces );
return Math.round(n * f)/f;
}
//INFO : "
//0.615 -0.764 -0.122 0.152
//0.615 -0.764 -0.122 0.152
//" |