KinematicState.Transform
 
 
 

KinematicState.Transform operator

Description

Returns or sets the transformation (SITransformation) of an object.

Currently you cannot set the tranform at a different time than the current time. To cause the transformation to change over time you should animate the parameters of the KinematicState object.

Note: This property is not Python-compliant because Python does not support input parameters on properties. Use KinematicState.GetTransform2 and KinematicState.PutTransform2 instead.

Warning: The returned SITransformation object contains a copy of the transformation values, so modifying its state will have no effect on the original object. To change the object's kinematic state you must set this property with the modified SITransformation object, as shown in the example below.

C# Syntax

// get accessor
Object KinematicState.get_Transform( Object inFrame );
// set accessor
KinematicState.set_Transform( Object inFrame, Object out_ppRetVal );

Parameters

Parameter Type Description
Frame Variant Frame at which to get the transform.

Examples

1. JScript Example

/* 
        This example shows how to modify the state of a transform 
        when you are working on a copy of the object.  
*/
NewScene (null, false);
var oRoot = Application.ActiveSceneRoot;
var oCube = oRoot.AddGeometry("Cube", "MeshSurface", "Cube");
// Retrieve a copy of the transform object
var oTrans = oCube.Kinematics.Local.Transform;
var oMat4 = XSIMath.CreateMatrix4();
oMat4.Set( 1.0, 1.0, 0.0, 10.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 );
// Warning: you cannot change the object's transform like this: 
// oCube.Kinematics.Local.Transform.SetMatrix4(oMat4);
// because this will only modify a copy of the transform object
// not the real state of oCube.Kinematics.Local.Transform       
oTrans.SetMatrix4(oMat4);       
// Replace the transform with the modified copy 
oCube.Kinematics.Local.Transform = oTrans;

2. VBScript Example

set oCube = Application.ActiveProject.ActiveScene.Root.AddGeometry("Cube","MeshSurface")
oCube.Kinematics.Global.Parameters("posy").Value = 4.0
set oLocalTrans = oCube.Kinematics.Local.Transform
set oVec3 = XSIMath.CreateVector3
oLocalTrans.GetTranslation oVec3
oVec3.y = oVec3.y - 2.0
oLocalTrans.SetTranslation oVec3
' Change the object's translation by setting 
' the modified SITransformation back
oCube.Kinematics.Local.Transform = oLocalTrans

See Also

KinematicState.GetTransform2 KinematicState.PutTransform2