Expression

Object Hierarchy | 関連する C++クラス:Expression

継承

SIObject

ProjectItem

Operator

エクスプレッション

導入

v2.0

詳細

Expression オブジェクトは、Parameter.AddExpressionによって作成できるパラメータ上のアニメーションソースを表すOperatorの一種です。Softimage の Expression により、算術式でアニメーションのパラメータを制御できます。これにより、その他のパラメータの値への参照を含めることができます。この式は、"Definition"パラメータの値として格納され、次の例で示すようにオブジェクトモデルを介して変更することができます。

パラメータの値を Expression により取得する場合、Expression はParameter.Sourceプロパティを使用して呼び込むことができます。

式オブジェクトはオペレータの一種なので、Operator.InputPortsプロパティを使用して読み込まれる式からパラメータにアクセスできます。また、ポートグループへのアクセスも提供されます(オペレータの一種であるため)。ただし、式はポートグループを定義しませんが、SDKによって簡単なアクセスが可能です(詳細についてはOperator.GetNumPortGroupsを参照)。

詳細については、Softimage ユーザ ガイドの「エクスプレッション リファレンス」を参照してください。

メソッド

AddCustomOp AddScriptedOp AddScriptedOpFromFile AnimatedParameters2
BelongsToオペレータ Connect ConnectToGroup Copy
Disconnect DisconnectGroup EvaluateAt GetICEAttributeFromName
GetInputValue GetNumInstancesInGroupオペレータ GetNumPortGroupsオペレータ GetNumPortsInGroupオペレータ
GetPort2オペレータ IsA IsAnimated2 IsClassOfオペレータ
IsEqualToオペレータ IsKindOf IsLockedオペレータ IsSelectedオペレータ
LockOwners PortAtオペレータ SetAsSelectedオペレータ SetCapabilityFlagオペレータ
SetLock SupportsBranchGroupオペレータ TaggedParameters UnSetLock

プロパティ

Application BranchFlagオペレータ Capabilitiesオペレータ Categories
EvaluationID Familiesオペレータ FullNameオペレータ Help
HierarchicalEvaluationID ICEAttributes InputPortsオペレータ IsConnectedオペレータ
LockLevelオペレータ LockMastersオペレータ LockTypeオペレータ Model
Muteオペレータ Nameオペレータ NestedObjects ObjectID
Origin OriginPath OutputPortsオペレータ Owners
PPGLayoutオペレータ Parametersオペレータ Parent Parent3DObject
Portオペレータ PortGroupsオペレータ Selectedオペレータ Typeオペレータ

JScript の例

// This example illustrates how to apply an expression and access it.
NewScene( null, false );
var oNull = ActiveSceneRoot.AddNull();
var oAnotherNull = ActiveSceneRoot.AddNull("AnotherNull");
strExpr = oAnotherNull.posy.FullName + " + 2";
var oExpr = oNull.posx.AddExpression(strExpr);
//You can access the parameter to which an expression is connected by using the output port.
Application.LogMessage("Parameter owner of the expression " + oExpr.OutputPorts(0).Target2.FullName);
//You can access the parameter which are used inside an expression by using the input ports of 
//the expression operator.
var oInputPorts = oExpr.InputPorts
for(i = 0; i < oInputPorts.Count; i++)
{
        Application.LogMessage("Parameter client of the expression " + oInputPorts(i).Target2.FullName);
}
// Formula that defines the expression is available as a Parameter value
oDefinitionParam = oExpr.Parameters( "Definition" )
Application.LogMessage( "Expression definition :" + oDefinitionParam.Value) ;
// Expression can be changed
strNewExpr = oAnotherNull .posy.FullName + " - " + oAnotherNull .posx.FullName ;
oDefinitionParam.Value = strNewExpr ;
Application.LogMessage( "New expression definition : " + oDefinitionParam.Value ) ;
// Show the new expression formula in action
oAnotherNull.posy = 10 ;
oAnotherNull.posx = 4 ;
// Value should be 10 - 4 = 6
Application.LogMessage( "With new expression posx is " + oNull.posx.value ) ;
// Remove the expression
oNull.posx.Disconnect() ;
//INFO : Parameter owner of the expression null.kine.local.posx
//INFO : Parameter client of the expression AnotherNull.kine.local.posy
//INFO : Expression definition :AnotherNull.kine.local.posy + 2
//INFO : New expression definition : AnotherNull.kine.local.posy - AnotherNull.kine.local.posx
//INFO : With new expression posx is 6

関連項目

Parameter.Source Parameter.AddExpression Parameter.Value AddExpr SetExpr