NestShaders
 
 
 

NestShaders

Introduced

v7.0

Description

Nests shaders under a shader container (compound or material).

Scripting Syntax

NestShaders( InputObjs, ShaderContainer );

Parameters

Parameter Type Description
InputObjs String Shaders to be nested.

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

ShaderContainer String The container to nest the shader.

Default Value: ""

Examples

JScript Example

/*
        This example demonstrates how to use the NestShaders command.
*/
NewScene(null, false);
CreatePrim("Sphere", "MeshSurface", null, null);
// Create a Shader Compound Containing Phong
CreateShaderCompound("Sources.Materials.DefaultLib.Scene_Material.Phong", null);
// Create 2 shaders under the material
CreateShaderFromPreset("Shaders\\Texture\\Cell.Preset", "Sources.Materials.DefaultLib.Scene_Material", null);
CreateShaderFromPreset("Shaders\\Texture\\Checkerboard.Preset", "Sources.Materials.DefaultLib.Scene_Material", null);
// Nest both shaders under the shader compound
var shadersToNest = "Sources.Materials.DefaultLib.Scene_Material.Cell,Sources.Materials.DefaultLib.Scene_Material.CheckerBoard";
NestShaders( shadersToNest, "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound" );
// Unnest one shader from the shader compound. At this point the shader does not 
// have a parent; you should always renest it under a container.
var shadersToUnnest = "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound.Cell";
UnnestShaders( shadersToUnnest , "Sources.Materials.DefaultLib.Scene_Material" );
// Renesting under the material.
NestShaders( shadersToUnnest , "Sources.Materials.DefaultLib.Scene_Material" );

See Also

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