MQBoneManager class

(new in Rev4.64)

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

In Rev4.70, MQBoneManager has been changed significantly without a compatibility.

Class
MQBoneManager Constructor
Member functions
Verified Available or not
BeginImport Begin importing
EndImport End importing
AddBone Add a bone
DeleteBone Delete a bone
GetBoneNum Get a number of bones
EnumBoneID Enumerate bone IDs
EnumSelectedBoneID Enumerate selected bone IDs
Update Update
GetName Get a bone name
SetName Set a bone name
GetParent Get a parent bone
SetParent Set a parent bone
GetChildNum Get a number of child bones
GetChildren Get child bones
GetBasePos Get a position of a bone
SetBasePos Set a position of a bone
GetBaseMatrix Get a transformation matrix of a bone
GetUpVector Get an up vector of a bone
SetUpVector Set an up vector of a bone
GetForwardAxis Get a forward axis of a bone
SetForwardAxis Set a forward axis of a bone
GetDeformPos Get a deformed position of a bone
GetDeformMatrix Get a deformed transformation matrix of a bone
GetDeformScale Get a deformed scaling of a bone
SetDeformScale Set a deformed scaling of a bone
GetDeformRotate Get a deformed rotation angle of a bone
SetDeformRotate Set a deformed rotation angle of a bone
GetDeformTranslate Get a deformed translation of a bone
SetDeformTranslate Set a deformed translation of a bone
GetRotationMatrix Get a rotation matrix
GetAngleMin Get a minimum rotation angle
SetAngleMin Set a minimum rotation angle
GetAngleMax Get a maximum rotation angle
SetAngleMax Set a maximum rotation angle
GetVisible Get a visilibity of a bone
SetVisible Set a visilibity of a bone
GetLock Get a lock of a bone
SetLock Set a lock of a bone
GetDummy Get a dummy setting of a bone
SetDummy Set a dummy setting of a bone
GetIKChain Get a IK chain setting of a bone
SetIKChain Set a IK chain setting of a bone
GetMovable Get a movable setting of a bone
SetMovable Set a movable setting of a bone
GetSkinObjectNum Get a number of skin objects
EnumSkinObjectID Enumerate skin objects
AddSkinObject Add a skin object
DeleteSkinObject Delete a skin object
GetVertexWeightArray Get bones and weights a vertex
SetVertexWeight Set a weight
GetWeightedVertexArray Enumerate vertices that a bone affects
NormalizeVertexWeight Normalize weights for a vertex
GetIKName
GetIKParent
GetLink
GetGroupID
SetIKName
SetIKParent
SetLink
SetGroupID
EnumGroups
AddGroup
GetGroupName
Functions for PMD
GetEffectLimitNum Get a number of limited bones
DeformObject Apply a deformation
VRMMeta_Get
VRMMeta_Set
VRM0xMeta_Get
VRM0xMeta_Set
VRM0x_GetFlipZ
VRM0x_SetFlipZ
VRMHumanoid_Get
VRMHumanoid_Set
VRMHumanoid_GetTemplate
VRMFirstPerson_NewMeshAnnotation
VRMFirstPerson_DeleteMeshAnnotation
VRMFirstPerson_Enumerate
VRMFirstPerson_GetMeshAnnotation
VRMFirstPerson_SetMeshAnnotation
VRMLookAt_Get
VRMLookAt_Set
VRMCollider_New
VRMCollider_Delete
VRMCollider_Enumerate
VRMCollider_GetParam
VRMCollider_SetParam
VRMColliderGroup_New
VRMColliderGroup_Delete
VRMColliderGroup_Enumerate
VRMColliderGroup_GetName
VRMColliderGroup_SetName
VRMColliderGroup_GetColliders
VRMColliderGroup_SetColliders
VRMSpringBone_New
VRMSpringBone_Delete
VRMSpringBone_Enumerate
VRMSpringBone_GetName
VRMSpringBone_SetName
VRMSpringBone_GetJointNum
VRMSpringBone_AddJoint
VRMSpringBone_DeleteJoint
VRMSpringBone_GetJoint
VRMSpringBone_GetJointNum
VRMSpringBone_SetJoint
VRMSpringBone_GetColliderGroups
VRMSpringBone_SetColliderGroups
VRMSpringBone_GetCenterBone
VRMSpringBone_SetCenterBone
VRMNodeConstraint_New
VRMNodeConstraint_Delete
VRMNodeConstraint_Enumerate
VRMNodeConstraint_Get
VRMNodeConstraint_Set
Functions for VRM

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::DeleteBone(UINT bone_id);

