CAMorphNode Class Reference

#include <lib_ca.h>

Detailed Description

CAMorphNode class allows to access the actual morph data. For every morph there exist a morph node tree representing the hierarchy of the morphed objects.
Before using any of the access function always check which data exist with GetInfo(). Also make sure the data has been expanded with CAMORPH_MODE_FLAGS::EXPAND in SetMode().
Example of a simple case with one polygon object. In this case just access the first morph node of the morph to be changed.
First exit any editing:

mtag->ExitEdit(doc, true);
const char * doc
Definition: pyerrors.h:226

Get the morph to be changed:

CAMorph* morph = mtag->GetMorph(1);
Definition: lib_ca.h:1429

Now get the morph node. The first will be the object with the morph tag:

CAMorphNode* mnode = morph->GetFirst();
CAMorphNode * GetFirst()
Definition: lib_ca.h:1071

Data must be made editable

Bool SetMode(BaseDocument *doc, CAPoseMorphTag *tag, CAMORPH_MODE_FLAGS flags, CAMORPH_MODE mode)
@ ALL
Expand or collapse all data.
@ EXPAND
Expand data. Needs to be passed before accessing any data.
@ ABS
Absolute morph data.

The point data can now be accessed, but make sure the data exists:

CAMORPH_DATA_FLAGS GetInfo()
@ POINTS
Points morphing.

To access the data use GetPointCount(), SetPointCount(), GetPoint() and SetPoint().
Once finished put the data back to its original form:

@ COLLAPSE
Collapse data. Needs to be passed to collapse the expanded data, for instance after data access.
@ AUTO
Auto mode. Used to collapse the data automatically into their correct mode.

Finally the tag must be updated:

mtag->UpdateMorphs();

Private Member Functions

 CAMorphNode ()
 
 ~CAMorphNode ()
 

Navigation

CAMorphNodeGetNext ()
 
CAMorphNodeGetPrev ()
 
CAMorphNodeGetUp ()
 
CAMorphNodeGetDown ()
 

Get Link

BaseList2DGetLink (CAPoseMorphTag *tag, CAMorph *morph, BaseDocument *doc)
 

Get Info

CAMORPH_DATA_FLAGS GetInfo ()
 

Get/Set Positon/Scale/Rotation

Vector GetP ()
 
Vector GetS ()
 
Vector GetR ()
 
void SetP (const Vector &p)
 
void SetS (const Vector &s)
 
void SetR (const Vector &r)
 

Point

Int32 GetPointCount ()
 
Bool SetPointCount (Int32 cnt)
 
Vector GetPoint (Int32 index)
 
void SetPoint (Int32 index, const Vector &pnt)
 

Tangent

Int32 GetTangentCount ()
 
Bool SetTangentCount (Int32 cnt)
 
Vector GetTangent (Int32 index)
 
void SetTangent (Int32 index, const Vector &v)
 

Vertex Map

Int32 GetVertexMapTagCount ()
 
Int32 GetVertexMapCount (Int32 tindex)
 
Bool SetVertexMapCount (Int32 tindex, Int32 cnt)
 
Float GetVertexMap (Int32 tindex, Int32 index)
 
void SetVertexMap (Int32 tindex, Int32 index, Float v)
 

Parameters

Int32 GetParamCount ()
 
Bool SetParamCount (Int32 cnt)
 
Bool GetParam (Int32 index, GeData &data, DescID &id)
 
void SetParam (Int32 index, const GeData &data, const DescID &id)
 

UV

Int32 GetUVTagCount ()
 
Int32 GetUVCount (Int32 tindex)
 
Bool SetUVCount (Int32 tindex, Int32 cnt)
 
void GetUV (Int32 tindex, Int32 index, UVWStruct &uv)
 
void SetUV (Int32 tindex, Int32 index, const UVWStruct &uv)
 

Weight Map

Int32 GetWeightMapTagCount ()
 
Int32 GetWeightMapJointCount (Int32 tindex)
 
Int32 GetWeightMapCount (Int32 tindex, Int32 jindex)
 
Bool SetWeightMapCount (Int32 tindex, Int32 jindex, Int32 cnt)
 
Float GetWeightMap (Int32 tindex, Int32 jindex, Int32 index)
 
void SetWeightMap (Int32 tindex, Int32 jindex, Int32 index, Float v)
 

PSD Reference

CAReferencePSDGetPSDReference ()
 

Constructor & Destructor Documentation

◆ CAMorphNode()

CAMorphNode ( )
private

◆ ~CAMorphNode()

~CAMorphNode ( )
private

Member Function Documentation

◆ GetNext()

CAMorphNode* GetNext ( )

Retrieves the next morph node.

Returns
The next morph node, or nullptr if there is none. Cinema 4D owns the pointed morph node.

