2.8. Layer¶
2.8.1. Synopsis¶
2.8.1.1. Functions¶
- def __eq__ (layer)
- def __ne__ (layer)
- def add_bezier_contour (time, points[, view=View()])
- def add_xspline_contour (time, points[, view=View()])
- def get_surface_position (point_index, time[, view=View( 0 )])
- def get_transform_matrix (time[, view=View()])
- def in_point ([view=View( 0 )])
- def out_point ([view=View( 0 )])
- def parameter (name_components)
- def parameter_set ([name_components=list()])
- def remove ()
- def set_parent (group[, index=0])
- def tracking_input_clip ([use_linked_layer=false])
2.8.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 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.8.2. Detailed Description¶
- class mocha.project.Layer(Layer)¶
- Layer.add_bezier_contour(time, points[, view=View()])¶
Return type: 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: Creates new bezier contour with given bezier control points.
- Layer.add_xspline_contour(time, points[, view=View()])¶
Return type: 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: 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: - time (PySide2.QtCore.float) – Keyframe time.
- view (mocha.project.View) – Clip view.
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: - group (mocha.project.LayerGroup) – New parent group.
- index (PySide2.QtCore.uint) – Insertion index.
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.
- Layer.link_to_track¶
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.