#include <lib_ca.h>
Represents the Weight Manager.
Private Member Functions | |
CAWeightMgr ()=delete | |
~CAWeightMgr ()=delete | |
Manager Update | |
static Bool | Update (BaseDocument *doc) |
static Bool | SetDirty (BaseDocument *doc) |
static maxon::Result< Int > | GetAutoWeightAlgoIndex (BaseDocument *doc, const maxon::Id &id) |
static maxon::Result< maxon::Id > | GetAutoWeightAlgoId (BaseDocument *doc, Int index) |
static maxon::Result< void > | GetAutoWeightRef (BaseDocument *doc, const maxon::Id &autoweightId, maxon::AutoWeightRef &autoWeightRef) |
static maxon::Result< maxon::DataDictionary > | GetAutoWeightDictionary (BaseDocument *doc, const maxon::Id &autoweightId) |
static maxon::Result< void > | SetAutoWeightDictionary (BaseDocument *doc, maxon::DataDictionary dataDictionary, maxon::Id autoweightId) |
static Bool | SetParameter (BaseDocument *doc, Int32 id, const GeData &newValue) |
static Bool | GetParameter (BaseDocument *doc, Int32 id, GeData &value) |
List Access | |
static Int32 | GetTagCount (BaseDocument *doc) |
static Int32 | GetJointCount (BaseDocument *doc, Int32 tagIdx) |
static Int32 | GetTagIndex (BaseDocument *doc, const CAWeightTag *tag) |
static Bool | GetJointIndex (BaseDocument *doc, const CAWeightTag *tag, const BaseObject *joint, Int32 &tagIdx, Int32 &jointIdx) |
static UInt64 | GetJointId (BaseDocument *doc, const CAWeightTag *tag, const BaseObject *joint) |
static BaseObject * | GetJointObject (BaseDocument *doc, Int32 tagIdx, Int32 jointIdx) |
static BaseObject * | GetJointObject (BaseDocument *doc, UInt64 id) |
static CAWeightTag * | GetWeightTag (BaseDocument *doc, Int32 tagIdx) |
static BaseObject * | GetMeshObject (BaseDocument *doc, Int32 tagIdx) |
static Bool | ValidateJointIndex (BaseDocument *doc, Int32 tagIdx, Int32 jointIdx) |
Selection | |
static Bool | IsJointSelected (BaseDocument *doc, Int32 tagIdx, Int32 jointIdx) |
static Bool | IsJointSelected (BaseDocument *doc, UInt64 id) |
static Bool | SelectJoint (BaseDocument *doc, Int32 tagIdx, Int32 jointIdx) |
static Bool | SelectJoint (BaseDocument *doc, UInt64 id) |
static Bool | UnselectJoint (BaseDocument *doc, Int32 tagIdx, Int32 jointIdx) |
static Bool | UnselectJoint (BaseDocument *doc, UInt64 id) |
static void | SelectAllJoints (BaseDocument *doc) |
static void | UnselectAllJoints (BaseDocument *doc) |
static Bool | UnselectAllJointListNodes (BaseDocument *doc) |
Locks | |
static Bool | IsJointLocked (BaseDocument *doc, Int32 tagIdx, Int32 jointIdx) |
static Bool | IsJointLocked (BaseDocument *doc, UInt64 id) |
static Bool | LockAllJoints (BaseDocument *doc) |
static Bool | LockSelectedJoints (BaseDocument *doc) |
static Bool | UnlockAllJoints (BaseDocument *doc) |
static Bool | UnlockSelectedJoints (BaseDocument *doc) |
Weighting Functions | |
static Bool | NormalizeWeights (BaseDocument *doc) |
static Bool | ClearWeights (BaseDocument *doc) |
static Bool | AutoWeight (BaseDocument *doc) |
static Bool | MirrorWeights (BaseDocument *doc) |
static Bool | BakeWeights (BaseDocument *doc, Bool normalize) |
static Bool | CopyWeights (BaseDocument *doc) |
static Bool | PasteWeights (BaseDocument *doc, Bool merge) |
static Bool | FlipWeights (BaseDocument *doc) |
static Bool | SmoothWeights (BaseDocument *doc) |
static Bool | ApplyWeightFunction (BaseDocument *doc, Bool allPoints) |
|
privatedelete |
|
privatedelete |
|
static |
Updates the internal weighted object list.
Call before using other methods of CAWeightMgr if the Weight Manager dialog is closed and if the weight tool is inactive. Any of the two condition is enough to have the update run automatically each frame.
Also call if the weighted object list was changed programmatically. For instance after adding a new tag, performing undo redo, or any reason where an update is needed immediately.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Sets the Weight Manager dirty to force an update on the next call to Update().
If the Weight Manager dialog is opened or if the Weight Manager is active, the update happens automatically at the next frame.
To force an update after a parameter change, use SetDirty(), then call Update(). Call SetDirty() if a Weight Manager's parameter was directly modified in its container.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Get the AutoWeightRef algorithm's index associated with the given id.
[in] | doc | The active document. |
[in] | id | The autoweight id. |
|
static |
Get the AutoWeightRef algorithm's id associated with the given index.
[in] | doc | The active document. |
[in] | index | The autoweight int. |
|
static |
Get the AutoWeightRef from the given id.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument.. |
[in] | autoweightId | The maxon id of the autoweight algorithm. |
|
static |
Get autoweight dictionary of the Weight Manager.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument.. |
[in] | autoweightId | The maxon id of the autoweight algorithm. |
|
static |
Set autoweight dictionary of the Weight Manager.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument.. |
[in] | dataDictionary | The data dictionary with the autoweight parameters inside. |
[in] | autoweightId | The maxon id of the autoweight algorithm. |
|
static |
Sets a parameters of the Weight Manager.
Result is the same as setting a parameter on the Weight Manager's container directly except that SetParameter() allows to specify the document in which to set the parameter.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | id | The ID of the parameter to set. |
[in] | newValue | The parameter data to set. |
|
static |
Retrieves a parameter of the Weight Manager.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | id | The ID of the parameter to set. |
[out] | value | The parameter data. |
|
static |
Queries the number of weight tags in the scene.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Queries the number of joints bound to a weight tag.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag index in the list: 0 <= tagIdx < GetTagCount(). |
|
static |
Finds a tag's index in the joint list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tag | The weight tag to search for. The caller owns the pointed CAWeightTag. |
|
static |
Finds a joint's main (tag) and sub (joint) indices in the joint list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tag | The tag's address. The caller owns the pointed CAWeightTag. |
[in] | joint | The joints's address. The caller owns the pointed BaseObject. |
[out] | tagIdx | The tag's index in the joint list, or NOTOK if not found. |
[out] | jointIdx | The joint's index in the joint list, or NOTOK if not found. |
|
static |
Returns the unique Id of a joint. This Id remains valid even if the joint list changes or if undo/redo is used.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tag | The tag's address. The caller owns the pointed CAWeightTag. |
[in] | joint | The joint's address. The caller owns the pointed BaseObject. |
|
static |
Finds a joint object from its indices.
[in] | doc | The doc containing the tag and joint. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag's index in the joint list. |
[in] | jointIdx | The joint's index in the joint list. |
|
static |
Finds a joint object from its unique Id in the joint list.
[in] | doc | The doc that contains the tag and joint. The caller owns the pointed BaseDocument. |
[in] | id | The Id of the joint in the Weight Manager joint list. |
|
static |
Finds a weight tag from its index in the joint list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag's index in the joint list. |
|
static |
Finds the object owning the weight tag from a tag index in the joint list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag's index in the joint list. |
|
static |
Validates tag/joint indices before access.
[in] | doc | The doc that contains the tags and joints. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag's index in the joint list. |
[in] | jointIdx | The joint's index in the joint list. |
|
static |
Checks if a joint of the Weight Manager list is selected. Joint is identified by tag-joint index pair.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag's index in the joint list. |
[in] | jointIdx | The joint's index in the weight tag. |
|
static |
Checks if a joint of the Weight Manager list is selected. Joint is identified by Id.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | id | The joint's Id. |
|
static |
Selects a joint of the Weight Manager list. Joint is identified by tag-joint index pair.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag's index in the joint list. |
[in] | jointIdx | The joint's index in the weight tag. |
|
static |
Selects a joint of the Weight Manager list. Joint is identified by Id.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | id | The joint's Id. |
|
static |
Deselects a joint of the Weight Manager list. Joint is identified by tag-joint index pair.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag's index in the joint list. |
[in] | jointIdx | The joint's index in this tag. |
|
static |
Deselects a joint of the Weight Manager list. Joint is identified by Id.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | id | The joint's Id. |
|
static |
Selects all joints of all tags in the Weight Manager list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Deselects all joints of all tags in the Weight Manager list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Deselects all of the nodes in the Weight Manager joint list. This includes all type of nodes (mesh/tag/folder/joint).
[in] | doc | The document in which to deselect all nodes. The caller owns the pointed BaseDocument. |
|
static |
Checks if a joint of the Weight Manager list is locked. Joint is identified by tag-joint index pair.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | tagIdx | The tag's index in the joint list. |
[in] | jointIdx | The joint's index in the weight tag. |
|
static |
Checks if a joint of the Weight Manager list is locked. Joint is identified by Id.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | id | The joint's id. |
|
static |
Locks all joints of all tags in the Weight Manager list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Locks selected joints in the Weight Manager list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Unlocks all joints of all tags in the Weight Manager list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Unlocks selected joints in the Weight Manager list.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Applies a normalization on the selected joints. Some joints can be locked prior to normalization to avoid touching some joints.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Clears all weights on the selected joints.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Runs an auto weight algorithm on the selected joints. Uses the parameters currently set in the Weight Manager's container for the document.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Mirrors the weights for the selected joints. Uses the parameters currently set in the Weight Manager's container for the document.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Bakes the effector weights. Uses the parameters currently set in the Weight Manager's container for the document.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | normalize | true to normalize after bake operation, otherwise false. |
|
static |
Copies the weights of the selected joints into the weights clipboard.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Pastes the copied weights on the selected joints. Uses the parameters currently set in the Weight Manager's container for the document.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | merge | true to merge with target weights, false to replace target weights:
|
|
static |
Flips the weights of the selected joints. Each joint is flipped on itself using the local axis specified in Weight Manager container.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Smooths the weights of the selected joints. Uses the parameters currently set in the Weight Manager's container for the document.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
|
static |
Applies the currently selected weighting function to the selected joints (add, smooth, remap etc.). Uses the parameters currently set in the Weight Manager's container for the document.
[in] | doc | The document for the Weight Manager. The caller owns the pointed BaseDocument. |
[in] | allPoints | true to apply on all the points of the mesh, false to apply on point selection. |