# IRdVertexMorph Interface Reference

Inherits IDispatch.

List of all members.

## Public Member Functions
HRESULT | AddMorph ([in] IRsGenStream *pControlVertexStream,[in] IRsGenStream *pMorphVertexStream,[in] GUID *gMorphId)
HRESULT | RemoveMorph ([in] RtUlong dwIndex)
HRESULT | GetMorphCount ([out, retval] RtUlong *pdwCount)
HRESULT | GetMorphBuffer ([in] RtUlong dwIndex,[out, retval] IRsGenStream **ppVertexStream)
HRESULT | GetControlBuffer ([in] RtUlong dwIndex,[out, retval] IRsGenStream **ppVertexStream)
HRESULT | GetMorphWeight ([in]RtUlong dwIndex,[out, retval] RtFloat *pfWeight)
HRESULT | GetMorphId ([in]RtUlong dwIndex,[out, retval] GUID *pgId)
HRESULT | SetMorphBuffer ([in]RtUlong dwIndex,[in]IRsGenStream *pVertexStream)
HRESULT | SetControlBuffer ([in]RtUlong dwIndex,[in]IRsGenStream *pVertexStream)
HRESULT | SetMorphWeight ([in]RtUlong dwIndex,[in]RtFloat fWeight)
HRESULT | SetActiveMorph ([in] RtUlong dwIndex)
HRESULT | GetActiveMorph ([out, retval] RtUlong *pdwIndex)
HRESULT | SetReferenceMeshes ([in] IRdMesh *pControlMesh,[in] IRdMesh *pMorphMesh)
HRESULT | GetReferenceMeshes ([out] IRdMesh **ppControlMesh,[out] IRdMesh **ppMorphMesh)
HRESULT | SetMorphVertexCount ([in] RtUlong dwVertexCount)
HRESULT | GetMorphVertexCount ([out, retval] RtUlong *pdwVertexCount)
HRESULT | SetControlVertexCount ([in] RtUlong dwVertexCount)
HRESULT | GetControlVertexCount ([out, retval] RtUlong *pdwVertexCount)
## Properties
RtBool | RelativeEditing`[set]`
RtBool * | RelativeEditing`[get]`

## Detailed Description

IRdVertexMorph defines vertex morphing data together with reference meshes that are used for morphs vertex buffers permutations & topology resistance during mesh editing.

Vertex morphs are defined by displacement using IRdVertexStream or IRdVertexMorphStream stream depending on which is smaller.

When entering edit mode, vertex morphers set reference meshes from control cage and morpher's inputs to set vertex buffers to permutation independent state. Upon edit mode exit, morphers can recalculate vertex buffers and remove refernce meshes to save resources.

For reference meshes, only triangles, geometry id triangles and geometry id coordinates are used. To retarget vertex morph from one mesh to another, one lookups for each new vertex using it's geometry coordinates to existing morph buffer and use coordinate information to interpolate vertex position.

## Member Function Documentation

HRESULT IRdVertexMorph::AddMorph | ( | [in] IRsGenStream * | pControlVertexStream,
|  | [in] IRsGenStream * | pMorphVertexStream,
|  | [in] GUID * | gMorphId |
| ) |  |  |

Add new morph to vertex morph buffer.

Parameters:

  | pControlVertexStream | [in] Vertex stream of control mesh.
  | pMorphVertexStream | [in] Vertex stream that represents morph. Morph weight is set to 0 by default.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::RemoveMorph | ( | [in] RtUlong | dwIndex | ) |

Remove morph.

Parameters:

  | dwIndex | [in] Index of morph to remove.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetMorphCount | ( | [out, retval] RtUlong * | pdwCount | ) |

Get number of vertex morphs.

Returns:
  pdwCount [out,retval] Filled with total number of morphs in this buffer.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetMorphBuffer | ( | [in] RtUlong | dwIndex,
|  | [out, retval] IRsGenStream ** | ppVertexStream |
| ) |  |  |

Get morph vertex buffer.

Parameters:

  | dwIndex | [in] Index of vertex morph to retrieve.

Returns:
  ppVertexStream [out, retval] Vertex stream representing the morph.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetControlBuffer | ( | [in] RtUlong | dwIndex,
|  | [out, retval] IRsGenStream ** | ppVertexStream |
| ) |  |  |

Get morph control mesh vertex stream.

Parameters:

  | dwIndex | [in]Index of vertex morph to retrieve.

Returns:
  ppVertexStream [out, retval] Vertex stream representing the morph.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetMorphWeight | ( | [in] RtUlong | dwIndex,
|  | [out, retval] RtFloat * | pfWeight |
| ) |  |  |

