About
A CAMorphNode object stores the actual morph data for a corresponding BaseList2D object. It is stored in a CAPoseMorphTag, see CAPoseMorphTag Manual. The class is defined in the lib_ca.h
header file.
Access
A CAMorphNode object is obtained from the host CAMorph. See CAMorph Manual.
poseMorphTag->ExitEdit(
doc,
false);
const Int32 activeIndex = poseMorphTag->GetActiveMorphIndex();
CAMorph* const morph = poseMorphTag->GetMorph(activeIndex);
if (morph == nullptr)
CAMorphNode* const mnode = morph->GetFirst();
if (mnode == nullptr)
{
const Int32 pointCount = mnode->GetPointCount();
{
const Vector point = mnode->GetPoint(
i);
}
}
poseMorphTag->UpdateMorphs();
Py_ssize_t i
Definition: abstract.h:645
ALL
Filter for all types.
Definition: asset_browser.h:0
CAMORPH_MODE_FLAGS
Definition: lib_ca.h:849
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
#define ApplicationOutput(formatString,...)
Definition: debugdiagnostics.h:204
AUTO
Definition: lib_birender.h:1
POINTS
Points morphing.
Definition: lib_ca.h:3
EXPAND
Expand data. Needs to be passed before accessing any data.
Definition: lib_ca.h:1
ABS
Absolute morph data.
Definition: lib_ca.h:0
COLLAPSE
Collapse data. Needs to be passed to collapse the expanded data, for instance after data access.
Definition: lib_ca.h:0
maxon::Int32 Int32
Definition: ge_sys_math.h:51
maxon::Vec3< maxon::Float64, 1 > Vector
Definition: ge_math.h:140
const char * doc
Definition: pyerrors.h:226
Navigation
A CAMorphNode stores the data of the corresponding BaseList2D object. In "Hierarchy" mode of the host CAPoseMorphTag a CAMorph stores multiple CAMorphNode objects for all corresponding objects in the object tree.
- CAMorphNode::GetNext(): Returns the next CAMorphNode.
- CAMorphNode::GetPrev(): Returns the previous CAMorphNode.
- CAMorphNode::GetUp(): Returns the parent CAMorphNode.
- CAMorphNode::GetDown(): Returns the child CAMorphNode.
static void CheckMorphNode(CAMorphNode* mnode, CAPoseMorphTag* tag, CAMorph* morph, BaseDocument*
doc)
{
while (mnode != nullptr)
{
BaseList2D*
const link = mnode->GetLink(tag, morph,
doc);
if (link != nullptr)
{
}
CheckMorphNode(mnode->GetDown(), tag, morph,
doc);
mnode = mnode->GetNext();
}
}
Data
Info
A CAMorphNode stores morph data of a corresponding BaseList2D object.
- CAMorphNode::GetLink(): Returns the corresponding BaseList2D object.
- CAMorphNode::GetInfo(): Returns the data stored. See CAMORPH_DATA_FLAGS and Object.
PSR
A CAMorphNode object can store PSR data:
- CAMorphNode::GetP(): Returns the stored position.
- CAMorphNode::SetP(): Sets the stored position.
- CAMorphNode::GetS(): Returns the stored scale.
- CAMorphNode::SetS(): Sets the stored scale.
- CAMorphNode::GetR(): Returns the stored rotation.
- CAMorphNode::SetR(): Sets the stored rotation.
{
const Vector position = mnode->GetP();
}
P
Position morphing.
Definition: lib_ca.h:0
Points
A CAMorphNode object can store point data:
- CAMorphNode::GetPointCount(): Returns the number of stored point coordinates.
- CAMorphNode::SetPointCount(): Sets the number of stored point coordinates.
- CAMorphNode::GetPoint(): Returns the points coordinates for the given index.
- CAMorphNode::SetPoint(): Sets the point coordinates for the given index.
{
Random random;
const Int32 pointCount = mnode->GetPointCount();
{
point.
x += random.Get01() * 10.0;
point.y += random.Get01() * 10.0;
point.z += random.Get01() * 10.0;
mnode->SetPoint(
i, point);
}
}
For point mode additional Pose Space Deformation data is stored:
- CAMorphNode::GetPSDReference(): Returns the CAReferencePSD object.
See CAReferencePSD Manual.
{
CAReferencePSD* const psd = mnode->GetPSDReference();
if (psd)
{
const Int32 controllerCount = psd->GetExternalControllerCount();
for (
Int32 controllerIndex = 0; controllerIndex < controllerCount; ++controllerIndex)
{
BaseObject* const controller = psd->GetExternalController(controllerIndex);
if (controller == nullptr)
}
}
}
Tangents
A CAMorphNode object can store tangent data for spline points:
- CAMorphNode::GetTangentCount(): Returns the number of stored tangent vectors.
- CAMorphNode::SetTangentCount(): Sets the number of stored tangent vectors.
- CAMorphNode::GetTangent(): Returns the tangent vector for the given index.
- CAMorphNode::SetTangent(): Sets the tangent vector for the given index.
- Note
- For each spline point two tangent vectors are stored.
{
const Int32 tangentCount = mnode->GetTangentCount();
for (
Int32 i = 0;
i < tangentCount; ++
i)
{
const Vector tangent = mnode->GetTangent(
i);
}
}
TANGENTS
Tangents morphing.
Definition: lib_ca.h:4
Vertex Map
A CAMorphNode object can store vertex map data for all vertex map tags of the host object.
- CAMorphNode::GetVertexMapTagCount(): Returns the number of vertex map tags.
- CAMorphNode::GetVertexMapCount(): Returns the number of weights stored for the given vertex map tag.
- CAMorphNode::SetVertexMapCount(): Sets the number of weights stored for the given vertex map tag.
- CAMorphNode::GetVertexMap(): Returns the weight value for the given index and weight tag index.
- CAMorphNode::SetVertexMap(): Sets the weight value for the given index and weight tag index.
{
const Int32 vertexMapCount = mnode->GetVertexMapTagCount();
for (
Int32 tagIndex = 0; tagIndex < vertexMapCount; ++tagIndex)
{
const Int32 vertexCount = mnode->GetVertexMapCount(tagIndex);
for (
Int32 vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex)
{
const Float weight = mnode->GetVertexMap(tagIndex, vertexIndex);
}
}
}
VERTEXMAPS
Vertex map morphing.
Definition: lib_ca.h:5
maxon::Float Float
Definition: ge_sys_math.h:57
Parameters
A CAMorphNode object can store data for various object parameters.
- CAMorphNode::GetParamCount(): Returns the number of stored parameters.
- CAMorphNode::SetParamCount(): Sets the number of stored parameters.
- CAMorphNode::GetParam(): Gets the data and DescID of the parameter with the given index.
- CAMorphNode::SetParam(): Sets the data and DescID of the parameter with the given index.
UV Sets
A CAMorphNode object can store UVW data for all UVW tags of the host object. See also UVWTag Manual.
- CAMorphNode::GetUVTagCount(): Returns the number of UVW tags.
- CAMorphNode::GetUVCount(): Returns the number of UVW polygons stored for the given tag index.
- CAMorphNode::SetUVCount(): Sets the number of UVW polygons stored for the given tag index.
- CAMorphNode::GetUV(): Returns the UVW polygon for the given index and tag index.
- CAMorphNode::SetUV(): Sets the UVW polygon for the given index and tag index.
{
const Int32 uvTagCount = mnode->GetUVTagCount();
for (
Int32 tagIndex = 0; tagIndex < uvTagCount; ++tagIndex)
{
const Int32 uvCount = mnode->GetUVCount(tagIndex);
for (
Int32 uvIndex = 0; uvIndex < uvCount; ++uvIndex)
{
UVWStruct uvw;
mnode->GetUV(tagIndex, uvIndex, uvw);
}
}
}
UV
UV Options.
Definition: lib_activeobjectmanager.h:18
Weight Maps
A CAMorphNode object can store weight data for all weight tags of the host object. See also CAWeightTag Manual.
- CAMorphNode::GetWeightMapTagCount(): Returns the number of weight tags.
- CAMorphNode::GetWeightMapJointCount(): Returns the number of joints handled in weight tag of the given index.
- CAMorphNode::GetWeightMapCount(): Returns the number of weights stored for the given joint and tag index.
- CAMorphNode::SetWeightMapCount(): Sets the number of weights stored for the given joint and tag index.
- CAMorphNode::GetWeightMap(): Returns the weight value for the given index, joint and tag.
- CAMorphNode::SetWeightMap(): Sets the weight value for the given index, joint and tag.
{
const Int32 weightTagCount = mnode->GetWeightMapTagCount();
for (
Int32 tagIndex = 0; tagIndex < weightTagCount; ++tagIndex)
{
const Int32 jointCount = mnode->GetWeightMapJointCount(tagIndex);
for (
Int32 jointIndex = 0; jointIndex < jointCount; ++jointIndex)
{
const Int32 weightCount = mnode->GetWeightMapCount(tagIndex, jointIndex);
for (
Int32 weightIndex = 0; weightIndex < weightCount; ++weightIndex)
{
const Float weight = mnode->GetWeightMap(tagIndex, jointIndex, weightIndex);
}
}
}
}
WEIGHTMAPS
Joint weights morphing.
Definition: lib_ca.h:6
Further Reading