Layer — Natron 2.5.0 documentation

# Layer

Inherits ItemBase

## Synopsis

This class is used to group several shapes together and to organize them so they are rendered in a specific order. See detailed description…

### Functions

- def `addItem` (item)

- def `getChildren` ()

- def `insertItem` (pos, item)

- def `removeItem` (item)

## Detailed Description

Currently a layer acts only as a group so that you can organize shapes and control in which order they are rendered. To add a new item to the layer, use the `addItem(item)` or the `insertItem(item)` function.

To remove an item from the layer, use the `removeItem(item)` function.

Items in a layer are rendered from top to bottom, meaning the bottom-most items will always be drawn on top of other items.

### Member functions description

NatronEngine.Layer.addItem(item)
  Parameters

    item – `ItemBase`

Adds a new item at the bottom of the layer.

NatronEngine.Layer.getChildren()
  Return type

    `sequence`

Returns a sequence with all items in the layer.

NatronEngine.Layer.insertItem(pos, item)
  Parameters

    - pos – `int`

    - item – `ItemBase`

Inserts a new item at the given pos (0 based index) in the layer. If pos is out of range, it will be inserted at the bottom of the layer.

NatronEngine.Layer.removeItem(item)
  Parameters

    item – `ItemBase`

Removes the item from the layer.