2.2. BezierContour

2.2.1. Synopsis

2.2.1.1. Functions

2.2.1.2. Properties

2.2.2. Detailed Description

Bezier contour class. Provides access to Bezier contours and their control points.

class mocha.project.BezierContour
BezierContour.control_point(index)
Return type

BezierControlPoint

Parameters

index (uint) – Control point index.

Returns

BezierControlPoint or None if index is invalid.

Returns bezier control point by index.

BezierContour.get_bounding_rect([time=0.f[, view=View( 0 )]])
Return type

list of float

Parameters
  • time (float) – Time

  • view (View) – View

Returns coordinates of top left and bottomRight points of the contour bounding rectangle, considering its handles, as a list of floats [x1, y1, x2, y2]

BezierContour.insert_point(time, bcp[, index=UINT_MAX[, view=View()]])
Return type

BezierControlPoint

Parameters
  • time (float) – Keyframe time.

  • xcp – Keyframe data.

  • index (uint) – Inserting index.

  • view (View) – View.

Inserts new control point into index position.

BezierContour.insert_point(time, bcpd[, index=UINT_MAX[, view=View()]])
Return type

BezierControlPoint

Parameters
  • time (float) – Keyframe time.

  • xcpd – Keyframe data.

  • index (uint) – Inserting index.

  • view (View) – View.

Inserts new control point into index position.

BezierContour.__eq__(rhs)
Return type

bool

BezierContour.parameter(name_components)
Return type

Parameter

Parameters

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

Returns Parameter instance bound with given name path.

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

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 Bezier contour parameters set.

BezierContour.remove()

Removes this contour.

BezierContour.set_control_points(points)
BezierContour.control_points
Type

list of BezierControlPoint instances

Access

read-write Provides access to list of BezierControlPoint instances.

BezierContour.psets
Type

ParameterSet

Access

read-only Provides access to the root parameter set.

Mimics parameter_set() call.