It deletes a bone.


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

It registers a bone as a brother.

Obsolete in Rev4.70


int MQBoneManager::GetBoneNum();

It returns a number of bones.


int MQBoneManager::EnumBoneID(std::vector<UINT>& bone_id_array);

It enumerates bone IDs.


int MQBoneManager::EnumSelectedBoneID(std::vector<UINT>& bone_id_array);

It enumerates selected bone IDs.


int MQBoneManager::Update();

It applies modifications of bones and weights to the display.

If you have made any changes to the bones or weights from the station/command plug-in, call this function at the end. And, also call MQBasePlugin::UpdateUndo() to update the undo.


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.

Obsolete in Rev4.70


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.

Obsolete in Rev4.70


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.

Obsolete in Rev4.70, and replaced with GetBasePos().


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.

Obsolete in Rev4.70, and replaced with GetBasePos().


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

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

It gets or sets a position 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::GetForwardAxis(UINT bone_id, int& axis);

void MQBoneManager::SetForwardAxis(UINT bone_id, int axis);

axis
[0] +X
[1] -X
[2] +Y
[3] -Y
[4] +Z
[5] -Z

It gets or sets a forward axis.


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

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

Obsolete in Rev4.70, and replaced with GetDeformPos().


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

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

Obsolete in Rev4.70, and replaced with GetDeformPos().


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

It returns a deformed position 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::GetVisible(UINT bone_id, bool& visible);

void MQBoneManager::SetVisible(UINT bone_id, bool visible);

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


bool MQBoneManager::GetLock(UINT bone_id, bool& lock);

void MQBoneManager::SetLock(UINT bone_id, bool lock);

It gets or sets a setting of a locking 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::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.

The definition of the chain value has been changed in Rev4.70. 0 means without IK chain, and 1 or larger means a hierarchy to the root 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.

Obsolete in Rev4.70


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.


bool MQBoneManager::DeleteSkinObject(MQObject obj);

It removes 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<float>& 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::NormalizeVertexWeight(MQObject obj, UINT vertex_id);

obj
A skin object
vertex_id
An unique ID of a vertex
Return value
Succeeded or failed

It normalizes weights of bones that affects to the specified vertex.


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.

Obsolete in Rev4.70


void MQBoneManager::SetListMode(LIST_MODE mode);

It specifies a mode of a bone list.

Obsolete in Rev4.70


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.


bool MQBoneManager::VRMMeta_Get(VRM_META& meta);
bool MQBoneManager::VRMMeta_Set(const VRM_META& meta);
bool MQBoneManager::VRM0xMeta_Get(VRM0x_META& meta);
bool MQBoneManager::VRM0xMeta_Set(const VRM0x_META& meta);
bool MQBoneManager::VRM0x_GetFlipZ();
void MQBoneManager::VRM0x_SetFlipZ(bool flag);

Handles VRM meta information.


bool MQBoneManager::VRMHumanoid_Get(UINT bone_id, std::wstring& humanoid);
void MQBoneManager::VRMHumanoid_Set(UINT bone_id, const wchar_t *humanoid);
bool MQBoneManager::VRMHumanoid_GetTemplate(std::vector<VRM_HUMANOID_TEMPLATE>& humanoid, OPERATION_MODE mode = OPERATION_MODE::DEFAULT, bool acquire_bone_id = true);

Handles VRM humanoid information.


UINT MQBoneManager::VRMFirstPerson_NewMeshAnnotation(UINT obj_id, const VRM_MESH_ANNOTATION& anno);
bool MQBoneManager::VRMFirstPerson_DeleteMeshAnnotation(UINT annotation_id);
bool MQBoneManager::VRMFirstPerson_Enumerate(std::vector<UINT>& annotation_ids);
bool MQBoneManager::VRMFirstPerson_GetMeshAnnotation(UINT annotation_id, UINT& obj_id, VRM_MESH_ANNOTATION& anno);
bool MQBoneManager::VRMFirstPerson_SetMeshAnnotation(UINT annotation_id, const VRM_MESH_ANNOTATION& anno);

