CreateShaderFromPreset

Introduced

7.0

Description

Adds a Shader to a render tree created from the specified preset.

Scripting Syntax

CreateShaderFromPreset( [PresetObj], [Container], Name )

Parameters

Parameter

Type

Description

PresetObj

String or a preset object (see SIGetPreset)

Shader preset to use

Default Value: The ArgumentHandler may be able to resolve this value.

Container

SelectionList or Selection

 

Default Value: If no argument is specified, the current selection is used.

Name

String

Name for the new shader

Return Value

The new Shader object.

Examples

JScript Example

/*
   This example demonstrates how to use the CreateShaderFromPreset command.
*/
NewScene(null, false);
CreatePrim("Sphere", "MeshSurface", null, null);

// Create a new shader from a preset and nest it under the material
CreateShaderFromPreset("Shaders\\Texture\\Image.Preset", 
   "Sources.Materials.DefaultLib.Scene_Material", null);
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.Image", 
   "Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse", false);
CreateShaderCompound("Sources.Materials.DefaultLib.Scene_Material.Phong", null);

// Create a new shader from a preset and nest it under the material
CreateShaderFromPreset("Shaders\\Texture\\Fractal.Preset", 
   "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound", null);
SIConnectShaderToCnxPoint("Sources.Materials.DefaultLib.Scene_Material.ShaderCompound.Fractal", 
   "Sources.Materials.DefaultLib.Scene_Material.ShaderCompound.Phong.specular", false);

See Also

CreateShaderFromCLSID

CreateShaderFromProgID

CreateShaderCompound

NestShaders

UnnestShaders

AddShaderCompoundPort

RemoveShaderCompoundPort

MoveShaderCompoundPort

RenameShaderCompoundPort

ExportShaderCompound

ImportShaderCompound

ExplodeShaderCompound

SetShaderCompoundProperties

GetShaderCompoundProperties

 

 



Autodesk Softimage v7.5