MQBoneManager class

(new in Rev4.64)

MQBoneManager class accesses to the BoneDeformer plugin (BoneDeformer.dll).

Class
MQBoneManager Constructor
Member functions
BeginImport Begin importing
EndImport End importing

MQBoneManager::MQBoneManager(MQBasePlugin *plugin, MQDocument doc);

plugin
A plugin
doc
A document

It is a constructor.


static DWORD MQBoneManager::GetProductID();

It returns a product ID of BoneDeformer plugin.


static DWORD MQBoneManager::GetPluginID();

It returns a plugin ID of BoneDeformer plugin.


bool MQBoneManager::Verified();

It returns whether the BoneDeformer plugin is available.


void MQBoneManager::BeginImport();

It begins an importing.

This method must be called before you add skin objects and bones in an Import plugin.


void MQBoneManager::EndImport();

It finishes an importing.

This method must be called after calling BeginImport() and adding skin objects and bones.


UINT MQBoneManager::AddBone(const ADD_BONE_PARAM& param);

It adds a bone.


bool MQBoneManager::AddBrother(UINT bone_id, UINT brother_bone_id);

It registers a bone as a brother.


int MQBoneManager::GetBoneNum();

It returns a number of bones.


int MQBoneManager::EnumBoneID(std::vector& bone_id_array);

It enumerates bone IDs.


bool MQBoneManager::GetName(UINT bone_id, std::wstring& name);

void MQBoneManager::SetName(UINT bone_id, const wchar_t *name);

It gets or sets bone's name.


bool MQBoneManager::GetTipName(UINT bone_id, std::wstring& name);

void MQBoneManager::SetTipName(UINT bone_id, const wchar_t *tip_name);

It gets or sets bone's tip name.


bool MQBoneManager::GetParent(UINT bone_id, UINT& parent_id);

void MQBoneManager::SetParent(UINT bone_id, UINT parent_id);

It gets or sets an ID of a parent bone.


bool MQBoneManager::GetChildNum(UINT bone_id, int& child_num);

It returns a number of child bones.


bool MQBoneManager::GetChildren(UINT bone_id, std::vector<UINT>& children);

It returns an array of IDs of child bones.


bool MQBoneManager::GetBrothers(UINT bone_id, std::vector<UINT>& brothers);

It returns an array of IDs of brother bones.


bool MQBoneManager::GetBaseRootPos(UINT bone_id, MQPoint& pos);

void MQBoneManager::SetBaseRootPos(UINT bone_id, const MQPoint& pos);

It gets or sets a position of a root of a bone before deforming.


bool MQBoneManager::GetBaseTipPos(UINT bone_id, MQPoint& pos);

void MQBoneManager::SetBaseTipPos(UINT bone_id, const MQPoint& pos);

It gets or sets a position of a tip of a bone before deforming.


bool MQBoneManager::GetBaseMatrix(UINT bone_id, MQMatrix& matrix);

It returns a transformation matrix of a bone before deforming.


bool MQBoneManager::GetUpVector(UINT bone_id, MQMatrix& matrix);

void MQBoneManager::SetUpVector(UINT bone_id, const MQMatrix matrix);

It gets or sets an up vector of a bone.


bool MQBoneManager::GetDeformRootPos(UINT bone_id, MQPoint& pos);

It returns a deformed position of a root of a bone.


bool MQBoneManager::GetDeformTipPos(UINT bone_id, MQPoint& pos);

It returns a deformed position of a tip of a bone.


bool MQBoneManager::GetDeformMatrix(UINT bone_id, MQMatrix& matrix);

It returns a deformed transformation matrix of a bone.


bool MQBoneManager::GetDeformScale(UINT bone_id, MQPoint& scale);

void MQBoneManager::SetDeformScale(UINT bone_id, const MQPoint& scale);

It gets or sets a deformed scaling of a bone.


bool MQBoneManager::GetDeformRotate(UINT bone_id, MQAngle& angle);

void MQBoneManager::SetDeformRotate(UINT bone_id, const MQAngle& angle);

It gets or sets a deformed rotation angle of a bone.


bool MQBoneManager::GetDeformTranslate(UINT bone_id, MQPoint& translate);

void MQBoneManager::SetDeformTranslate(UINT bone_id, const MQPoint& translate);

It gets or sets a deformed translation of a bone.


bool MQBoneManager::GetRotationMatrix(UINT bone_id, MQMatrix& matrix);

It returns a rotation matrix of a bone.


bool MQBoneManager::GetAngleMin(UINT bone_id, MQAngle& angle);

void MQBoneManager::SetAngleMin(UINT bone_id, const MQAngle& angle);

It gets or sets a minimum limited rotation angle a bone.


