UnnestShaders

Introduced

v7.0

Description

Unnests shaders from a shader container (compound or material).

Scripting Syntax

UnnestShaders( InputObjs, ShaderContainer );

Parameters

Parameter Type Description
InputObjs String Shaders to unnested.

Default Value: If not specified, the user is prompted to make a selection.

ShaderContainer String The container to unnest the shaders from.

Default Value: ""

Examples

Python Example

#

# This example demonstrates how to use the UnnestShaders command.

#

null = None

true = 1

false = 0

app = Application

app.NewScene(null, false)

app.CreatePrim("Sphere", "MeshSurface", null, null)

# Create a Shader Compound Containing Phong

app.CreateShaderCompound("Sources.Materials.DefaultLib.Scene_Material.Phong", null)

# Create 2 shaders under the material

app.CreateShaderFromPreset("Shaders\\Texture\\Cell.Preset", "Sources.Materials.DefaultLib.Scene_Material", null)

app.CreateShaderFromPreset("Shaders\\Texture\\Checkerboard.Preset", "Sources.Materials.DefaultLib.Scene_Material", null)

# Nest both shaders under the shader compound

shadersToNest = "Sources.Materials.DefaultLib.Scene_Material.Cell,Sources.Materials.DefaultLib.Scene_Material.CheckerBoard"

app.NestShaders( shadersToNest, "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound" )

# Unnest one shader from the shader compound. A this point the shader does not 

# have a parent, you should always renest it under a container.

shadersToUnnest = "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound.Cell"

app.UnnestShaders( shadersToUnnest , "Sources.Materials.DefaultLib.Scene_Material" )

# Renesting under the material.

app.NestShaders( shadersToUnnest , "Sources.Materials.DefaultLib.Scene_Material" )

See Also

CreateShaderFromPreset CreateShadersFromMaterialPreset CreateShaderFromCLSID CreateShaderFromProgID CreateShaderCompound NestShaders AddShaderCompoundPort RemoveShaderCompoundPort MoveShaderCompoundPort RenameShaderCompoundPort ExportShaderCompound ImportShaderCompound ExplodeShaderCompound SetShaderCompoundPropertiesEx GetShaderCompoundProperties EditShaderCompoundPPGLogic