mango.fields.geometry module

class mango.fields.geometry.NurbsCurveField(*args, **kwargs)

Bases: mango.fields.base.Field

The NurbsCurveField is used to store nurbs curve data. This nurbs curve data can be used to generate actual nurbs curves in the scene. The return value will be an OpenMaya.MObject that holds reference to kNurbsCurveData it can be used to initialize a OpenMaya.MFnNurbsCurve object.

default_value

Used by autodoc_mock_imports.

get_parent_plug(plug)

When the plug is connected for nurbs curves we can’t use the connected plug as that is only the output plug. In this case we find the node and use its ‘create’ attribute to create the correct OpenMaya.MPlug instance.

Parameters:plug (OpenMaya.MPlug) –
Returns:Plug to get/set attribute
Return type:OpenMaya.MPlug
get_plug_value(plug)

A copy of the data is made to make sure that the data object is not accidentally used to alter the data of the curve on the attribute. If any edits are made the object can be used to reset the attribute.

Parameters:plug (OpenMaya.MPlug) –
Returns:Nurbs curve data object
Return type:OpenMaya.MObject
mfn

Used by autodoc_mock_imports.

mfn_type

Used by autodoc_mock_imports.

set_plug_value(modifier, plug, value)

The value is a OpenMaya.MFnNurbsCurve object or a MObject that references to an OpenMaya.MFnNurbsCurveData object. The data is copied to make sure that any reference to the existing object is removed.

Parameters:
  • modifier (OpenMaya.MDGModifier) –
  • plug (OpenMaya.MPlug) –
  • value (OpenMaya.MObject/OpenMaya.MFnNurbsCurve) –
validate_mfn_nurbs_curve_data(value)
Raises:TypeError – When the value is not either a OpenMaya.MFnNurbsCurve or a OpenMaya.MObject with kNurbsCurveData reference.
class mango.fields.geometry.NurbsCurveArrayField(*args, **kwargs)

Bases: mango.fields.geometry.NurbsCurveField

The NurbsCurveArrayField is used to store an multi of nurbs curve data. This nurbs curve data can be used to generate actual nurbs curves in the scene. The return value will be an list of OpenMaya.MObject’s that holds reference to kNurbsCurveData it can be used to initialize a OpenMaya.MFnNurbsCurve object.

array = True
default_value = ()
validate_mfn_nurbs_curve_data(value)
Raises:TypeError – When the children values are not either a OpenMaya.MFnNurbsCurve or a OpenMaya.MObject with kNurbsCurveData reference.