Parameter.Source

説明

パラメータのDataSourceShaderActionSourceなど、パラメータの値から操作されるオブジェクト)を戻します。データソースが接続されていない場合は、Nothing が戻されます。パラメータが ActionSource および DataSource の両方を持つ場合、DataSource が戻されます。これは、アニメートされたパラメータがソースに接続されている場合に発生します。

注:データソースのすべてのタイプ(ActionSourceConstraintFCurveImageClipOperatorShaderStaticSource)を取得できますが、設定できるのはデータソースのシェーダタイプだけです。Shaderパラメータでは、ソースの他のシェーダへの設定がサポートされます。注:シェーダコンパウンドおよび複数出力シェーダは、出力Parameterによって識別されるソースを必要とする複数の出力ポートを持ちます。この場合、GetSource によってパラメータが戻されます。また、Parameter.GetParent を呼び出すことにより接続されたシェーダにアクセスすることができます。

ヒント:VBScript では、Source プロパティに"Nothing"を割り当てて、DataSourceを削除できます。JScriptおよび Python の場合は、Parameter.Disconnectを呼び出すことで、同じ効果が得られます。

ProxyParameterの場合は、このプロパティからマスタパラメータのソースにアクセスできます。たとえば、パラメータに F カーブが存在し、そのパラメータに対応するプロキシパラメータが存在する場合は、どちらのパラメータオブジェクトのソースプロパティも同じF カーブオブジェクトを戻します。

1. VBScript の例

'
' This example illustrates how to add an FCurve to a parameter and access it afterwards
' using the Parameter.Source property.
'
NewScene , false
dim values
set oCube = Application.ActiveSceneRoot.AddGeometry( "Cube","MeshSurface" )
arrValues = Array( 0.00, 5.00, 1.00, 6.00, 2.00, 7.00, 3.00, 8.00, 4.00, 9.00, 5.00, 10.00 )
oCube.posx.AddFCurve2 arrValues 
set oSource = oCube.posx.Source
Application.LogMessage "The source is : " & TypeName( oSource )
' Remove the animation
set oCube.posx.Source = Nothing
set oSource = oCube.posx.Source
Application.LogMessage "The source is : " & TypeName( oSource )
' Expected result:
'INFO : The source is : FCurve
'INFO : The source is : Nothing

2. JScript の例

/*
        See Shader.GetShaderParameterTargets for an example demonstrating how to traverse 
        a shader tree from left to right using the Source property and right to left using the 
        GetShaderParameterTargets method. 
*/

関連項目

Parameter.Sources FCurve Parameter.AddFCurve Parameter.AddFCurve2 Parameter.Disconnect ProxyParameter.MasterParameter Expression Constraint Operator Shader Shader.GetShaderParameterTargets