◆ GetPrev()

CAMorphNode* GetPrev ( )

Retrieves the previous morph node.

Returns
The previous morph node, or nullptr if there is none. Cinema 4D owns the pointed morph node.

◆ GetUp()

CAMorphNode* GetUp ( )

Retrieves the parent morph node.

Returns
The parent morph node, or nullptr if there is none. Cinema 4D owns the pointed morph node.

◆ GetDown()

CAMorphNode* GetDown ( )

Retrieves the first child morph node.

Returns
The first child morph node, or nullptr if there is none. Cinema 4D owns the pointed morph node.

◆ GetLink()

BaseList2D* GetLink ( CAPoseMorphTag tag,
CAMorph morph,
BaseDocument doc 
)

Retrieves the object linked to the morph node.

Parameters
[in]tagThe morph tag containing the morph data.
[in]morphThe morph containing the morph node.
[in]docThe document containing the linked object.
Returns
The linked object, or nullptr if there is none. Cinema 4D owns the pointed object.

◆ GetInfo()

CAMORPH_DATA_FLAGS GetInfo ( )

Gets what morph data is stored in the morph node.

Returns
The data flags: CAMORPH_DATA_FLAGS

◆ GetP()

Vector GetP ( )

Retrieves the position of the morph node.

Returns
The position.

◆ GetS()

Vector GetS ( )

Retrieves the scale of the morph node.

Returns
The scale.

◆ GetR()

Vector GetR ( )

Retrieves the HPB rotation of the morph node.

Returns
The HPB rotation.

◆ SetP()

void SetP ( const Vector p)

Sets the position of the morph node.

Parameters
[in]pThe new position.

◆ SetS()

void SetS ( const Vector s)

Sets the scale of the morph node.

Parameters
[in]sThe new scale.

◆ SetR()

void SetR ( const Vector r)

Sets the HPB rotation.

Parameters
[in]rThe new HPB rotation.

◆ GetPointCount()

Int32 GetPointCount ( )

Retrieves the point count of the morph node.

Returns
The point count.

◆ SetPointCount()

Bool SetPointCount ( Int32  cnt)

Sets the point count of the morph node.

Parameters
[in]cntThe new point count.
Returns
true if successful, otherwise false.

◆ GetPoint()

Vector GetPoint ( Int32  index)

Retrieves the point at index.

Parameters
[in]indexThe point index: 0 <= index < GetPointCount()
Returns
The point at index.

◆ SetPoint()

void SetPoint ( Int32  index,
const Vector pnt 
)

Sets the point at index.

Parameters
[in]indexThe point index: 0 <= index < GetPointCount()
[in]pntThe new point coordinate.

◆ GetTangentCount()

Int32 GetTangentCount ( )

Retrieves the tangent count of the morph node.

Returns
The tangent count.

◆ SetTangentCount()

Bool SetTangentCount ( Int32  cnt)

Sets the tangent count of the morph node.

Parameters
[in]cntThe new tangent count.
Returns
true if successful, otherwise false.

◆ GetTangent()

Vector GetTangent ( Int32  index)

Retrieves the tangent at index.

Parameters
[in]indexThe tangent index: 0 <= index < GetTangentCount()
Returns
The tangent at index.

◆ SetTangent()

void SetTangent ( Int32  index,
const Vector v 
)

Sets the tangent at index.

Parameters
[in]indexThe tangent index: 0 <= index < GetPointCount()
[in]vThe new tangent coordinate.

◆ GetVertexMapTagCount()

Int32 GetVertexMapTagCount ( )

Retrieves the number of vertex map tags of the morph node.

Returns
The number of vertex map tags.

◆ GetVertexMapCount()

Int32 GetVertexMapCount ( Int32  tindex)

Retrieves the size of the vertex map at tindex.

Parameters
[in]tindexThe vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
Returns
The size of the vertex map at tindex.

◆ SetVertexMapCount()

Bool SetVertexMapCount ( Int32  tindex,
Int32  cnt 
)

Sets the size of the vertex map at tindex.

Parameters
[in]tindexThe vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
[in]cntThe new size of the vertex map at tindex.
Returns
true if successful, otherwise false.

◆ GetVertexMap()

Float GetVertexMap ( Int32  tindex,
Int32  index 
)

Retrieves the vertex map value at index of the tindex vertex map.

Parameters
[in]tindexThe vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
[in]indexThe vertex map index. 0 <= index < GetVertexMapCount()
Returns
The vertex map value.

◆ SetVertexMap()

void SetVertexMap ( Int32  tindex,
Int32  index,
Float  v 
)

Sets the vertex map value at index of the tindex vertex map.

Parameters
[in]tindexThe vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
[in]indexThe vertex map index. 0 <= index < GetVertexMapCount()
[in]vThe new vertex map value.

