SkinningTools.Maya.tools.weightsManager

Module Contents

Classes

WeightsManager

this is the manager class, maybe make a different ui class to attach these elements to

class SkinningTools.Maya.tools.weightsManager.WeightsManager(inProgressBar=None)

this is the manager class, maybe make a different ui class to attach these elements to when loading there are 4 scenarios:

  1. 1 to 1 the mesh and joints are exactly the same ( need to find a way to double check the vertex order to make sure)

  2. mesh is not the same, joints are (we need to find the best possible match using closest vertex/uvs) try baricentric coordinates where possible

  3. mesh is the same but joints are not (remap joints with the remapper, this can be closest joint, joint naming etc.)

  4. mesh and joints are total mismatch (double check if joints are somewhate in a similar position and bounding box of the mesh is within range, maybe also do a check on joint hierarchy)

allow files to be stored anywhere on the pc, maybe keep track on where its placed using qsettings also have a folder structure tree and file window next to each other for this place a base file setup where these files can be stored by default for quick save and load

_getPosAndUvCoords(self, inMesh)

get positional data of the current mesh’s components

Parameters

inMesh (string) – the mesh to gather data from

Returns

list of positions and uv coordinates

Return type

list

checkNeedsClosestVtxSearch(self, data, fromMesh, toMesh)

check the current mesh’s positional data with the stored data

Parameters
  • data (dict) – data from the stored meshes

  • fromMesh (string) – the direct mesh to compare with that was stored

  • toMesh (string) – the mesh that will get the information

Returns

True if object data does not match

Return type

bool

gatherData(self)

gather the data from current selection of objects

Returns

data from current selected objects

Return type

dict

importData(self, jsonFile, workMesh=None, scale=1.0, closestNPoints=3, uvBased=False)

import data from a json file this setup tries to make it possible to load skinning information that does not match the original object

Todo

make sure it works only on the workmesh if given

Todo

fix the setup in a way that it works with the given scale

Parameters
  • jsonFile (string) – the file that holds all the skinning information

  • closestNPoints (int) – closest amount of positions to search from

  • uvBased (bool) – if True will try to search information based on UV’s, if False will use the points in the 3d scene

readData(self, jsonFile)

read the data from a json file

Returns

data from the json file

Return type

dict