# IRfSkinSet Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | GetSkinStream (RtFloat *pfWeights, IRdMesh *pMesh, IRsGenStream **ppSkinStream)
HRESULT | ExpandSkinWeights (IRsGenStream *pStream, IRdMesh *pMesh, RtFloat *pfWeights)
HRESULT | RetargetSkin (IRdSkinningParameters *pSkin, IRdMesh *pTargetMesh)
HRESULT | AccumulateSkinWeights (IRsGenStream *pStream, IRdMesh *pMesh, RtFloat *pfWeights)
HRESULT | GetReferenceMesh (IRdMesh *pInpMesh, IRdMesh **ppMeshRef)

## Detailed Description

IRfSkinSet provides helper functions for operations on vertex skin weights.

## Member Function Documentation

HRESULT IRfSkinSet::GetSkinStream | ( | RtFloat * | pfWeights,
|  | IRdMesh * | pMesh,
|  | IRsGenStream ** | ppSkinStream |
| ) |  |  |

From list of skin weights create indexed or direct skin weight stream.

Parameters:

  | pfWeights | [in] Per vertex skin weights
  | pMesh | [in] Mesh for which skin weights are defined
  | ppSkinStream | [out, retval] Generated skin weights stream (compressed)

HRESULT IRfSkinSet::ExpandSkinWeights | ( | IRsGenStream * | pStream,
|  | IRdMesh * | pMesh,
|  | RtFloat * | pfWeights |
| ) |  |  |

Expand skin stream to per vertex skin weights.

Parameters:

  | pStream | [in] Compressed skin weights stream
  | pMesh | [in] Mesh for which pStream is defined
  | pfWeights | [out] Per vertex skin weights. pfWeights must be at the least number of vertices long.

HRESULT IRfSkinSet::RetargetSkin | ( | IRdSkinningParameters * | pSkin,
|  | IRdMesh * | pTargetMesh |
| ) |  |  |

Retarget skin from one mesh to another.

- Geometry identification streams are used to perform retargeting.

Remarks:
  NOTE: target reference mesh is kept unchanged.
  - You should set it to desired reference mesh or NULL if you are performing update to clear reference mesh.
  - Reference mesh can be obtained from target mesh by calling GetReferenceMesh.

Parameters:

  | pSkin | [in, out] Skinning parameters to retarget
  | pTargetMesh | [in] New mesh for which skin needs to be calculated (must contain retargetting mesh streams)

HRESULT IRfSkinSet::AccumulateSkinWeights | ( | IRsGenStream * | pStream,
|  | IRdMesh * | pMesh,
|  | RtFloat * | pfWeights |
| ) |  |  |

Add skin weights pfWeights array.

Parameters:

  | pStream | [in, out] Skin stream to modify
  | pMesh | [in] Mesh for which skin weights are provided
  | pfWeights | [] Skin weights to add to pStream

HRESULT IRfSkinSet::GetReferenceMesh | ( | IRdMesh * | pInpMesh,
|  | IRdMesh ** | ppMeshRef |
| ) |  |  |

Get reference mesh for skin used for saving memory because original mesh streams can be edited. Function clones relevant streams which are used for retargetting or skin weights expansion.

- Reference mesh is simplified version of normal mesh:
- Some streams are copied.
- Can be used to retarget weights or stream expansion using ExpandSkinWeights.

Parameters:

  | pInpMesh | [in] Input mesh.
  | ppMeshRef | [out, retval] Reference mesh calculated from input mesh.