CAMorph Class Reference Library » Character Animation

#include <lib_ca.h>

详细描述

CAMorph class contains the data for each morph. It has to be retrieved from the CAPoseMorphTag .

另请参阅
CAMorphNode for an example.

公共成员函数

Bool   IsPostDeform ()

私有成员函数

  CAMorph ()
  ~CAMorph ()

名称

String   GetName ()
void  SetName (const String &name)

杂项

Int32   GetID ()
Bool   CopyFrom ( CAMorph *src, AliasTrans *trn, CAMORPH_COPY_FLAGS flags)

Morph Node

CAMorphNode Find ( CAPoseMorphTag *tag, BaseList2D *bl)
Int32   GetNodeIndex ( CAMorphNode *node)
Int32   FindIndex ( CAPoseMorphTag *tag, BaseList2D *bl)
CAMorphNode FindFromIndex ( CAPoseMorphTag *tag, Int32 index)
CAMorphNode GetFirst ()

Morph

Bool   SetMode ( BaseDocument *doc, CAPoseMorphTag *tag, CAMORPH_MODE_FLAGS flags, CAMORPH_MODE mode)
Bool   Store ( BaseDocument *doc, CAPoseMorphTag *tag, CAMORPH_DATA_FLAGS flags)
Bool   应用 ( BaseDocument *doc, CAPoseMorphTag *tag, CAMORPH_DATA_FLAGS flags)

目标

BaseList2D GetTarget ( BaseDocument *doc)
void  SetTarget ( CAPoseMorphTag *tag, BaseDocument *doc, BaseList2D *bl)

强度

void  SetStrength ( Float strength)
Float   GetStrength ()

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

◆  CAMorph()

CAMorph () private

◆  ~CAMorph()

~ CAMorph () private

成员函数文档编制

◆  GetName()

String GetName ( )

Retrieves the name of the morph.

返回
The name of the morph.

◆  SetName()

void SetName ( const String name )

Sets the name of the morph.

参数
[in] name The new name of the morph.

◆  GetID()

Int32 GetID ( )

Retrieves the internal ID of the morph. Each morph has an ID. This ensures that removed morphs do not affect the DescID for the sliders.

返回
The internal ID of the morph.

◆  CopyFrom()

Bool CopyFrom ( CAMorph src ,
AliasTrans trn ,
CAMORPH_COPY_FLAGS   flags  
)

Copies morph data from src .

参数
[in] src The source morph.
[in] trn An alias translator for the operation. Can be nullptr . The caller owns the pointed alias translator.
[in] flags The flags: CAMORPH_COPY_FLAGS
返回
true if successful, otherwise false .

◆  Find()

CAMorphNode * Find ( CAPoseMorphTag tag ,
BaseList2D bl  
)

Retrieves the morph node for the object specified by bl .

注意
A single morph can be applied to a hierarchy of objects, each has a representation in the morph as a CAMorphNode .
参数
[in] tag The morph tag containing the morph node.
[in] bl The object connected to the morph node.
返回
The morph node for the specified object. The tag owns the pointed morph node.

◆  GetNodeIndex()

Int32 GetNodeIndex ( CAMorphNode node )

Retrieves the index of the specified morph node. Each morph node can be accessed through their indices.

参数
[in] node The morph node to request the index.
返回
The morph node index.

◆  FindIndex()

Int32 FindIndex ( CAPoseMorphTag tag ,
BaseList2D bl  
)

Retrieves the index of the morph node for the object specified by bl .

注意
A single morph can be applied to a hierarchy of objects, each has a representation in the morph as a CAMorphNode .
参数
[in] tag The morph tag containing the morph node.
[in] bl The object connected to the morph node.
返回
The index of the morph node of the specified object.

◆  FindFromIndex()

CAMorphNode * FindFromIndex ( CAPoseMorphTag tag ,
Int32   index  
)

Retrieves the morph node specified by index .

注意
A single morph can be applied to a hierarchy of objects, each has a representation in the morph as a CAMorphNode .
参数
[in] tag The morph tag containing the morph node.
[in] index The index of the requested morph node.
返回
The found morph node. The tag owns the pointed morph node.

