GetPrimLight

Categories

primitive render

Description

Creates a primitive light.

Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference. Normally you can get the output arguments via either XSIApplication.ExecuteCommand method (C#) or the ISIVTCollection (scripting languages), but this command already returns a value.

The only available workaround in this case is to create a VBScript custom command which returns both the output arguments and the return value in one array. For details, see What Happens when the Function Already Returns a Value?.

Scripting Syntax

oReturn = GetPrimLight( PresetObj, [Name], [Parent], [Primitive], [PrimObjSpot], [PrimObjSpotInterest] );

Return Value

Returns the LightRig object for the Spot and Light_Box and the Light object for the other light types.

Parameters

Parameter Type Description
PresetObj String or a preset object (see SIGetPreset) Any preset for the Light Primitives
Name String Name of the light.
Parent String Parent object for the light.
Primitive Primitive Returns the light primitive.
PrimObjSpot Light Returns the spot light object. For other light types, this is the light object (the same object returned by GetPrimLight).
PrimObjSpotInterest Null Returns the spot interest for the Spot and Light_Box types of lights (and Nothing for the other light types).

Examples

VBScript Example

GetPrimLight "Neon", "MyNeonLight"
set root = GetPrimLight( "Spot", "aSpot", , spot, prim, interest )
logmessage "root = " & root
logmessage "prim = " & prim 
logmessage "spot = " & spot 
if Not TypeName (interest) = "Nothing" then
        logmessage "int  = " & interest
end if

See Also

SIGetPrimLight SIGetPrimSpotLight