CAMorphNode Class Reference Library » Character Animation

#include <lib_ca.h>

详细描述

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 );

Get the morph to be changed:

CAMorph * morph = mtag->GetMorph(1);

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

CAMorphNode * mnode = morph-> GetFirst ();

Data must be made editable

morph-> SetMode (doc, mtag, CAMORPH_MODE_FLAGS::ALL | CAMORPH_MODE_FLAGS::EXPAND , CAMORPH_MODE::ABS );

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

mnode-> GetInfo () & CAMORPH_DATA_FLAGS::POINTS

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

morph-> SetMode (doc, mtag, CAMORPH_MODE_FLAGS::ALL | CAMORPH_MODE_FLAGS::COLLAPSE , CAMORPH_MODE::AUTO );

Finally the tag must be updated:

mtag->UpdateMorphs();

私有成员函数

  CAMorphNode ()
  ~CAMorphNode ()

导航

CAMorphNode GetNext ()
CAMorphNode GetPrev ()
CAMorphNode GetUp ()
CAMorphNode GetDown ()

Get Link

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

Get Info

CAMORPH_DATA_FLAGS   GetInfo ()

Get/Set Positon/Scale/Rotation

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

Point

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

Tangent

Int32   GetTangentCount ()
Bool   SetTangentCount ( Int32 cnt)
向量   GetTangent ( Int32 index)
void  SetTangent ( Int32 index, const 向量 &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)

参数

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

CAReferencePSD GetPSDReference ()

构造函数 & 析构函数文档编制

◆  CAMorphNode()

CAMorphNode () private

◆  ~CAMorphNode()

~ CAMorphNode () private

成员函数文档编制

◆  GetNext()

CAMorphNode * GetNext ( )

Retrieves the next morph node.

返回
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.

返回
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.

返回
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.

返回
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.

参数
[in] tag The morph tag containing the morph data.
[in] morph The morph containing the morph node.
[in] doc The document containing the linked object.
返回
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.

返回
The data flags: CAMORPH_DATA_FLAGS

◆  GetP()

向量 GetP ( )

Retrieves the position of the morph node.

返回
The position.

◆  GetS()

向量 GetS ( )

Retrieves the scale of the morph node.

返回
The scale.

◆  GetR()

向量 GetR ( )

Retrieves the HPB rotation of the morph node.

返回
The HPB rotation.

◆  SetP()

void SetP ( const 向量 p )

Sets the position of the morph node.

参数
[in] p The new position.

◆  SetS()

void SetS ( const 向量 s )

Sets the scale of the morph node.

参数
[in] s The new scale.

◆  SetR()

void SetR ( const 向量 r )

Sets the HPB rotation.

参数
[in] r The new HPB rotation.

◆  GetPointCount()

Int32 GetPointCount ( )

Retrieves the point count of the morph node.

返回
The point count.

◆  SetPointCount()

Bool SetPointCount ( Int32   cnt )

Sets the point count of the morph node.

参数
[in] cnt The new point count.
返回
true if successful, otherwise false .

◆  GetPoint()

向量 GetPoint ( Int32   index )

Retrieves the point at index .

参数
[in] index The point index: 0 <= index < GetPointCount()
返回
The point at index .

◆  SetPoint()

void SetPoint ( Int32   index ,
const 向量 pnt  
)

Sets the point at index .

参数
[in] index The point index: 0 <= index < GetPointCount()
[in] pnt The new point coordinate.

◆  GetTangentCount()

Int32 GetTangentCount ( )

Retrieves the tangent count of the morph node.

返回
The tangent count.

◆  SetTangentCount()

Bool SetTangentCount ( Int32   cnt )

Sets the tangent count of the morph node.

参数
[in] cnt The new tangent count.
返回
true if successful, otherwise false .

◆  GetTangent()

向量 GetTangent ( Int32   index )

Retrieves the tangent at index .

参数
[in] index The tangent index: 0 <= index < GetTangentCount()
返回
The tangent at index .

◆  SetTangent()

void SetTangent ( Int32   index ,
const 向量 v  
)

Sets the tangent at index .

参数
[in] index The tangent index: 0 <= index < GetPointCount()
[in] v The new tangent coordinate.

◆  GetVertexMapTagCount()

Int32 GetVertexMapTagCount ( )

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

返回
The number of vertex map tags.

◆  GetVertexMapCount()

Int32 GetVertexMapCount ( Int32   tindex )

Retrieves the size of the vertex map at tindex .

参数
[in] tindex The vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
返回
The size of the vertex map at tindex .

◆  SetVertexMapCount()

Bool SetVertexMapCount ( Int32   tindex ,
Int32   cnt  
)

Sets the size of the vertex map at tindex .

参数
[in] tindex The vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
[in] cnt The new size of the vertex map at tindex .
返回
true if successful, otherwise false .

◆  GetVertexMap()

Float GetVertexMap ( Int32   tindex ,
Int32   index  
)

