DisconnectAndDeleteOrUnnestShaders

導入

v7.0

詳細

シェーダの接続を解除した後に指定のシェーダ リストを削除し、指定されたコンテナのイメージ クリップを適切にネスト解除します。 このコマンドはDisconnectAndDeleteShadersコマンドに似ていますが、接続解除されたクリップがクリーンアップされる点が異なります(v7.0では、接続解除されたノードが自動的に消えることはありません)。

注: イメージクリップはシーンから削除されず、Render Treeから削除されるだけです。

スクリプト構文

DisconnectAndDeleteOrUnnestShaders( Shaders, Containers );

パラメータ

パラメータ タイプ 詳細
Shaders 文字列 削除するシェーダのリスト。 シェーダが削除される前にすべてのシェーダが確実に接続解除されます。レンダ ツリーのサブツリー全体を削除せずに目的のノードのみを削除する場合は重要です。
Containers 文字列 イメージ クリップをネスト解除するシェーダ コンテナのリスト

Python の例

#
# This example demonstrates how to use the DisconnectAndDeleteOrUnnestShaders 
# command by creating two shaders in a simple render tree, and deleting the 
# phong without deleting the attached fractal.
# 
null = None
true = 1
false = 0
app = Application
app.NewScene( "", 0 )
# Build our shaders (a Phong and a Fractal)
oSph = app.CreatePrim( "Sphere", "MeshSurface" )
oPhong = app.SIApplyShader( "Phong", oSph )
oFractal = app.BlendInPresets( "Fractal", None, None, true, siReplaceNoBlend, false, false, true )
# Now display the render tree. A message box appears so that you can see the 
# contents of the render tree before deleting one of the shaders. When you are
# ready to proceed, click OK...
app.OpenView( "Render Tree" )
lResponse = XSIUIToolkit.MsgBox( "When you are ready to proceed, click OK. "
        + "The message box will close and the DisconnectAndDeleteShaders command "
        + "will remove the shader node only.", siMsgOkCancel + siMsgInformation, 
        "DisconnectAndDeleteShaders Demo" )
if ( lResponse == siMsgOk ) :
        app.DisconnectAndDeleteShaders( oPhong )
else :
        app.LogMessage( "You opted not to complete the demonstration." )

関連項目

SIApplyShader DeleteObj DisconnectAndDeleteOrUnnestShaders Shader