Introduced
1.5
Description
Sets reference parameter values for a shader. Reference parameter values occur only for shaders and are specified with 'type = reference;' in the SPDL file.
Use this command when you need to set a reference to a scene object when applying a shader that uses object references. For example, the Lightning shader defines start and end points that you link to items in the scene explorer.
Scripting Syntax
SetReference( Target, Value, [Time] )
Parameters
|
Parameter |
Type |
Description |
|
Target |
The parameter to set. |
|
|
Value |
SafeArray of IUnknowns |
New parameter values. |
|
Time |
Frame at which to set the values. Default Value: Current frame. |
Examples
VBScript Example
NewScene ' Create a sphere for the lightning volume shader -- make it transparent CreatePrim "Sphere", "MeshSurface" Scale , 1.78336557059961, 1.78336557059961, 1.78336557059961, siRelative, siGlobal, siObj, siXYZ, , , , , , , , 0 ApplyShader , , , , siLetLocalMaterialsOverlap SetValue "sphere.Material.Phong.transparency.green", 1 SetValue "sphere.Material.Phong.transparency.blue", 1 SetValue "sphere.Material.Phong.transparency.red", 1 ' Create two nulls to act as endpoints for the lightning bolt GetPrim "Null", "StartNull" Translate , -4, 2.98511157062997, -0.298511157062997, siAbsolute, siView, siObj, siXYZ, True, , , , , , , , , 0 GetPrim "Null", "EndNull" Translate , 2, 3.98014876083996, -0.398014876083996, siAbsolute, siView, siObj, siXYZ, True, , , , , , , , , 0 ' Apply the lightning shader SelectObj "sphere", , True SIApplyShaderToCnxPoint "Volume\Volume_lightning.Preset", "Sources.Materials.DefaultLib.Material.volume" ' Set the start and endpoints of the lightning bolt SetReference "Sources.Materials.DefaultLib.Material.Volume_lightning.startpoint", Array("StartNull") SetReference "Sources.Materials.DefaultLib.Material.Volume_lightning.endpoint", Array("EndNull") ' Draw a render region to see the lightning bolt
Autodesk Softimage v7.5