# IRdSkinningParameters Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | AddBone (GUID gBoneId, IRdMatrixf *pDefaultPose)
HRESULT | RemoveBone (GUID gBoneId)
HRESULT | GetNumBones (RtUlong *pdwCount)
HRESULT | GetBoneId (RtUlong dwIndex, GUID *pgBoneId)
HRESULT | SetBoneId (RtUlong dwIndex, GUID gBoneId)
HRESULT | GetBoneDefaultPoseInv (RtUlong dwIndex, RtMatrixf *pMatrix)
HRESULT | SetBoneDefaultPose (RtUlong dwIndex, RtMatrixf *pMatrix)
HRESULT | GetSkinningData (RtUlong dwIndex, IRsGenStream **ppBuffer)
HRESULT | SetSkinningData (RtUlong dwIndex, IRsGenStream *pBuffer)
HRESULT | GetBoneIndex (GUID gBoneId, RtUlong *pdwIndex)
HRESULT | GetSkinReferenceMesh (IRdMesh **ppMesh)
HRESULT | SetSkinReferenceMesh (IRdMesh *pMesh)

## Detailed Description

IRdSkinningParameters:

- Defines parameters for shared skinning data object.
- It includes reference meshes that are used for skin buffer permutations & topology resistance during mesh editing.
- When entering edit mode, skinning node sets reference mesh to skinning node (this mesh contains ordering for which skin is defined).
- Upon edit mode exit, skinning node recalculate vertex buffers and remove reference meshes to save resources.
- For reference meshes, only triangles, geometry id triangles and geometry id coordinates are used.
- To retarget skin from one mesh to another, one lookups for each new vertex using it's geometry coordinates to existing skin buffer and use coordinate information to interpolate new vertex weight.

IRdSkinningParameters defines per bone skinning data.

## Member Function Documentation

HRESULT IRdSkinningParameters::AddBone | ( | GUID | gBoneId,
|  | IRdMatrixf * | pDefaultPose |
| ) |  |  |

Add bone to skinning parameters. Note, that you are responsible for filling skinning data to maintain consistency.

Parameters:

  | gBoneId | [in] ID of the bone you are adding. After attaching bone will get 0 influence weight.
  | pDefaultPose | [in] Default pose is just orientation of joints for the bone.

Returns:
  S_OK

HRESULT IRdSkinningParameters::RemoveBone | ( | GUID | gBoneId | ) |

Remove bone from skinning parameters.

Parameters:

  | gBoneId | [in] ID of bone to remove.

Returns:
  S_OK if succeeded.

HRESULT IRdSkinningParameters::GetNumBones | ( | RtUlong * | pdwCount | ) |

Get number of bones used for skinning.

Returns:
  pdwCount [out,retval] Filled with number of bone records.

  S_OK

HRESULT IRdSkinningParameters::GetBoneId | ( | RtUlong | dwIndex,
|  | GUID * | pgBoneId |
| ) |  |  |

Get skinning bone ID.

Parameters:

  | dwIndex | [in] Record index.
  | pgBoneId | [out] Retrieved bone GUID.

Returns:
  S_OK if succeeded.

HRESULT IRdSkinningParameters::SetBoneId | ( | RtUlong | dwIndex,
|  | GUID | gBoneId |
| ) |  |  |

Set skinning bone ID.

Parameters:

  | dwIndex | [in] Record index.
  | gBoneId | [in] New bone ID to set.

HRESULT IRdSkinningParameters::GetBoneDefaultPoseInv | ( | RtUlong | dwIndex,
|  | RtMatrixf * | pMatrix |
| ) |  |  |

Get inverse matrix for default pose. In default pose, skinning makes no changes to the mesh.

Parameters:

  | dwIndex | [in] Record index.
  | pMatrix | [out] Inverse of stance pose matrix.

Returns:
  S_OK

HRESULT IRdSkinningParameters::SetBoneDefaultPose | ( | RtUlong | dwIndex,
|  | RtMatrixf * | pMatrix |
| ) |  |  |

Set default pose matrix. In default pose, skinning makes no changes to the mesh.

Parameters:

  | dwIndex | [in] Record index.
  | pMatrix | [in] Matrix to set.

Returns:
  S_OK

HRESULT IRdSkinningParameters::GetSkinningData | ( | RtUlong | dwIndex,
|  | IRsGenStream ** | ppBuffer |
| ) |  |  |

Get skinning data for specified bone index.

Parameters:

  | dwIndex | [in] Record index.

Returns:
  ppBuffer [out,retval] Retrieved skinning buffer.

  S_OK

HRESULT IRdSkinningParameters::SetSkinningData | ( | RtUlong | dwIndex,
|  | IRsGenStream * | pBuffer |
| ) |  |  |

Set skinning data for specified bone index.

Parameters:

  | dwIndex | [in] Record index.
  | pBuffer | [in] Skin influence data to set.

HRESULT IRdSkinningParameters::GetBoneIndex | ( | GUID | gBoneId,
|  | RtUlong * | pdwIndex |
| ) |  |  |

Get bone index.

Parameters:

  | gBoneId | [in] Bone id to look for.

Returns:
  pdwIndex [out,retval] Filled with record index.

  S_OK if bone found.

HRESULT IRdSkinningParameters::GetSkinReferenceMesh | ( | IRdMesh ** | ppMesh | ) |

Get skin reference mesh.

Returns:
  ppReferenceMesh [out,retval] Skin reference mesh.

  S_OK

HRESULT IRdSkinningParameters::SetSkinReferenceMesh | ( | IRdMesh * | pMesh | ) |

Set skin reference mesh.

Parameters:

  | pReferenceMesh | [in] Skin reference mesh to set.
  | S_OK |