2.10. Layer

2.10.1. Synopsis

2.10.1.1. Functions

2.10.1.2. Properties

  • property contours [read-only] of mixed list of XSplineContour and BezierContour instances

  • property link_to_track [read-write] of Layer or NoneType

  • property locked [read-write] of bool

  • property matte_color [read-write] of 3-items tuple of float values in range [0.0…1.0]

  • property name [read-write] of str

  • property parent [read-write] of LayerGroup

  • property psets [read-only] of ParameterSet

  • property selected [read-write] of bool

  • property stroke_color [read-write] of 3-items tuple of float values in range [0.0…1.0]

  • property visibility [read-write] of bool

  • property z_order [read-write] of int

2.10.2. Detailed Description

class mocha.project.Layer
Layer.add_bezier_contour(time, bezier_spline[, view=View()])
Return type

mocha.project.BezierContour

Layer.add_bezier_contour(time, points[, view=View()])
Return type

mocha.project.BezierContour

Parameters
  • points (list of BezierControlPointData) – Bezier control points which will be inserted into new contour, keeping the same order.

  • view (mocha.project.View) – View.

Creates new bezier contour with given bezier control points.

Layer.add_contour(time, contour[, view=View(0)])
Return type

PyObject

Copies the given contour into the layer, including all keyframes.

Layer.add_xspline_contour(time, x_spline[, view=View()])
Return type

mocha.project.XSplineContour

Layer.add_xspline_contour(time, points[, view=View()])
Return type

mocha.project.XSplineContour

Parameters
  • points (list of XControlPointData) – X spline control points which will be inserted into new contour, keeping the same order.

  • view (mocha.project.View) – View.

Creates new x spline contour with given x spline control points.

Layer.get_contours()
Return type

PySequence

Layer.get_parent_group()
Return type

mocha.project.LayerGroup

Layer.get_surface_position(point_index, time[, view=View( 0 )])
Return type

list of float

Parameters
  • point_index (uint) – Point index of a surface corner.

  • time (float) – Time.

  • view (mocha.project.View) – View.

Returns

2-value list of floats (x, y).

Returns the coordinates of the surface corner with point_index.

Layer.get_transform_matrix(time[, view=View()])
Return type

mocha.project.tuple

Parameters
Return

tuple of tuples of float values

Returns underlying transformation matrix as tuple for given clip view.

Layer.in_point([view=View( 0 )])
Return type

uint

Parameters

view (mocha.project.View) – View.

Returns in-point value for given view.

Layer.initLayerIfNecessary(context)
Layer.__ne__(layer)
Return type

bool

Layer.__eq__(layer)
Return type

bool

Layer.out_point([view=View( 0 )])
Return type

uint

Parameters

view (mocha.project.View) – View.

Returns out-point value for given view.

Layer.parameter(name_components)
Return type

mocha.project.Parameter

Parameters

name_components (list of strings) – Relative name for a requested parameter.

Returns Parameter instance bound with given name path.

Layer.parameter_set([name_components=list()])
Return type

mocha.project.ParameterSet

Parameters

name_components (list of strings) – Relative name for a requested parameter set.

Returns ParameterSet instance bound with given name path. Pass an empty list [] to get access to the Layer parameters set.

Layer.remove()

Removes current layer.

Layer.set_parent(group[, index=0])
Parameters

Moves the layer object to the certain group. Pass None to move it to the top level.

Layer.set_parent_group(arg__1)
Layer.tracking_input_clip([use_linked_layer=false])
Return type

mocha.project.Clip

Parameters

use_linked_layer (bool) – If True then will use the layer that this layer is linked to (See “Link to Track” in the User Guide).

Returns

Clip instance.

Returns Clip instance of the tracking input clip of the layer.

Layer.name
Type

str

Access

read-write Provides access to layer name.

Layer.contours
Type

mixed list of XSplineContour and BezierContour instances

Access

read-only Provides access to list of this layer contours.

Layer.parent
Type

LayerGroup

Access

read-write Provides access to parent layer group.

Layer.visibility
Type

bool

Access

read-write Provides access to layer visibility.

Layer.matte_color
Type

3-items tuple of float values in range [0.0…1.0]

Access

read-write Provides access to layer matte color.

Layer.stroke_color
Type

3-items tuple of float values in range [0.0…1.0]

Access

read-write Provides access to layer stroke color.

Layer.locked
Type

bool

Access

read-write Provides access to layer locked state.

Type

Layer or NoneType

Access

read-write Provides access to Link-to-track property of the layer.

Mimics “Link to track” combo box functionality which is on the Layer Properties panel.

Layer.z_order
Type

int

Access

read-write Provides access to Z order value.

Layer.selected
Type

bool

Access

read-write Provides access to selected state of the layer.

Layer.psets
Type

ParameterSet

Access

read-only Provides access to the parameter set.

Mimics parameter_set() call.