2.10. Layer¶
2.10.1. Synopsis¶
2.10.1.1. Functions¶
def
__eq__(layer)def
__ne__(layer)def
add_bezier_contour(time, bezier_spline[, view=View()])def
add_bezier_contour(time, points[, view=View()])def
add_contour(time, contour[, view=View(0)])def
add_xspline_contour(time, points[, view=View()])def
add_xspline_contour(time, x_spline[, view=View()])def
get_contours()def
get_parent_group()def
get_surface_position(point_index, time[, view=View( 0 )])def
get_transform_matrix(time[, view=View()])def
in_point([view=View( 0 )])def
initLayerIfNecessary(context)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
set_parent_group(arg__1)def
tracking_input_clip([use_linked_layer=false])
2.10.1.2. Properties¶
property
contours[read-only] of mixed list ofXSplineContourandBezierContourinstancesproperty
link_to_track[read-write] ofLayeror NoneTypeproperty
locked[read-write] of boolproperty
matte_color[read-write] of 3-items tuple of float values in range [0.0…1.0]property
mesh[read-only] of Meshproperty
name[read-write] of strproperty
parent[read-write] of LayerGroupproperty
psets[read-only] of ParameterSetproperty
selected[read-write] of boolproperty
stroke_color[read-write] of 3-items tuple of float values in range [0.0…1.0]property
visibility[read-write] of boolproperty
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
-
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 (View) – View.
Creates new bezier contour with given bezier control points.
-
Layer.add_contour(time, contour[, view=View(0)])¶ - Return type
object
Copies the given contour into the layer, including all keyframes.
-
Layer.add_xspline_contour(time, x_spline[, view=View()])¶ - Return type
-
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 (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
-
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 (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
tuple- Parameters
time (float) – Keyframe time.
view (View) – Clip view.
- 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 (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 (View) – View.
Returns out-point value for given view.
-
Layer.parameter(name_components)¶ - Return type
- Parameters
name_components (list of strings) – Relative name for a requested parameter.
Returns
Parameterinstance bound with given name path.
-
Layer.parameter_set([name_components=list()])¶ - Return type
- Parameters
name_components (list of strings) – Relative name for a requested parameter set.
Returns
ParameterSetinstance 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 (LayerGroup) – New parent group.
index (uint) – Insertion index.
Moves the layer object to the certain group. Pass
Noneto move it to the top level.
-
Layer.set_parent_group(arg__1)¶
-
Layer.tracking_input_clip([use_linked_layer=false])¶ - Return type
- Parameters
use_linked_layer (bool) – If
Truethen will use the layer that this layer is linked to (See “Link to Track” in the User Guide).- Returns
Clipinstance.
Returns
Clipinstance 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
XSplineContourandBezierContourinstances- Access
read-only Provides access to list of this layer contours.
-
Layer.parent¶ - Type
- 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
Layeror 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
- Access
read-only Provides access to the parameter set.
Mimics parameter_set() call.