trigger.objects.skin

Attributes

log

Classes

Weight

Functions

addList(list_of_values)

clamp(num[, min_value, max_value])

multiplyList(list_of_values)

subtractList(list_of_values)

Module Contents

class Weight(source=None)

Bases: object

add_influence(influence_data, force=True, normalize_other_influences=True)

Adds the influence to the data Args:

influence_data: (dict) data dictionary which can be get with get_influence_data() force: (bool) If true, replaces the existing influence. Else an exception raises

Returns: None

apply(deformer)

Applies the data to specified deformer

static barycentric_interpolate(vec_a, vec_b, vec_c, vec_p)

Calculates barycentricInterpolation of a point in a triangle.

:param vec_a - OpenMaya.MVector of a vertex point. :param vec_b - OpenMaya.MVector of a vertex point. :param vec_c - OpenMaya.MVector of a vertex point. :param vec_p - OpenMaya.MVector of a point to be interpolated.

Returns list of 3 floats representing weight values per each point.

export(file_path)

Exports the data to specified json file path

feed(source)

provides the data that the class needs to work with. The source can be:

  • absolute json path (string) (valid weight formatted matching cmds.deformerWeights output))

  • dictionary item (matching cmds.deformerWeights output

  • skinCluster node (String) (must be present in the current maya scene)

get_all_influences()

Returns the name of all influences the data contains

get_influence_data(influence_name)

searches the data dictionary and returns the related influence dictionary like Args:

influence_name: name of the influence object

The returned data is similar to this:
{

“deformer”: “testCylinder_skinCluster”, “source”: “jDef_Collar_L_Arm”, “shape”: “testCylinder_Shape1”, “layer”: 0, “defaultValue”: -1.0, “points”: [

{

“index”: 0, “value”: 0.9989053498388121

“size”: 4122, “max”: 4121

},

returns: (dict) influence data (weights)

get_vertex_count()

Finds and returns the vertex count from the _data

negate(influences=None)

Negates the point weights

Args:

influences: (List) negates only given influences. If None negates all

Returns:

remove_influence(influence_name)

Removes the given influence (weights) from the data

subtract(influences, influence_data, clamp=True)

removes the influence data from defined influences

validate(data=None)

validates data against the maya weight format standards

property is_temp_dirty
Checks the temp file and dirty flag and returns True if the temp file requires recreated or not
addList(list_of_values)
clamp(num, min_value=0, max_value=1)
multiplyList(list_of_values)
subtractList(list_of_values)
log