Get morph weight.

Parameters:

  | dwIndex | [in]Index of vertex morph to retrieve.

Returns:
  pfWeight [out, retval] Vertex morph blending weight.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetMorphId | ( | [in] RtUlong | dwIndex,
|  | [out, retval] GUID * | pgId |
| ) |  |  |

Get morph Id.

Parameters:

  | dwIndex | [in]Index of vertex morph to retrieve.

Returns:
  pgId [out, retval] Morph guid (connector ID).

  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::SetMorphBuffer | ( | [in] RtUlong | dwIndex,
|  | [in] IRsGenStream * | pVertexStream |
| ) |  |  |

Set morph vertex buffer.

Parameters:

  | dwIndex | [in] Index of vertex morph to retrieve.
  | ppVertexStream | [in] Vertex stream representing the morph.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::SetControlBuffer | ( | [in] RtUlong | dwIndex,
|  | [in] IRsGenStream * | pVertexStream |
| ) |  |  |

Set control vertex buffer.

Parameters:

  | dwIndex | [in] Index of vertex morph to retrieve.
  | ppVertexStream | [in] Vertex stream representing the morph.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::SetMorphWeight | ( | [in] RtUlong | dwIndex,
|  | [in] RtFloat | fWeight |
| ) |  |  |

Set morph weight.

Parameters:

  | dwIndex | [in] Index of vertex morph to retrieve.
  | pfWeight[in] | Vertex morph blending weight.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::SetActiveMorph | ( | [in] RtUlong | dwIndex | ) |

Set active morph.

Parameters:

  | dwIndex | [in] Index of morph to become active. Set -1 to disable active morph. If active morph is enabled, morphing nodes should ignore vertex morphing and use reference mesh as a morph.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetActiveMorph | ( | [out, retval] RtUlong * | pdwIndex | ) |

Get active morph.

Returns:
  pdwIndex [out, retval] Index of morph to become active. -1 means active morph is disabled.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::SetReferenceMeshes | ( | [in] IRdMesh * | pControlMesh,
|  | [in] IRdMesh * | pMorphMesh |
| ) |  |  |

Set morphs reference meshes. Morph reference meshes are used for re-targeting vertex buffers during editing phase.

Parameters:

  | pControlMesh | [in] Control mesh used for vertex buffers indexes permutation.
  | pMorphMesh | [in] Morph morph mesh used for vertex buffers indexes permutation.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetReferenceMeshes | ( | [out] IRdMesh ** | ppControlMesh,
|  | [out] IRdMesh ** | ppMorphMesh |
| ) |  |  |

Get morph reference meshes.

- Morph reference meshes are used for re-targeting vertex buffers during editing phase.
- Reference meshes are READ-ONLY and should never be locked for writing otherwise results are undefined.

Parameters:

  | ppControlMesh | [out] Filled with control mesh used for vertex buffers indexes permutation.
  | ppMorphMesh | [out] Filled with morph mesh used for vertex buffers indexes permutation.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::SetMorphVertexCount | ( | [in] RtUlong | dwVertexCount | ) |

Set number of vertex count for morph buffers.

Parameters:

  | dwMorphVertexCount | [in] Morph morph vertex count.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetMorphVertexCount | ( | [out, retval] RtUlong * | pdwVertexCount | ) |

Get number of vertex count for morph buffers.

Returns:
  dwMorphVertexCount [out, retval] Morph morph vertex count.

  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::SetControlVertexCount | ( | [in] RtUlong | dwVertexCount | ) |

Set number of vertex count for control buffers.

Parameters:

  | dwMorphVertexCount | [in] Morph morph vertex count.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRdVertexMorph::GetControlVertexCount | ( | [out, retval] RtUlong * | pdwVertexCount | ) |

Get number of vertex count for control buffers.

Returns:
  dwMorphVertexCount [out, retval] Morph morph vertex count.

  standard HRESULT processing can be applied to returned value.

## Property Documentation

RtBool IRdVertexMorph::RelativeEditing`[set]`

Set relative/absolute editing mode. In relative mode other morphs are active during editing.

Parameters:

  | bRelative | [in] Set to true to enable relative editing.

Returns:
  standard HRESULT processing can be applied to returned value.

RtBool * IRdVertexMorph::RelativeEditing`[get]`

Get relative/absolute editing mode state.

Returns:
  pbRelative [out, retval] Filled with relative/absolute mode state.

  standard HRESULT processing can be applied to returned value.