#include <lib_ca.h>
CAMorph class contains the data for each morph. It has to be retrieved from the CAPoseMorphTag.
- See also
- CAMorphNode for an example.
◆ CAMorph()
◆ ~CAMorph()
◆ GetName()
Retrieves the name of the morph.
- Returns
- The name of the morph.
◆ SetName()
void SetName |
( |
const String & |
name | ) |
|
Sets the name of the morph.
- Parameters
-
[in] | name | The new name of the morph. |
◆ 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.
- Returns
- The internal ID of the morph.
◆ CopyFrom()
Copies morph data from src.
- Parameters
-
[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 |
- Returns
- true if successful, otherwise false.
◆ Find()
Retrieves the morph node for the object specified by bl.
- Note
- A single morph can be applied to a hierarchy of objects, each has a representation in the morph as a CAMorphNode.
- Parameters
-
[in] | tag | The morph tag containing the morph node. |
[in] | bl | The object connected to the morph node. |
- Returns
- The morph node for the specified object. The tag owns the pointed morph node.
◆ GetNodeIndex()
Retrieves the index of the specified morph node. Each morph node can be accessed through their indices.
- Parameters
-
[in] | node | The morph node to request the index. |
- Returns
- The morph node index.
◆ FindIndex()
Retrieves the index of the morph node for the object specified by bl.
- Note
- A single morph can be applied to a hierarchy of objects, each has a representation in the morph as a CAMorphNode.
- Parameters
-
[in] | tag | The morph tag containing the morph node. |
[in] | bl | The object connected to the morph node. |
- Returns
- The index of the morph node of the specified object.
◆ FindFromIndex()
Retrieves the morph node specified by index.
- Note
- A single morph can be applied to a hierarchy of objects, each has a representation in the morph as a CAMorphNode.
- Parameters
-
[in] | tag | The morph tag containing the morph node. |
[in] | index | The index of the requested morph node. |
- Returns
- The found morph node. The tag owns the pointed morph node.
◆ GetFirst()
Retrieves the first node of the morph.
- Returns
- The first morph node. The tag owns the pointed morph node.
◆ SetMode()
Changes the morph's mode.
- Note
- 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().
Example: 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:
@ ALL
Expand or collapse all data.
@ EXPAND
Expand data. Needs to be passed before accessing any data.
@ REL
Relative morph data.
const char * doc
Definition: pyerrors.h:226
It then does some changes and finally restores all types to collapsed (delta) form and to the users mode (AUTO):
Py_ssize_t i
Definition: abstract.h:645
@ 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.
- Parameters
-
[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 |
- Returns
- true if successful, otherwise false.
◆ Store()
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.
- Parameters
-
[in] | doc | The document containing the morph tag. |
[in] | tag | The morph tag containing the morph data. |
[in] | flags | The flags: CAMORPH_DATA_FLAGS |
- Returns
- true if successful, otherwise false.
◆ Apply()
Applies the morph to the object. The data to be applied is set with the flags.
- Parameters
-
[in] | doc | The document containing the morph tag. |
[in] | tag | The morph tag containing the morph data. |
[in] | flags | The flags: CAMORPH_DATA_FLAGS |
- Returns
- true if successful, otherwise false.
◆ GetTarget()
Retrieves the target of the morph.
- Parameters
-
[in] | doc | The document containing the morph tag. |
- Returns
- The target of the morph. The tag owns the pointed object.
◆ SetTarget()
Sets the target of the morph.
- Parameters
-
[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.
- Parameters
-
[in] | strength | The new strength of the morph. |
◆ GetStrength()
Retrieves the strength of the morph.
- Returns
- The strength of the morph.
◆ IsPostDeform()
Retrieves if the morph is applied at PostDeform.
- Returns
- Morph is post-deform mode.