/ HALion Developer Resource / HALion Script / Reference /

setParameter

setParameter(nameOrID, value, undo)

Description

Function to set the value of a parameter. The parameter can be determined by name or ID. The function will have no effect if the parameter does not exist.

Available in: Controller, Processor.

Arguments

ArgumentDescriptionValue Type
nameOrIDThe name or ID of the parameter.string or number
valueThe value that you want to set.The new value must match the data type of the parameter.
undoDetermines if the parameter change will be part of the undo. This argument is only evaluated in the controller context. A parameter change in the processor context never has undo. If setParameter is called in the controller context it will be part of the undo, unless you set this argument to false. For example, you should set this to false if the call to setParameter is made within a parameter callback that is already part of the undo, and if the order of execution of these parameter changes is important.boolean, optional

Example

-- Set the value of the Level parameter of the parent layer.

function onLoadIntoSlot()
    this.parent:setParameter("Level", 0) -- Set via name.
    this.parent:setParameter(38, 0)      -- Set via ID.
end

See also: getParameter, getParameterNormalized, setParameterNormalized, hasParameter