TextureLayer.RemoveTextureLayerPort

導入

v4.0

詳細

テキスチャレイヤからTextureLayerPortを削除します。実際には接続が解除され、レイヤがそのシェーダプロパティに影響しなくなります。

ポートが接続されていないテクスチャレイヤも使用できますが、このような空のレイヤはプレースホルダとして機能し、レンダリング結果にはいっさい影響しません。コンテナ内での表示順序は維持されます。もちろん、いつでも新たにポート接続を追加できます。

C#構文

TextureLayer.RemoveTextureLayerPort( Object in_varPort );

スクリプト構文

TextureLayer.RemoveTextureLayerPort( Port );

パラメータ

パラメータ タイプ 説明
Port TextureLayerPortまたはString このコンテナから削除するテキスチャレイヤポート

1. JScript の例

// This example shows creation of texture layer ports,

// plus enumerating and removing them.

oRoot = ActiveProject.ActiveScene.Root;

oSph = oRoot.AddGeometry( "Sphere", "MeshSurface" );

oMat = oSph.AddMaterial( "Phong" );

oPhong = oMat.Shaders(0);

// Add a layer at the end.

oLayer = oPhong.CreateTextureLayer( "DirtLayer" );

// Add some texture layer port connections on this layer.

oPorts = new Array(3);

oPorts[0] = oLayer.AddTextureLayerPort( oPhong.parameters( "ambient" ) );

oPorts[1] = oLayer.AddTextureLayerPort( oPhong.parameters( "diffuse" ) );

oPorts[2] = oLayer.AddTextureLayerPort( oPhong.parameters( "specular" ) );

Application.LogMessage( "Created " + oLayer.TextureLayerPorts.count + " ports." );

for ( i = 0; i < oLayer.TextureLayerPorts.count; i++ )

{

	oPort = oLayer.TextureLayerPorts(i);

	Application.LogMessage( (i+1) + ": " + oPort );

}

oLayer.RemoveTextureLayerPort( oPorts[1] );

oLayer.RemoveTextureLayerPort( oLayer.fullname + "." + oPorts[2].name );

count = oLayer.TextureLayerPorts.count;

Application.LogMessage( "Only " + count + " remain(s) after removal." );

for ( i = 0; i < count; i++ )

{

	Application.LogMessage( (i+1) + ": " + oLayer.TextureLayerPorts.item(i) );

}

// This example should log something like:

//INFO : "Created 3 ports."

//INFO : "1: sphere.Material.Phong.DirtLayer.ambient"

//INFO : "2: sphere.Material.Phong.DirtLayer.diffuse"

//INFO : "3: sphere.Material.Phong.DirtLayer.specular"

//INFO : "Only 1 remain(s) after removal."

//INFO : "1: sphere.Material.Phong.DirtLayer.ambient"

2. VBScript の例

' This example shows creation of texture layer ports,

' plus enumerating and removing them.

set oRoot = ActiveProject.ActiveScene.Root

set oSph = oRoot.AddGeometry( "Sphere", "MeshSurface" )

set oMat = oSph.AddMaterial( "Phong" )

set oPhong = oMat.Shaders(0)

' Add a layer at the end.

set oLayer = oPhong.CreateTextureLayer( "DirtLayer" )

' Add some texture layer port connections on this layer.

dim oPorts(2)

set oPorts(0) = oLayer.AddTextureLayerPort( oPhong.parameters( "ambient" ) )

set oPorts(1) = oLayer.AddTextureLayerPort( oPhong.parameters( "diffuse" ) )

set oPorts(2) = oLayer.AddTextureLayerPort( oPhong.parameters( "specular" ) )

logmessage "Created " & oLayer.TextureLayerPorts.count & " ports."

i = 1

for each oPort in oLayer.TextureLayerPorts

	logmessage i & ": " & oPort

	i = i + 1

next

oLayer.RemoveTextureLayerPort oPorts(1)

oLayer.RemoveTextureLayerPort oLayer.fullname & "." & oPorts(2).name

count = oLayer.TextureLayerPorts.count

logmessage "Only " & count & " remain(s) after removal."

for i = 0 to count - 1

	logmessage i + 1 & ": " & oLayer.TextureLayerPorts.item(i)

next

' This example should log something like:

'INFO : "Created 3 ports."

'INFO : "1: sphere.Material.Phong.DirtLayer.ambient"

'INFO : "2: sphere.Material.Phong.DirtLayer.diffuse"

'INFO : "3: sphere.Material.Phong.DirtLayer.specular"

'INFO : "Only 1 remain(s) after removal."

'INFO : "1: sphere.Material.Phong.DirtLayer.ambient"

関連項目

DeleteObj TextureLayer.AddTextureLayerPort TextureLayer.TextureLayerPorts