/ HALion Developer Resource / HALion Script / Reference /
removeFromParent
removeFromParent()
Description
Function to remove an element in the Program Tree from the parent element. The function can remove elements of the type Layer, Zone, MidiModule, Bus and Effect. It can even remove the script module that calls the function.
Available in: Controller.
Example
-- Remove the second child element.
childs = this.program:findChildren(true)
if childs[2] then
childs[2]:removeFromParent()
end
-- Remove the program bus.
bus = this.program:getBus("Program-Bus")
if bus then
bus:removeFromParent()
end