◆  GetFirst()

CAMorphNode * GetFirst ( )

Retrieves the first node of the morph.

返回
The first morph node. The tag owns the pointed morph node.

◆  SetMode()

Bool SetMode ( BaseDocument doc ,
CAPoseMorphTag tag ,
CAMORPH_MODE_FLAGS   flags ,
CAMORPH_MODE   mode  
)

Changes the morph's mode.

注意
This is not the mode a user would change but data inside the morph. It must be restored to the original mode once changes are finished.
To change the morph tag's modes or parameters use C4DAtom::SetParameter() .

范例: Point data could be stored as rotational or correctional and in a delta form (only differences from the base).
This can not be edited in this form so the data mode must be changed to relative ( CAMORPH_MODE::REL ) or absolute ( CAMORPH_MODE::ABS ) before editing and then restored to ( CAMORPH_MODE::AUTO ) when finished.
The flags must be passed as CAMORPH_MODE_FLAGS::EXPAND to expand the data from the delta form and then returned with CAMORPH_MODE_FLAGS::COLLAPSE when finished.
For example VAMP uses the following line to expand all data types to relative data:

smorph->SetMode(doc, data.s_morphtag, CAMORPH_MODE_FLAGS::ALL | CAMORPH_MODE_FLAGS::EXPAND , CAMORPH_MODE::REL );

It then does some changes and finally restores all types to collapsed (delta) form and to the users mode (AUTO):

data.sources[i]->SetMode(doc, data.s_morphtag, CAMORPH_MODE_FLAGS::ALL | CAMORPH_MODE_FLAGS::COLLAPSE , CAMORPH_MODE::AUTO );
参数
[in] doc The document containing the morph tag.
[in] tag The morph tag containing the morph data.
[in] flags The flags: CAMORPH_MODE_FLAGS
[in] mode The mode: CAMORPH_MODE
返回
true if successful, otherwise false .

◆  Store()

Bool Store ( BaseDocument doc ,
CAPoseMorphTag tag ,
CAMORPH_DATA_FLAGS   flags  
)

Stores the current object's state into the morph.
The corresponding flags have to be set for the data. This should normally be CAMORPH_DATA_FLAGS::ASTAG if it is to be used by the user.

参数
[in] doc The document containing the morph tag.
[in] tag The morph tag containing the morph data.
[in] flags The flags: CAMORPH_DATA_FLAGS
返回
true if successful, otherwise false .

◆  Apply()

Bool 应用 ( BaseDocument doc ,
CAPoseMorphTag tag ,
CAMORPH_DATA_FLAGS   flags  
)

Applies the morph to the object. The data to be applied is set with the flags .

参数
[in] doc The document containing the morph tag.
[in] tag The morph tag containing the morph data.
[in] flags The flags: CAMORPH_DATA_FLAGS
返回
true if successful, otherwise false .

◆  GetTarget()

BaseList2D * GetTarget ( BaseDocument doc )

Retrieves the target of the morph.

参数
[in] doc The document containing the morph tag.
返回
The target of the morph. The tag owns the pointed object.

◆  SetTarget()

void SetTarget ( CAPoseMorphTag tag ,
BaseDocument doc ,
BaseList2D bl  
)

Sets the target of the morph.

参数
[in] tag The morph tag containing the morph node.
[in] doc The document containing the morph tag.
[in] bl The new target of the morph.

◆  SetStrength()

void SetStrength ( Float   strength )

Sets the strength of the morph.

参数
[in] strength The new strength of the morph.

◆  GetStrength()

Float GetStrength ( )

Retrieves the strength of the morph.

返回
The strength of the morph.

◆  IsPostDeform()

Bool IsPostDeform ( )

Retrieves if the morph is applied at PostDeform.

返回
Morph is post-deform mode.
CAMORPH_MODE::AUTO
@ AUTO
Auto mode. Used to collapse the data automatically into their correct mode.
CAMORPH_MODE::REL
@ REL
Relative morph data.
CAMORPH_MODE_FLAGS::ALL
@ ALL
Expand or collapse all 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.