GetLightListOnModelClip

Introduced

5.1

Description

Returns a comma-separated string, containing pairs of the shader with its light(s). Light lists on shaders can be lights which are outside of a specific ReferenceModel. When this is the case the relationship between the shaders and the lights defined within the ReferenceModel is stored in the ModelClip.

Note: The ModelClip on which you request the LightList needs to be offloaded to give access to the light list modifications.

Scripting Syntax

GetLightListOnModelClip( ModelClip )

Parameters

Parameter

Type

Description

ModelClip

String

The ModelClip for which we want to get the light list.

Default Value: Selected ModelClip object

Return Value

Returns a string containing the shader/light pairs. The delimitter between all entities is the comma.

Examples

JScript Example

/*
   This example demonstrates how to access light lists modification of a ModelClip.
*/

//  First create the model
NewScene( null, false );
CreatePrim( "Cone", "MeshSurface" );
CreateModel();
SelectObj( "Model.cone", null, true );
ApplyShader( null, "", null, "", siLetLocalMaterialsOverlap );
CopyPaste( null, "Shaders\\Texture\\Surface\\Incidence.Preset", "TransientObjectContainer" );
SIConnectShaderToCnxPoint( "TransientObjectContainer.Incidence", "Sources.Materials.DefaultLib.Material.Phong.ambient", false );
SetValue( "Sources.Materials.DefaultLib.Material.Phong.Scalar2color.Incidence.mode", 8 );
SelectObj( "Model", "BRANCH" );
var expath =  XSIUtils.BuildPath( Application.InstallationPath(siProjectPath), "Models", "TestLight.emdl" );
ExportModel( "B:Model", expath );

//  Create a scene containing the reference model and apply the light list
NewScene( null, false );
var impath =  XSIUtils.BuildPath( Application.InstallationPath(siProjectPath), "Models", "TestLight.emdl" );
ImportModel( impath, null, true );
GetPrimLight( "Neon.Preset", "Neon" );
GetPrimLight( "Point.Preset", "Point" );
SelectObj( "Referenced_TestLight.cone", null, true );
AddObjectsToShader( "Neon", "Sources.Materials.TestLight_DefaultLib_Ref.Material.Phong.Scalar2color.Incidence.customlights" );

//  Offload the Lightlist
SetValue( "Referenced_TestLight.ModelClip_TestLight.ModelSource_TestLight.active_resolution", 0 );
Application.LogMessage( GetLightListOnModelClip("Referenced_TestLight.ModelClip_TestLight") );

//  Expected result:
// INFO : Sources.Materials.TestLight_DefaultLib_Ref.Material.Phong.Scalar2color.Incidence.customlights,Neon

See Also

SetLightListOnModelClip



SOFTIMAGE|XSI v6.01     

Return to Softimage XSI Index