-
首页
-
C4D R23.110 C++ SDK
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()
成员函数文档编制
◆
GetNext()
Retrieves the next morph node.
-
返回
-
The next morph node, or
nullptr
if there is none.
Cinema 4D
owns the pointed morph node.
◆
GetPrev()
Retrieves the previous morph node.
-
返回
-
The previous morph node, or
nullptr
if there is none.
Cinema 4D
owns the pointed morph node.
◆
GetUp()
Retrieves the parent morph node.
-
返回
-
The parent morph node, or
nullptr
if there is none.
Cinema 4D
owns the pointed morph node.
◆
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()
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()
Gets what morph data is stored in the morph node.
-
返回
-
The data flags:
CAMORPH_DATA_FLAGS
◆
GetP()
Retrieves the position of the morph node.
-
返回
-
The position.
◆
GetS()
Retrieves the scale of the morph node.
-
返回
-
The scale.
◆
GetR()
Retrieves the HPB rotation of the morph node.
-
返回
-
The HPB rotation.
◆
SetP()
void SetP
|
(
|
const
向量
&
|
p
|
)
|
|
Sets the position of the morph node.
-
参数
-
◆
SetS()
void SetS
|
(
|
const
向量
&
|
s
|
)
|
|
Sets the scale of the morph node.
-
参数
-
◆
SetR()
void SetR
|
(
|
const
向量
&
|
r
|
)
|
|
Sets the HPB rotation.
-
参数
-
[in]
|
r
|
The new HPB rotation.
|
◆
GetPointCount()
Retrieves the point count of the morph node.
-
返回
-
The point count.
◆
SetPointCount()
Sets the point count of the morph node.
-
参数
-
[in]
|
cnt
|
The new point count.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetPoint()
Retrieves the point at
index
.
-
参数
-
-
返回
-
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()
Sets the tangent count of the morph node.
-
参数
-
[in]
|
cnt
|
The new tangent count.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetTangent()
Retrieves the tangent at
index
.
-
参数
-
-
返回
-
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()
Retrieves the size of the vertex map at
tindex
.
-
参数
-
-
返回
-
The size of the vertex map at
tindex
.
◆
SetVertexMapCount()
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()
Retrieves the vertex map value at
index
的
tindex
vertex map.
-
参数
-
-
返回
-
The vertex map value.
◆
SetVertexMap()
Sets the vertex map value at
index
的
tindex
vertex map.
-
参数
-
◆
GetParamCount()
Retrieves the number of parameters for the morph node.
-
返回
-
The number of parameters.
◆
SetParamCount()
Sets the number of parameters for the morph node.
-
参数
-
[in]
|
cnt
|
The new number of parameters.
|
-
返回
-
true
if successful, otherwise
false
.
◆
GetParam()
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()
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()
Retrieves the number of UV tags.
-
返回
-
The number of UV tags.
◆
GetUVCount()
Retrieves the UV coordinates count of the UV tag at
tindex
.
-
参数
-
-
返回
-
The UV coordinates count.
◆
SetUVCount()
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()
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()
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()
Retrieves the joint count of the weight tag at
tindex
.
-
参数
-
-
返回
-
The joint count of the specified weight tag.
◆
GetWeightMapCount()
Retrieves the weights count of the joint at
jindex
of
tindex
weight tag.
-
参数
-
-
返回
-
The weight count of the specified joint.
◆
SetWeightMapCount()
Sets the weights count of the joint at
jindex
of
tindex
weight tag.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
GetWeightMap()
Retrieves the weight at
index
of
jindex
joint and
tindex
Weight tag.
-
参数
-
-
返回
-
The weight.
◆
SetWeightMap()
Sets the weight at
index
of
jindex
joint and
tindex
Weight tag.
-
参数
-
◆
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
.
@ AUTO
Auto mode. Used to collapse the data automatically into their correct mode.
Bool SetMode(BaseDocument *doc, CAPoseMorphTag *tag, CAMORPH_MODE_FLAGS flags, CAMORPH_MODE mode)
@ POINTS
Points morphing.
CAMORPH_DATA_FLAGS GetInfo()
@ ALL
Expand or collapse all data.
@ ABS
Absolute morph data.
@ EXPAND
Expand data. Needs to be passed before accessing any data.
@ COLLAPSE
Collapse data. Needs to be passed to collapse the expanded data, for instance after data access.