/ HALion Developer Resource / HALion Script / Reference /
getEffect
getEffect(nameOrPosition)
Description
Function to retrieve the Effect object of an effect from the specified bus. You can use getBus or findBusses to specify the bus. A particular effect can be searched by name or position. The position is the number indexing the effects in the specified bus. If several effects share the same name, only the first match will be returned. If no argument is set, the function returns the first effect that it finds.
Available in: Controller, Processor.
Arguments
Argument | Description | Value Type |
---|---|---|
nameOrPosition | The name or position of the effect. Set this to nil to deactivate the search filter. | string or number, optional |
Return Values
Returns the Effect object of the found effect. Returns nil
if no bus is found.
Example
-- Locate the first bus in the program.
bus = this.program:getBus()
if bus then
-- Locate the first effect of the bus and print its name.
effect = bus:getEffect()
if effect then
print(effect.name)
else
print("Could not find an effect!")
end
else
print("Could not find a bus!")
end
See also: getBus, getChild, getLayer, getMidiModule, getSlot, getZone, Effect