◆ GetParamCount()

Int32 GetParamCount ( )

Retrieves the number of parameters for the morph node.

Returns
The number of parameters.

◆ SetParamCount()

Bool SetParamCount ( Int32  cnt)

Sets the number of parameters for the morph node.

Parameters
[in]cntThe new number of parameters.
Returns
true if successful, otherwise false.

◆ GetParam()

Bool GetParam ( Int32  index,
GeData data,
DescID id 
)

Retrieves the parameter at index for the morph node.

Parameters
[in]indexThe parameter index: 0 <= index < GetParamCount()
[out]dataAssigned the parameter value.
[out]idAssigned the description ID of the parameter.
Returns
true if successful, otherwise false.

◆ SetParam()

void SetParam ( Int32  index,
const GeData data,
const DescID id 
)

Sets the parameter at index for the morph node.

Parameters
[in]indexThe parameter index: 0 <= index < GetParamCount()
[in]dataThe new parameter value.
[in]idThe new parameter description ID.

◆ GetUVTagCount()

Int32 GetUVTagCount ( )

Retrieves the number of UV tags.

Returns
The number of UV tags.

◆ GetUVCount()

Int32 GetUVCount ( Int32  tindex)

Retrieves the UV coordinates count of the UV tag at tindex.

Parameters
[in]tindexThe UV tag index: 0 <= tindex < GetUVTagCount()
Returns
The UV coordinates count.

◆ SetUVCount()

Bool SetUVCount ( Int32  tindex,
Int32  cnt 
)

Sets the UV coordinates count of the UV tag at tindex.

Parameters
[in]tindexThe UV tag index: 0 <= tindex < GetUVTagCount()
[in]cntThe new UV coordinates count.
Returns
true if successful, otherwise false.

◆ GetUV()

void GetUV ( Int32  tindex,
Int32  index,
UVWStruct uv 
)

Retrieves the UV coordinate index of the tindex UV tag.

Parameters
[in]tindexThe UV tag index: 0 <= tindex < GetUVTagCount()
[in]indexThe UV coordinates index: 0 <= index < GetUVCount()
[out]uvAssigned the UV coordinates.

◆ SetUV()

void SetUV ( Int32  tindex,
Int32  index,
const UVWStruct uv 
)

Sets the UV coordinate index of the tindex UV tag.

Parameters
[in]tindexThe UV tag index: 0 <= tindex < GetUVTagCount()
[in]indexThe UV coordinates index: 0 <= index < GetUVCount()
[in]uvThe new UV coordinates.

◆ GetWeightMapTagCount()

Int32 GetWeightMapTagCount ( )

Retrieves the number of weight map tags.

Returns
The number of weight map tags.

◆ GetWeightMapJointCount()

Int32 GetWeightMapJointCount ( Int32  tindex)

Retrieves the joint count of the weight tag at tindex.

Parameters
[in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
Returns
The joint count of the specified weight tag.

◆ GetWeightMapCount()

Int32 GetWeightMapCount ( Int32  tindex,
Int32  jindex 
)

Retrieves the weights count of the joint at jindex of tindex weight tag.

Parameters
[in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
[in]jindexThe joint index: 0 <= jindex < GetWeightMapJointCount()
Returns
The weight count of the specified joint.

◆ SetWeightMapCount()

Bool SetWeightMapCount ( Int32  tindex,
Int32  jindex,
Int32  cnt 
)

Sets the weights count of the joint at jindex of tindex weight tag.

Parameters
[in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
[in]jindexThe joint index: 0 <= jindex < GetWeightMapJointCount()
[in]cntThe new weight count.
Returns
true if successful, otherwise false.

◆ GetWeightMap()

Float GetWeightMap ( Int32  tindex,
Int32  jindex,
Int32  index 
)

Retrieves the weight at index of jindex joint and tindex Weight tag.

Parameters
[in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
[in]jindexThe joint index: 0 <= jindex < GetWeightMapJointCount()
[in]indexThe weight index: 0 <= index < GetWeightMapCount()
Returns
The weight.

◆ SetWeightMap()

void SetWeightMap ( Int32  tindex,
Int32  jindex,
Int32  index,
Float  v 
)

Sets the weight at index of jindex joint and tindex Weight tag.

Parameters
[in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
[in]jindexThe joint index: 0 <= jindex < GetWeightMapJointCount()
[in]indexThe weight index: 0 <= index < GetWeightMapCount()
[in]vThe new weight.

◆ GetPSDReference()

CAReferencePSD* GetPSDReference ( )

Retrieves the PSD data for a point pose holding the reference pose and providing multiple functions dedicated to PSD behavior.

Since
R19
Returns
The PSD referential for the morph node. The CAMorphNode owns the pointed CAReferencePSD.