SetValue

Introduced

v1.0

Categories

edit property

Description

Sets Parameter values and returns the old value (that is, the parameter value before it was changed). This command, like its counterpart GetValue, is a very powerful command because it can change the value of practically any parameter in the scene.

Each time the user changes a Property Page the resulting SetValue call is logged into the script history. By turning the script history contents into a simple script it is easy to automate repetitive tasks.

SetValue provides powerful wildcard support so it is possible to set many parameters with a single call. However, because calling SetValue is logged in the Script History, it is sometimes faster to use the object model to change values; see Parameter.Value.

For more information, see the documentation for the GetValue command.

Scripting Syntax

SetValue( Target, Value, [Time] );

Parameters

Parameter Type Description
Target String List of parameters to set.

Default Value: Current selection.

Value Parameter-dependent New parameter values.
Time Integer Frame at which to set the values.

Default Value: Current frame.

Examples

VBScript Example

' The following uses SetValue to set various parameters 
' on some scene elements
NewScene
' Create a sphere and change the wireframe color to red
' This demonstrates we can use SetValue for object properties.
CreatePrim "Sphere", "MeshSurface"
DeselectAll
MakeLocal "sphere.display", siNodePropagation
SetValue "sphere.display.wirecol", 15
CreatePrim "Circle", "NurbsCurve"
CreatePrim "Circle", "NurbsCurve"
CreatePrim "Circle", "NurbsCurve"
CreatePrim "Circle", "NurbsCurve"
' Set the radius of all circles to 1
' This demonstrates we can use SetValue in a bulk-edit fashion.
SetValue "circle*.circle.radius", 1
' Set the radius of "circle" to 2, and the radius of "circle1" to 3
' This demonstrates we can use SetValue with an array of values.
SetValue "circle.circle.radius,circle1.circle.radius", ARRAY(2, 3)
' Hide the grid in all views, for all cameras (except scene camera)
' This demonstrates we can use SetValue for cameras, views, etc.
SetValue "Views.*.*.camvis.gridvis", False 
' Change current frame to 30 
' This demonstrates we can use SetValue for playback settings
        SetValue "PlayControl.Current", 30.000

See Also

GetValue ToggleValue