trigger.objects.skin ==================== .. py:module:: trigger.objects.skin Attributes ---------- .. autoapisummary:: trigger.objects.skin.log Classes ------- .. autoapisummary:: trigger.objects.skin.Weight Functions --------- .. autoapisummary:: trigger.objects.skin.addList trigger.objects.skin.clamp trigger.objects.skin.multiplyList trigger.objects.skin.subtractList Module Contents --------------- .. py:class:: Weight(source=None) Bases: :py:obj:`object` .. py:method:: 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 .. py:method:: apply(deformer) Applies the data to specified deformer .. py:method:: barycentric_interpolate(vec_a, vec_b, vec_c, vec_p) :staticmethod: 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. .. py:method:: export(file_path) Exports the data to specified json file path .. py:method:: 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) .. py:method:: get_all_influences() Returns the name of all influences the data contains .. py:method:: 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) .. py:method:: get_vertex_count() Finds and returns the vertex count from the _data .. py:method:: negate(influences=None) Negates the point weights Args: influences: (List) negates only given influences. If None negates all Returns: .. py:method:: remove_influence(influence_name) Removes the given influence (weights) from the data .. py:method:: subtract(influences, influence_data, clamp=True) removes the influence data from defined influences .. py:method:: validate(data=None) validates data against the maya weight format standards .. py:property:: is_temp_dirty Checks the temp file and dirty flag and returns True if the temp file requires recreated or not .. py:function:: addList(list_of_values) .. py:function:: clamp(num, min_value=0, max_value=1) .. py:function:: multiplyList(list_of_values) .. py:function:: subtractList(list_of_values) .. py:data:: log