パラメータがシングルリンク(l_fcv)の場合は、パラメータ ファンクション カーブにキーを設定します。パラメータがマルチリンク(l_interp)またはオブジェクトの方向リンク(l_interpOri)の場合は、補間オブジェクトに相対値のセットを設定します。
パラメータを複数の駆動パラメータまたはオブジェクトの方向にリンクするとき、補間オブジェクトが作成されます。 このオブジェクトは、相対値のセットへのアクセスおよび保存に使用されます。
A が B とシングルリンクしている場合は、B の値が変化していくとともに A の値をアニメートするリンク ファンクション カーブが存在します。 このファンクション カーブでは、Y 軸は A の値を示し、X 軸は B の値を示します。「SetRelativeValues "A"」は、A と B の現在の値を使用して、このファンクション カーブにキーを設定します。
SetRelativeValues( [InputObj] ); |
' This example shows that relative values of a single-linked parameter (l_fcv) are represented by an FCurve function. NewScene, false CreatePrim "Cone", "MeshSurface" CreatePrim "Cube", "MeshSurface" SetExpr "cube.kine.local.posx", "l_fcv( cone.kine.global.posx )" SetValue "cone.kine.local.posx", 1 SetValue "cube.kine.local.posx", 2.5 SetRelativeValues "cube.kine.local.posx" SetValue "cone.kine.local.posx", 3 SetValue "cube.kine.local.posx", 4 SetRelativeValues "cube.kine.local.posx" OpenView "Animation Editor" |
' This example shows that relative values of a multiple-linked parameter (l_interp) are stored in the Interpolator object. NewScene, false CreatePrim "Cone", "MeshSurface" CreatePrim "Cube", "MeshSurface" SetExpr "cube.kine.local.posx", "l_interp( cone.kine.global.posx, cone.kine.global.posy )" SetValue "cone.kine.local.posx", 1.5 SetValue "cone.kine.local.posy", 2 SetValue "cube.kine.local.posx", 2.5 SetRelativeValues "cube.kine.local.posx" SetValue "cone.kine.local.posx", 3 SetValue "cone.kine.local.posy", 3.5 SetValue "cube.kine.local.posx", 4 SetRelativeValues "cube.kine.local.posx" numKeys = GetNumRelativeValues( "cube.kine.local.Expression.Interpolator" ) Application.LogMessage "The Interpolator object has " & numKeys & " sets of relative values" for i = 0 to numKeys - 1 Application.LogMessage "---------------------------" Application.LogMessage "Relative values set #" & i & ":" values = GetRelativeValue( "cube.kine.local.Expression.Interpolator", i ) j = 0 for each item in values if (j = 0) then Application.LogMessage "Controlled value = " & item else Application.LogMessage "Controlling #" & j & " value = " & item end if j = j + 1 next next ' INFO : The Interpolator object has 3 sets of relative values ' INFO : --------------------------- ' INFO : Relative values set #0: ' INFO : Controlled value = 0 ' INFO : Controlling #1 value = 0 ' INFO : Controlling #2 value = 0 ' INFO : --------------------------- ' INFO : Relative values set #1: ' INFO : Controlled value = 2.5 ' INFO : Controlling #1 value = 1.5 ' INFO : Controlling #2 value = 2 ' INFO : --------------------------- ' INFO : Relative values set #2: ' INFO : Controlled value = 4 ' INFO : Controlling #1 value = 3 ' INFO : Controlling #2 value = 3.5 |
' This example shows how to deal with sets of relative values with an object's orientation linked parameter (l_interpOri). NewScene , False CreatePrim "Cone", "MeshSurface" CreatePrim "Cube", "MeshSurface" SetExpr "cube.kine.local.posx", "l_interpOri( cone.kine.local.rotx, cone.kine.local.roty, cone.kine.local.rotz )" SetValue "cube.kine.local.posx", 2.5 SetValue "cone.kine.local.rotx", 45 SetRelativeValues "cube.kine.local.posx" SetValue "cube.kine.local.posx", 5.5 SetValue "cone.kine.local.rotx", 90 SetRelativeValues "cube.kine.local.posx" numKeys = GetNumRelativeValues( "cube.kine.local.Expression.Interpolator" ) Application.LogMessage "The Interpolator object has " & numKeys & " sets of relative values" for i = 0 to numKeys - 1 Application.LogMessage "---------------------------" Application.LogMessage "Relative values set #" & i & ":" values = GetRelativeValue( "cube.kine.local.Expression.Interpolator", i ) Application.LogMessage "Controlled value (cube.kine.local.posx) : " & values(0) set quaternion = XSIMath.CreateQuaternion( values(1), values(2), values(3), values(4) ) eulerValues = quaternion.GetXYZAngleValues2() Application.LogMessage "Controlling #1 value (cone.kine.local.rotx) : " & XSIMath.RadiansToDegrees( eulerValues(0) ) Application.LogMessage "Controlling #2 value (cone.kine.local.roty) : " & XSIMath.RadiansToDegrees( eulerValues(1) ) Application.LogMessage "Controlling #3 value (cone.kine.local.rotz) : " & XSIMath.RadiansToDegrees( eulerValues(2) ) next ' INFO : The Interpolator object has 3 sets of relative values ' INFO : --------------------------- ' INFO : Relative values set #0: ' INFO : Controlled value (cube.kine.local.posx) : 0 ' INFO : Controlling #1 value (cone.kine.local.rotx) : 0 ' INFO : Controlling #2 value (cone.kine.local.roty) : 0 ' INFO : Controlling #3 value (cone.kine.local.rotz) : 0 ' INFO : --------------------------- ' INFO : Relative values set #1: ' INFO : Controlled value (cube.kine.local.posx) : 2.5 ' INFO : Controlling #1 value (cone.kine.local.rotx) : 45 ' INFO : Controlling #2 value (cone.kine.local.roty) : 0 ' INFO : Controlling #3 value (cone.kine.local.rotz) : 0 ' INFO : --------------------------- ' INFO : Relative values set #2: ' INFO : Controlled value (cube.kine.local.posx) : 5.5 ' INFO : Controlling #1 value (cone.kine.local.rotx) : 90 ' INFO : Controlling #2 value (cone.kine.local.roty) : 0 ' INFO : Controlling #3 value (cone.kine.local.rotz) : 0 |