Function to retrieve the Layer object of a layer in the specified layer. For example, Available in: Controller, Processor Returns the Layer object of the found layer. Returns Description
this.parent
specifies the parent layer of the script module as the layer to be searched in. The function does not search in sublayers. A particular layer can be searched by name or position. The position is the number indexing the layers in the specified layer. If several layers share the same name, only the first match will be returned. If no argument is set, the function returns the first layer it finds.Arguments
nameOrPosition The name or position of the layer. Set this to nil
to deactivate the search filter.string or number, optional Return Values
nil
if no layer is found.Example
-- locate the first layer in the program and print its name
layer = this.program:getLayer()
if layer then
print(layer.name)
else
print("Could not find a layer!")
end
getLayer(nameOrPosition)
Overview
Content Tools
3 Comments
Sabine Pfeifer
proofread done
Matthias Klag
Please reread. Thanks!
Sabine Pfeifer
proofread done