TransferPropertiesAcrossGenOp

導入

v4.0

カテゴリ

operator

詳細

ジェネレータ オペレータの指定された入力オブジェクトのプロパティのセットを、指定された出力オブジェクトに新しいプロパティとして転送します。 転送したプロパティはオプションで共有することができます。

注: クラスタ プロパティのみを転送するには、TransferClusterPropertiesAcrossGenOp コマンドを使用します。

スクリプト構文

oReturn = TransferPropertiesAcrossGenOp( Operator, Object, PropertiesToTransfer, PropertyName, ShareProperty, TransferClusterProperties );

戻り値

作成されたPropertyを戻します。

パラメータ

パラメータ タイプ 詳細
オペレータ 文字列 プロパティの転送を実行するジェネレータ オペレータを指定します。
オブジェクト 文字列 新しいプロパティを追加する出力オブジェクトを指定します。
PropertiesToTransfer 選択リスト 新しいプロパティに転送するプロパティを指定します。 プロパティはクラスタ プロパティとは異なります。

指定可能な値:

説明:

Material オブジェクトまたはクラスタ上のマテリアル
PropertyName 文字列 新しいプロパティの名前を指定します。
ShareProperty ブール True の場合はプロパティが共有されます。

デフォルト値: True

TransferClusterProperties ブール True の場合は、名前によるクラスタ プロパティ参照も、入力プロパティに相当するものをすべて考慮する内部ヒューリスティックに基づいて転送されることを意味します。

デフォルト値: True

1. VBScript の例

'This example transfers properties across generator 
'operators that admit transfer of properties.
Dim l_NewMaterial
newscene ,false
'Create objects
CreatePrim "Grid", "MeshSurface", "grid"
CreatePrim "Grid", "MeshSurface", "grid1"
Translate "grid1", 8.2, 0, 0, siRelative, siView, siObj, siXYZ
'Add some properties to objects: Materials and texture coordinates.
ApplyShader , , , , siLetLocalMaterialsOverlap
SetValue "grid1.Material.Phong.diffuse.red", 0.750
SIApplyShaderToCnxPoint "Image", "grid1.Material.Phong.diffuse"
SelectObj "grid", , True
SetSelFilter "Polygon"
AddToSelection "grid.poly[18-21,26-29,34-37,42-45,50-53]", , True
ApplyShader , , , , siLetLocalMaterialsOverlap
SetValue "grid.polymsh.cls.Polygon.Material.Phong.diffuse.green", 0.250
SIApplyShaderToCnxPoint "Image", "grid.polymsh.cls.Polygon.Material.Phong.diffuse"
CreateProjection "grid", siTxtPlanarXZ, siTxtDefaultSpherical, "Texture_Support", "Texture_Projection"
SetInstanceDataValue , "grid.polymsh.cls.Polygon.Material.Phong.Image.tspace_id", "Texture_Projection"
SelectObj "grid1", , True
CreateProjection "grid1", siTxtPlanarXZ, siTxtDefaultSpherical, "Texture_Support", "Texture_Projection"
SetInstanceDataValue , "grid1.Material.Phong.Image.tspace_id", "Texture_Projection"
' Apply merge operator. 
ApplyGenOp "MeshMerge", , "grid,grid1", 3, siPersistentOperation, siKeepGenOpInputs
SetValue "polymsh.polymsh.mergemesh.tolerance", 2.0
Translate , -4.0, 3.0, -0.0, siRelative, siView, siObj, siXYZ
' Transfer properties across the merge operator.
set l_NewMaterial = TransferPropertiesAcrossGenOp( "polymsh.polymsh.mergemesh", "polymsh",_
"grid.polymsh.cls.Polygon.Material,grid1.Material", "Material_Gen", , True )
' View results.  
SetDisplayMode "Camera", "texturedecal"
SetValue "Camera.camvis.objctrlpropmaps", True
ActivateObjectSelTool
SelectObj "grid"
AddToSelection "grid1", , True
AddToSelection l_NewMaterial.Parent

2. JScript の例

//This example transfers properties across generator 
//operators that admit transfer of properties.
NewScene( null, false )
// Create objects
CreatePrim("Grid", "MeshSurface", "grid", null);
CreatePrim("Grid", "MeshSurface", "grid1", null);
Translate( "grid1", 8.2, 0.0, 0.0, 
siRelative, siView, siObj, siXYZ, 
null, null, null, null, null, null, null, null, null);
// Add some properties to objects: Materials and texture coordinates.
ApplyShader(null, "", null, "", siLetLocalMaterialsOverlap);
SetValue("grid1.Material.Phong.diffuse.red", 1, null);
SIApplyShaderToCnxPoint("Image", "grid1.Material.Phong.diffuse", null, null);
CreateProjection("grid1", 
        siTxtPlanarXZ, 
        siTxtDefaultSpherical, 
        "Texture_Support",      
        "Texture_Projection", 
        null, null, "");
SetInstanceDataValue(null, 
        "grid1.Material.Phong.Image.tspace_id", 
        "Texture_Projection");
SelectObj("grid", null, true);
SetSelFilter("Polygon");
AddToSelection("grid.poly[26-29,34-37,42-45]", null, true);
ApplyShader(null, "", null, "", siLetLocalMaterialsOverlap);
SetValue("grid.polymsh.cls.Polygon.Material.Phong.diffuse.blue", 0.006, null);
SIApplyShaderToCnxPoint("Image", 
        "grid.polymsh.cls.Polygon.Material.Phong.diffuse", 
        null, null);
CreateProjection("grid", 
        siTxtPlanarXZ, 
        siTxtDefaultSpherical, 
        "Texture_Support",      
        "Texture_Projection1", 
        null, null, "");
SetInstanceDataValue(null, 
        "grid.polymsh.cls.Polygon.Material.Phong.Image.tspace_id", 
        "Texture_Projection1");
// Apply merge operator. 
ApplyGenOp("MeshMerge", "", "grid,grid1", 3, siPersistentOperation, siKeepGenOpInputs);
SetValue("polymsh.polymsh.mergemesh.tolerance", 2, null);
Translate( "polymsh", -4.0, 4.0, -5.0, 
        siRelative, siView, siObj, siXYZ,
        null, null, null, null, null, null, null, null, null);
// Transfer properties across the merge operator.
l_NewMaterial = TransferPropertiesAcrossGenOp(
        "polymsh.polymsh.mergemesh", 
        "polymsh",      
        "grid.polymsh.cls.Polygon.Material, grid1.Material", 
        "Material_Gen", 
        null, 
        true);
// Transfer properties across the merge operator.
SelectObj("grid", null, true);
AddToSelection("grid1", null, true);
AddToSelection( l_NewMaterial , null, true);
SetDisplayMode("Camera", "texturedecal");
SetValue("Camera.camvis.objctrlpropmaps", true, null);

関連項目

TransferClusterPropertiesAcrossGenOp TransferAllPropertiesAcrossGenOp CopyAnimationAcrossGenerator