bool MQBoneManager::GetAngleMax(UINT bone_id, MQAngle& angle);

void MQBoneManager::SetAngleMax(UINT bone_id, const MQAngle& angle);

It gets or sets a maximum limited rotation angle a bone.


bool MQBoneManager::GetIKChain(UINT bone_id, int& chain);

void MQBoneManager::SetIKChain(UINT bone_id, int chain);

It gets or sets a setting of an IK chain of a bone.


bool MQBoneManager::GetDummy(UINT bone_id, bool& dummy);

void MQBoneManager::SetDummy(UINT bone_id, bool dummy);

It gets or sets a setting of a dummy of a bone.


bool MQBoneManager::GetEndPoint(UINT bone_id, bool& end_point);

void MQBoneManager::SetEndPoint(UINT bone_id, bool end_point);

It gets or sets a setting of an end node of a bone.


bool MQBoneManager::GetMovable(UINT bone_id, bool& movable);

void MQBoneManager::SetMovable(UINT bone_id, bool movable);

It gets or sets a setting of a moveable root of a bone.


int MQBoneManager::GetSkinObjectNum();

It returns a number of skin objects.


int MQBoneManager::EnumSkinObjectID(std::vector<UINT>& obj_id_array);

It returns an unique ID of a skin object.


bool MQBoneManager::AddSkinObject(MQObject obj);

It adds a skin object.


int MQBoneManager::GetVertexWeightArray(MQObject obj, UINT vertex_id, int array_num, UINT *bone_ids, float *weights);

obj
A skin object
vertex_id
An unique ID of a vertex
array_num
A length of 'bone_ids' and 'weights' array
bone_ids
An array to store bone IDs
weights
An array to store weight values (0 to 100)
Return value
A number of stored bones and vertices

It returns bones and weight values that influence the specified vertex.

'array_num' means a length of 'bone_ids' and 'weights' arrays. If a number of actual influencing bones exceeds 'array_num', smaller weight values are ignored. To store all weight values, 'array_num' must be equal to the return value of GetBoneNum().

A pair of a bone and a weight value is stored to 'bone_ids' and 'weights' in descending order.


bool MQBoneManager::SetVertexWeight(MQObject obj, UINT vertex_id, UINT bone_id, float weight);

obj
A skin object
vertex_id
An unique ID of a vertex
bone_id
A bone ID
weight
A weight value (0 to 100)
Return value
Succeeded or failed

It sets a weight value of a bone to the specified vertex.


int MQBoneManager::GetWeightedVertexArray(UINT bone_id, MQObject obj, std::vector<UINT>& vertex_ids, std::vector& weights);

bone_id
A bone ID
obj
A skin object
vertex_ids
An unique ID of a vertex
weights
A weight value (0 to 100)
Return value
A number of vertices the bone influences

It returns vertices and weight values that the specified bone influences.


bool MQBoneManager::GetTipBone(UINT bone_id, UINT& tip_bone_id);

bool MQBoneManager::GetIKName(UINT bone_id, std::wstring& ik_name, std::wstring& ik_tip_name);

bool MQBoneManager::GetIKParent(UINT bone_id, UINT& ik_parent_bone_id, bool& isIK);

bool MQBoneManager::GetLink(UINT bone_id, LINK_PARAM& param);

bool MQBoneManager::GetGroupID(UINT bone_id, UINT& group_id);

void MQBoneManager::SetTipBone(UINT bone_id, UINT tip_bone_id);

void MQBoneManager::SetIKName(UINT bone_id, const wchar_t *ik_name, const wchar_t *ik_tip_name);

void MQBoneManager::SetIKParent(UINT bone_id, UINT ik_parent_bone_id, bool isIK);

void MQBoneManager::SetLink(UINT bone_id, const LINK_PARAM& param);

void MQBoneManager::SetGroupID(UINT bone_id, UINT group_id);

int MQBoneManager::EnumGroups(std::vector<UINT>& group_ids);

UINT MQBoneManager::AddGroup(const wchar_t *name);

bool MQBoneManager::GetGroupName(UINT group_id, std::wstring& name);

These are functions for PMD.


int MQBoneManager::GetEffectLimitNum();

It returns a maximum number of bones affect each vertex. When the value is 0, the number of bones is not limited.


MQBoneManager::LIST_MODE MQBoneManager::GetListMode();

It returns a mode of a bone list.


void MQBoneManager::SetListMode(LIST_MODE mode);

It specifies a mode of a bone list.


bool MQBoneManager::DeformObject(MQObject obj, MQObject target);

obj
A skin object
target
A clone object of 'obj'
Return value
Succeeded or failed

It deforms a clone of the skin object by the bone information. It cannot deform a skin object directly.