bgdev.utils.pivot

This module deals with pivot import/export.

created

04/01/2018

author

Benoit GIELLY <benoit.gielly@gmail.com>

export_to_file(path, rules=None, base_grp='modelHierarchy')[source]

Export pivots matrices.

Parameters
  • path (file) – Path to JSON file

  • rules (dict) – Custom “SkinMap” or it will be autogenerated by generate_data()

  • base_grp (str) – Top group to pass into the data autogeneration function

Returns

The pivot data

Return type

dict

generate_data(base_grp='modelHierarchy')[source]

Autogenerate a dictionary based on constraint nodes in scenes.

The key/value pair is equal to nodes/joints.

Parameters

base_grp (str) – Top group to investigate all descendents from.

Returns

Dictionary that maps the node with its driver.

Return type

dict

import_from_file(path)[source]

Import pivots from json file.

Parameters

path (file) – Path to JSON file

Returns

The data dictionary used

Return type

dict

reset_pivot(mesh, matrix)[source]

Reset given mesh to given matrix.

Parameters
  • mesh (str) – Node to reset pivot

  • matrix (matrix) – Matrix table giving the exact position of the pivot