## DisconnectAndDeleteOrUnnestShaders

### Introduced

v7.0

### Description

Deletes the specified list of shaders after disconnecting them and unnests image clips properly from the specified container. This command is similar to the DisconnectAndDeleteShaders command except that it cleans up disconnected clips (as of v7.0, unconnected nodes do not disappear automatically).
Note: Image clips are not deleted from the scene but just removed from the render tree.

### Scripting Syntax

    DisconnectAndDeleteOrUnnestShaders( Shaders, Containers );

### Parameters

Parameter | Type | Description
--- | --- | ---
Shaders | String | List of shaders to delete. This ensures that all the shaders are disconnected before they are deleted, which is important in the rendertree, where if you delete a node you only want that node to be deleted, and not the entire subtree.
Containers | String | List of shader containers from which to unnnest imageclips.

### Examples

#### Python Example

    #

    # 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." )

### See Also

SIApplyShader DeleteObj DisconnectAndDeleteOrUnnestShaders Shader