Roto — Natron 2.5.0 documentation

# Roto

## Synopsis

This class encapsulates all things related to the roto node. See detailed description below.

### Functions

- def `createBezier` (x, y, time)

- def `createEllipse` (x, y, diameter, fromCenter, time)

- def `createLayer` ()

- def `createRectangle` (x, y, size, time)

- def `getBaseLayer` ()

- def `getItemByName` (name)

## Detailed Description

The Roto class is uses for now in Natron exclusively by the roto node, but its functionalities could be re-used for other nodes as well. Its purpose is to manage all layers and shapes. You can create new shapes with the `createBezier(x,y,time)`, `createEllipse(x,y,diameter,fromCenter,time)` and `createRectangle(x,y,size,time)` functions.

To create a new Layer you can use the `createLayer()` function.

As for other auto-declared variables, all shapes in the Roto objects can be accessed by their script-name, e.g.:

> Roto1.roto.Layer1.Bezier1

### Member functions description

NatronEngine.Roto.createBezier(x, y, time)
  Parameters

    - x – `float`

    - y – `float`

    - time – `int`

  Return type

    `BezierCurve`

Creates a new BezierCurve with one control point at position (x,y) and a keyframe at the given time.

NatronEngine.Roto.createEllipse(x, y, diameter, fromCenter, time)
  Parameters

    - x – `float`

    - y – `float`

    - diameter – `float`

    - fromCenter – `bool`

    - time – `int`

  Return type

    `BezierCurve`

Creates a new ellipse. This is a convenience function that uses `createBezier(x,y,time)` to create a new BezierCurve and then adds 3 other control points to the Bezier so that it forms an ellipse of the given diameter. A new keyframe will be set at the given time. If fromCenter is true, then (x,y) is understood to be the coordinates of the center of the ellipse, otherwise (x,y) is understood to be the position of the top-left point of the smallest enclosing rectangle of the ellipse.

NatronEngine.Roto.createLayer()
  Return type

    `Layer`

Creates a new layer.

NatronEngine.Roto.createRectangle(x, y, size, time)
  Parameters

    - x – `float`

    - y – `float`

    - size – `float`

    - time – `int`

  Return type

    `BezierCurve`

Creates a new rectangle. This is a convenience function that uses `createBezier(x,y,time)` to create a new BezierCurve and then adds 3 other control points to the Bezier so that it forms a rectangle of the given size on each of its sides. A new keyframe will be set at the given time.

NatronEngine.Roto.getBaseLayer()
  Return type

    `Layer`

Convenience function to access to the base Layer. Note that all shapes should belong to a Layer, the base layer being the top-level parent of all the hierarchy.

NatronEngine.Roto.getItemByName(name)
  Parameters

    name – `str`

  Return type

    `ItemBase`

Returns an item by its script-name. See this section for the details of what is the script-name of an item. E.g:

    app1.Roto1.roto.Layer1.Bezier1 = app1.Roto1.roto.getItemByName("Bezier1")