2.8. Layer

2.8.1. Synopsis

2.8.1.1. Functions

2.8.1.2. Properties

2.8.2. Detailed Description

class mocha.project.Layer(Layer)
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.
Return type:

BezierContour

Creates new bezier contour with given bezier control points.

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.
Return type:

XSplineContour

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

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

list of float

Parameters:
  • point_index (PySide2.QtCore.uint) – Point index of a surface corner.
  • time (PySide2.QtCore.float) – Time.
  • view (mocha.project.View) – View.
Return type:

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 type:

tuple of tuples of float values

Returns underlying transformation matrix as tuple for given clip view.

Layer.in_point([view=View( 0 )])
Return type:PySide2.QtCore.uint
Layer.__ne__(layer)
Return type:PySide2.QtCore.bool
Layer.__eq__(layer)
Return type:PySide2.QtCore.bool
Layer.out_point([view=View( 0 )])
Return type:PySide2.QtCore.uint
Layer.parameter(name_components)
Return type:mocha.project.Parameter
Parameters:name_components (list of strings) – Relative name for a requested parameter.
Return type: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.
Return type:ParameterSet

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.tracking_input_clip([use_linked_layer=false])
Return type:mocha.project.Clip
Parameters:use_linked_layer (PySide2.QtCore.bool) – If True then will use the layer that this layer is linked to (See “Link to Track” in the User Guide).
Return type: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:mocha.project.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.