v4.0
コンテナ(シェーダまたはマテリアル)からテクスチャ レイヤのリストを削除します。 コンテナが指定されない場合は、全コンテナからレイヤをまとめて削除します。
RemoveTextureLayers( [InputObjs], [Container] ); |
パラメータ | タイプ | 説明 |
---|---|---|
InputObjs | 文字列 |
コンテナから削除されるレイヤのリスト。 デフォルト値: 現在選択されている値 |
Container | 文字列またはオブジェクト | 削除するレイヤを含むコンテナ(コンテナにレイヤが存在する場合)。 無指定の場合は、レイヤが見つかったすべてのコンテナからレイヤが削除されます。 |
' ' This example creates two shaders in a simple render tree, and applies ' texture layers to them. Then it removes some of the layers, illustrating ' the RemoveTextureLayers command. ' In particular, it builds the following stacks of layers. ' ' Phong Fractal ' A A ' B B ' C C ' option explicit dim oSph, oPhong, oFractal, oLyr(2) ' Build our shaders (a Phong and a Fractal), which will be the "texture ' layer containers" that will each be able to hold a stack of layers. NewScene , False set oSph = CreatePrim( "Sphere", "MeshSurface" ) set oPhong = SIApplyShader( "Phong", oSph ) set oFractal = BlendInPresetsInsp( "Fractal", , , True, siReplaceNoBlend, False, False, True ) ' Now create and add all the layers, as indicated above. ' Add 'A', 'B' and 'C' to both containers at the end. set oLyr(0) = AddTextureLayer( , oPhong & "," & oFractal, "A", True ) set oLyr(1) = AddTextureLayer( , oPhong & "," & oFractal, "B", True ) set oLyr(2) = AddTextureLayer( , oPhong & "," & oFractal, "C", True ) ' ' Now start removing. First we'll remove layer 'A' from just one ' of the containers. RemoveTextureLayers oLyr(0), oPhong(0) ' Now we'll remove layer 'B' from all containers which hold it. RemoveTextureLayers oLyr(1) PrintTextureLayersInContainer oPhong PrintTextureLayersInContainer oFractal sub PrintTextureLayersInContainer( in_cont ) dim oStack, oItem, oStr oStr = "Texture Layers in Container: " & in_cont & vbCrLf set oStack = EnumElements( in_cont & ".TextureLayers" ) for each oItem in oStack oStr = oStr & " " & oItem.name & vbCrLf next logmessage oStr end sub ' ' The output from the example should look something like this: ' 'INFO : Texture Layers in Container: sphere.Material.Phong ' C ' 'INFO : Texture Layers in Container: sphere.Material.Phong.Fractal ' A ' C ' |