Retrieves the vertex map value at index tindex vertex map.

参数
[in] tindex The vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
[in] index The vertex map index. 0 <= index < GetVertexMapCount()
返回
The vertex map value.

◆  SetVertexMap()

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

Sets the vertex map value at index tindex vertex map.

参数
[in] tindex The vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
[in] index The vertex map index. 0 <= index < GetVertexMapCount()
[in] v The new vertex map value.

◆  GetParamCount()

Int32 GetParamCount ( )

Retrieves the number of parameters for the morph node.

返回
The number of parameters.

◆  SetParamCount()

Bool SetParamCount ( Int32   cnt )

Sets the number of parameters for the morph node.

参数
[in] cnt The new number of parameters.
返回
true if successful, otherwise false .

◆  GetParam()

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

Retrieves the parameter at index for the morph node.

参数
[in] index The parameter index: 0 <= index < GetParamCount()
[out] data Assigned the parameter value.
[out] id Assigned the description ID of the parameter.
返回
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.

参数
[in] index The parameter index: 0 <= index < GetParamCount()
[in] data The new parameter value.
[in] id The new parameter description ID.

◆  GetUVTagCount()

Int32 GetUVTagCount ( )

Retrieves the number of UV tags.

返回
The number of UV tags.

◆  GetUVCount()

Int32 GetUVCount ( Int32   tindex )

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

参数
[in] tindex The UV tag index: 0 <= tindex < GetUVTagCount()
返回
The UV coordinates count.

◆  SetUVCount()

Bool SetUVCount ( Int32   tindex ,
Int32   cnt  
)

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

参数
[in] tindex The UV tag index: 0 <= tindex < GetUVTagCount()
[in] cnt The new UV coordinates count.
返回
true if successful, otherwise false .

◆  GetUV()

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

Retrieves the UV coordinate index tindex UV tag.

参数
[in] tindex The UV tag index: 0 <= tindex < GetUVTagCount()
[in] index The UV coordinates index: 0 <= index < GetUVCount()
[out] uv Assigned the UV coordinates.

◆  SetUV()

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

Sets the UV coordinate index tindex UV tag.

参数
[in] tindex The UV tag index: 0 <= tindex < GetUVTagCount()
[in] index The UV coordinates index: 0 <= index < GetUVCount()
[in] uv The new UV coordinates.

◆  GetWeightMapTagCount()

Int32 GetWeightMapTagCount ( )

Retrieves the number of weight map tags.

返回
The number of weight map tags.

◆  GetWeightMapJointCount()

Int32 GetWeightMapJointCount ( Int32   tindex )

Retrieves the joint count of the weight tag at tindex .

参数
[in] tindex The weight tag index: 0 <= tindex < GetWeightMapTagCount()
返回
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.

参数
[in] tindex The weight tag index: 0 <= tindex < GetWeightMapTagCount()
[in] jindex The joint index: 0 <= jindex < GetWeightMapJointCount()
返回
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.

参数
[in] tindex The weight tag index: 0 <= tindex < GetWeightMapTagCount()
[in] jindex The joint index: 0 <= jindex < GetWeightMapJointCount()
[in] cnt The new weight count.
返回
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.

参数
[in] tindex The weight tag index: 0 <= tindex < GetWeightMapTagCount()
[in] jindex The joint index: 0 <= jindex < GetWeightMapJointCount()
[in] index The weight index: 0 <= index < GetWeightMapCount()
返回
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.

参数
[in] tindex The weight tag index: 0 <= tindex < GetWeightMapTagCount()
[in] jindex The joint index: 0 <= jindex < GetWeightMapJointCount()
[in] index The weight index: 0 <= index < GetWeightMapCount()
[in] v The 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.

由于
R19
返回
The PSD referential for the morph node. The CAMorphNode owns the pointed CAReferencePSD .
CAMorph::GetFirst
CAMorphNode * GetFirst()
CAMORPH_MODE::AUTO
@ AUTO
Auto mode. Used to collapse the data automatically into their correct mode.
CAMorph::SetMode
Bool SetMode(BaseDocument *doc, CAPoseMorphTag *tag, CAMORPH_MODE_FLAGS flags, CAMORPH_MODE mode)
CAMORPH_DATA_FLAGS::POINTS
@ POINTS
Points morphing.
CAMorph
定义: lib_ca.h:1428
CAMorphNode::GetInfo
CAMORPH_DATA_FLAGS GetInfo()
CAMorphNode
定义: lib_ca.h:1070
CAMORPH_MODE_FLAGS::ALL
@ ALL
Expand or collapse all data.
CAMORPH_MODE::ABS
@ ABS
Absolute morph data.
CAMORPH_MODE_FLAGS::EXPAND
@ EXPAND
Expand data. Needs to be passed before accessing any data.
CAMORPH_MODE_FLAGS::COLLAPSE
@ COLLAPSE
Collapse data. Needs to be passed to collapse the expanded data, for instance after data access.