Handles VRM FirstPerson information.


bool MQBoneManager::VRMLookAt_Get(VRM_LOOKAT_PARAM& param);
bool MQBoneManager::VRMLookAt_Set(const VRM_LOOKAT_PARAM& param);

Handles VRM LookAt information.


UINT MQBoneManager::VRMCollider_New(UINT bone_id);
bool MQBoneManager::VRMCollider_Delete(UINT collider_id);
bool MQBoneManager::VRMCollider_Enumerate(std::vector<UINT>& collider_ids);
bool MQBoneManager::VRMCollider_GetParam(UINT collider_id, UINT& bone_id, VRM_COLLIDER_PARAM& param);
bool MQBoneManager::VRMCollider_SetParam(UINT collider_id, const VRM_COLLIDER_PARAM& param);
UINT MQBoneManager::VRMColliderGroup_New(const std::wstring& name, std::vector<UINT> collders = std::vector<UINT>());
bool MQBoneManager::VRMColliderGroup_Delete(UINT group_id);
bool MQBoneManager::VRMColliderGroup_Enumerate(std::vector<UINT>& group_ids);
bool MQBoneManager::VRMColliderGroup_GetName(UINT group_id, std::wstring& name);
bool MQBoneManager::VRMColliderGroup_SetName(UINT group_id, const std::wstring& name);
bool MQBoneManager::VRMColliderGroup_GetColliders(UINT group_id, std::vector<UINT>& collider_ids);
bool MQBoneManager::VRMColliderGroup_SetColliders(UINT group_id, std::vector<UINT> collider_ids);

Handles VRM colliders.


UINT MQBoneManager::VRMSpringBone_New(const std::wstring& name);
bool MQBoneManager::VRMSpringBone_Delete(UINT spring_id);
bool MQBoneManager::VRMSpringBone_Enumerate(std::vector<UINT>& spring_ids);
bool MQBoneManager::VRMSpringBone_GetName(UINT spring_id, std::wstring& name);
bool MQBoneManager::VRMSpringBone_SetName(UINT spring_id, const std::wstring& name);
int VRMSpringBone_GetJointNum(UINT spring_id);
bool MQBoneManager::VRMSpringBone_AddJoint(UINT spring_id, UINT bone_id, const VRM_SPRING_JOINT& joint);
bool MQBoneManager::VRMSpringBone_DeleteJoint(UINT spring_id, int index);
bool MQBoneManager::VRMSpringBone_GetJoint(UINT spring_id, int index, UINT& bone_id, VRM_SPRING_JOINT& joint);
bool MQBoneManager::VRMSpringBone_SetJoint(UINT spring_id, int index, const VRM_SPRING_JOINT& joint);
bool MQBoneManager::VRMSpringBone_GetColliderGroups(UINT spring_id, std::vector<UINT>& group_ids);
bool MQBoneManager::VRMSpringBone_SetColliderGroups(UINT spring_id, std::vector<UINT> group_ids);
bool MQBoneManager::VRMSpringBone_GetCenterBone(UINT spring_id, UINT& center_bone_id);
bool MQBoneManager::VRMSpringBone_SetCenterBone(UINT spring_id, UINT center_bone_id);

Handles VRM spring bones.


UINT MQBoneManager::VRMNodeConstraint_New(UINT bone_id);
bool MQBoneManager::VRMNodeConstraint_Delete(UINT nc_id);
bool MQBoneManager::VRMNodeConstraint_Enumerate(std::vector<UINT>& nc_ids);
bool MQBoneManager::VRMNodeConstraint_Get(UINT nc_id, UINT& bone_id, VRM_NODE_CONSTRAINT& param);
bool MQBoneManager::VRMNodeConstraint_Set(UINT nc_id, const VRM_NODE_CONSTRAINT& param);

Handles VRM node constraints.