Open Search
    CAMorphNode Class Reference

    #include <lib_ca.h>

    Detailed Description

    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);
    const char * doc
    Definition: pyerrors.h:226

    Get the morph to be changed:

    CAMorph* morph = mtag->GetMorph(1);
    Definition: lib_ca.h:1475

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

    CAMorphNode* mnode = morph->GetFirst();
    CAMorphNode * GetFirst()
    Definition: lib_ca.h:1072

    Data must be made editable

    Bool SetMode(BaseDocument *doc, CAPoseMorphTag *tag, CAMORPH_MODE_FLAGS flags, CAMORPH_MODE mode)
    @ ALL
    Expand or collapse all data.
    @ EXPAND
    Expand data. Needs to be passed before accessing any data.
    @ ABS
    Absolute morph data.

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

    CAMORPH_DATA_FLAGS GetInfo() const
    @ POINTS
    Points morphing.

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

    @ 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.

    Finally the tag must be updated:

    mtag->UpdateMorphs();

    Private Member Functions

     CAMorphNode ()
     
     ~CAMorphNode ()
     

    Navigation

    CAMorphNodeGetNext ()
     
    CAMorphNodeGetPrev ()
     
    CAMorphNodeGetUp ()
     
    CAMorphNodeGetDown ()
     

    Get Link

    const BaseList2DGetLink (const CAPoseMorphTag *tag, const CAMorph *morph, const BaseDocument *doc) const
     
    BaseList2DGetLink (CAPoseMorphTag *tag, CAMorph *morph, BaseDocument *doc)
     

    Get Info

    CAMORPH_DATA_FLAGS GetInfo () const
     

    Get/Set Positon/Scale/Rotation

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

    Point

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

    Tangent

    Int32 GetTangentCount () const
     
    Bool SetTangentCount (Int32 cnt)
     
    Vector GetTangent (Int32 index) const
     
    void SetTangent (Int32 index, const Vector &v)
     

    Vertex Map

    Int32 GetVertexMapTagCount () const
     
    Int32 GetVertexMapCount (Int32 tindex) const
     
    Bool SetVertexMapCount (Int32 tindex, Int32 cnt)
     
    Float GetVertexMap (Int32 tindex, Int32 index) const
     
    void SetVertexMap (Int32 tindex, Int32 index, Float v)
     

    Parameters

    Int32 GetParamCount () const
     
    Bool SetParamCount (Int32 cnt)
     
    Bool GetParam (Int32 index, GeData &data, DescID &id) const
     
    void SetParam (Int32 index, const GeData &data, const DescID &id)
     

    UV

    Int32 GetUVTagCount () const
     
    Int32 GetUVCount (Int32 tindex) const
     
    Bool SetUVCount (Int32 tindex, Int32 cnt)
     
    void GetUV (Int32 tindex, Int32 index, UVWStruct &uv) const
     
    void SetUV (Int32 tindex, Int32 index, const UVWStruct &uv)
     

    Weight Map

    Int32 GetWeightMapTagCount () const
     
    Int32 GetWeightMapJointCount (Int32 tindex) const
     
    Int32 GetWeightMapCount (Int32 tindex, Int32 jindex) const
     
    Bool SetWeightMapCount (Int32 tindex, Int32 jindex, Int32 cnt)
     
    Float GetWeightMap (Int32 tindex, Int32 jindex, Int32 index) const
     
    void SetWeightMap (Int32 tindex, Int32 jindex, Int32 index, Float v)
     

    PSD Reference

    CAReferencePSDGetPSDReference ()
     

    Normal

    Int32 GetNormalTagCount () const
     
    Int32 GetNormalCount (Int32 tindex) const
     
    Bool SetNormalCount (Int32 tindex, Int32 cnt)
     
    void GetNormal (Int32 tindex, Int32 index, NormalStruct &ns) const
     
    void SetNormal (Int32 tindex, Int32 index, const NormalStruct &ns)
     

    Constructor & Destructor Documentation

    ◆ CAMorphNode()

    CAMorphNode ( )
    private

    ◆ ~CAMorphNode()

    ~CAMorphNode ( )
    private

    Member Function Documentation

    ◆ GetNext()

    CAMorphNode* GetNext ( )

    Retrieves the next morph node.

    Returns
    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.

    Returns
    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.

    Returns
    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.

    Returns
    The first child morph node, or nullptr if there is none. Cinema 4D owns the pointed morph node.

    ◆ GetLink() [1/2]

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

    Retrieves the object linked to the morph node.

    Parameters
    [in]tagThe morph tag containing the morph data.
    [in]morphThe morph containing the morph node.
    [in]docThe document containing the linked object.
    Returns
    The linked object, or nullptr if there is none. Cinema 4D owns the pointed object.

    ◆ GetLink() [2/2]

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

    Retrieves the object linked to the morph node.

    Parameters
    [in]tagThe morph tag containing the morph data.
    [in]morphThe morph containing the morph node.
    [in]docThe document containing the linked object.
    Returns
    The linked object, or nullptr if there is none. Cinema 4D owns the pointed object.

    ◆ GetInfo()

    CAMORPH_DATA_FLAGS GetInfo ( ) const

    Gets what morph data is stored in the morph node.

    Returns
    The data flags: CAMORPH_DATA_FLAGS

    ◆ GetP()

    Vector GetP ( ) const

    Retrieves the position of the morph node.

    Returns
    The position.

    ◆ GetS()

    Vector GetS ( ) const

    Retrieves the scale of the morph node.

    Returns
    The scale.

    ◆ GetR()

    Vector GetR ( ) const

    Retrieves the HPB rotation of the morph node.

    Returns
    The HPB rotation.

    ◆ SetP()

    void SetP ( const Vector p)

    Sets the position of the morph node.

    Parameters
    [in]pThe new position.

    ◆ SetS()

    void SetS ( const Vector s)

    Sets the scale of the morph node.

    Parameters
    [in]sThe new scale.

    ◆ SetR()

    void SetR ( const Vector r)

    Sets the HPB rotation.

    Parameters
    [in]rThe new HPB rotation.

    ◆ GetPointCount()

    Int32 GetPointCount ( ) const

    Retrieves the point count of the morph node.

    Returns
    The point count.

    ◆ SetPointCount()

    Bool SetPointCount ( Int32  cnt)

    Sets the point count of the morph node.

    Parameters
    [in]cntThe new point count.
    Returns
    true if successful, otherwise false.

    ◆ GetPoint()

    Vector GetPoint ( Int32  index) const

    Retrieves the point at index.

    Parameters
    [in]indexThe point index: 0 <= index < GetPointCount()
    Returns
    The point at index.

    ◆ SetPoint()

    void SetPoint ( Int32  index,
    const Vector pnt 
    )

    Sets the point at index.

    Parameters
    [in]indexThe point index: 0 <= index < GetPointCount()
    [in]pntThe new point coordinate.

    ◆ GetTangentCount()

    Int32 GetTangentCount ( ) const

    Retrieves the tangent count of the morph node.

    Returns
    The tangent count.

    ◆ SetTangentCount()

    Bool SetTangentCount ( Int32  cnt)

    Sets the tangent count of the morph node.

    Parameters
    [in]cntThe new tangent count.
    Returns
    true if successful, otherwise false.

    ◆ GetTangent()

    Vector GetTangent ( Int32  index) const

    Retrieves the tangent at index.

    Parameters
    [in]indexThe tangent index: 0 <= index < GetTangentCount()
    Returns
    The tangent at index.

    ◆ SetTangent()

    void SetTangent ( Int32  index,
    const Vector v 
    )

    Sets the tangent at index.

    Parameters
    [in]indexThe tangent index: 0 <= index < GetPointCount()
    [in]vThe new tangent coordinate.

    ◆ GetVertexMapTagCount()

    Int32 GetVertexMapTagCount ( ) const

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

    Returns
    The number of vertex map tags.

    ◆ GetVertexMapCount()

    Int32 GetVertexMapCount ( Int32  tindex) const

    Retrieves the size of the vertex map at tindex.

    Parameters
    [in]tindexThe vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
    Returns
    The size of the vertex map at tindex.

    ◆ SetVertexMapCount()

    Bool SetVertexMapCount ( Int32  tindex,
    Int32  cnt 
    )

    Sets the size of the vertex map at tindex.

    Parameters
    [in]tindexThe vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
    [in]cntThe new size of the vertex map at tindex.
    Returns
    true if successful, otherwise false.

    ◆ GetVertexMap()

    Float GetVertexMap ( Int32  tindex,
    Int32  index 
    ) const

    Retrieves the vertex map value at index of the tindex vertex map.

    Parameters
    [in]tindexThe vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
    [in]indexThe vertex map index. 0 <= index < GetVertexMapCount()
    Returns
    The vertex map value.

    ◆ SetVertexMap()

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

    Sets the vertex map value at index of the tindex vertex map.

    Parameters
    [in]tindexThe vertex map tag index: 0 <= tindex < GetVertexMapTagCount()
    [in]indexThe vertex map index. 0 <= index < GetVertexMapCount()
    [in]vThe new vertex map value.

    ◆ GetParamCount()

    Int32 GetParamCount ( ) const

    Retrieves the number of parameters for the morph node.

    Returns
    The number of parameters.

    ◆ SetParamCount()

    Bool SetParamCount ( Int32  cnt)

    Sets the number of parameters for the morph node.

    Parameters
    [in]cntThe new number of parameters.
    Returns
    true if successful, otherwise false.

    ◆ GetParam()

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

    Retrieves the parameter at index for the morph node.

    Parameters
    [in]indexThe parameter index: 0 <= index < GetParamCount()
    [out]dataAssigned the parameter value.
    [out]idAssigned the description ID of the parameter.
    Returns
    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.

    Parameters
    [in]indexThe parameter index: 0 <= index < GetParamCount()
    [in]dataThe new parameter value.
    [in]idThe new parameter description ID.

    ◆ GetUVTagCount()

    Int32 GetUVTagCount ( ) const

    Retrieves the number of UV tags.

    Returns
    The number of UV tags.

    ◆ GetUVCount()

    Int32 GetUVCount ( Int32  tindex) const

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

    Parameters
    [in]tindexThe UV tag index: 0 <= tindex < GetUVTagCount()
    Returns
    The UV coordinates count.

    ◆ SetUVCount()

    Bool SetUVCount ( Int32  tindex,
    Int32  cnt 
    )

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

    Parameters
    [in]tindexThe UV tag index: 0 <= tindex < GetUVTagCount()
    [in]cntThe new UV coordinates count.
    Returns
    true if successful, otherwise false.

    ◆ GetUV()

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

    Retrieves the UV coordinate index of the tindex UV tag.

    Parameters
    [in]tindexThe UV tag index: 0 <= tindex < GetUVTagCount()
    [in]indexThe UV coordinates index: 0 <= index < GetUVCount()
    [out]uvAssigned the UV coordinates.

    ◆ SetUV()

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

    Sets the UV coordinate index of the tindex UV tag.

    Parameters
    [in]tindexThe UV tag index: 0 <= tindex < GetUVTagCount()
    [in]indexThe UV coordinates index: 0 <= index < GetUVCount()
    [in]uvThe new UV coordinates.

    ◆ GetWeightMapTagCount()

    Int32 GetWeightMapTagCount ( ) const

    Retrieves the number of weight map tags.

    Returns
    The number of weight map tags.

    ◆ GetWeightMapJointCount()

    Int32 GetWeightMapJointCount ( Int32  tindex) const

    Retrieves the joint count of the weight tag at tindex.

    Parameters
    [in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
    Returns
    The joint count of the specified weight tag.

    ◆ GetWeightMapCount()

    Int32 GetWeightMapCount ( Int32  tindex,
    Int32  jindex 
    ) const

    Retrieves the weights count of the joint at jindex of tindex weight tag.

    Parameters
    [in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
    [in]jindexThe joint index: 0 <= jindex < GetWeightMapJointCount()
    Returns
    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.

    Parameters
    [in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
    [in]jindexThe joint index: 0 <= jindex < GetWeightMapJointCount()
    [in]cntThe new weight count.
    Returns
    true if successful, otherwise false.

    ◆ GetWeightMap()

    Float GetWeightMap ( Int32  tindex,
    Int32  jindex,
    Int32  index 
    ) const

    Retrieves the weight at index of jindex joint and tindex Weight tag.

    Parameters
    [in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
    [in]jindexThe joint index: 0 <= jindex < GetWeightMapJointCount()
    [in]indexThe weight index: 0 <= index < GetWeightMapCount()
    Returns
    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.

    Parameters
    [in]tindexThe weight tag index: 0 <= tindex < GetWeightMapTagCount()
    [in]jindexThe joint index: 0 <= jindex < GetWeightMapJointCount()
    [in]indexThe weight index: 0 <= index < GetWeightMapCount()
    [in]vThe 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.

    Since
    R19
    Returns
    The PSD referential for the morph node. The CAMorphNode owns the pointed CAReferencePSD.

    ◆ GetNormalTagCount()

    Int32 GetNormalTagCount ( ) const

    Retrieves the number of Normal tags.

    Returns
    The number of Normal tags.

    ◆ GetNormalCount()

    Int32 GetNormalCount ( Int32  tindex) const

    Retrieves the Normal data count of the Normal tag at tindex.

    Parameters
    [in]tindexThe Normal tag index: 0 <= tindex < GetNormalTagCount()
    Returns
    The Normal data count.

    ◆ SetNormalCount()

    Bool SetNormalCount ( Int32  tindex,
    Int32  cnt 
    )

    Sets the Normal data count of the Normal tag at tindex.

    Parameters
    [in]tindexThe Normal tag index: 0 <= tindex < GetNormalTagCount()
    [in]cntThe new Normal data count.
    Returns
    true if successful, otherwise false.

    ◆ GetNormal()

    void GetNormal ( Int32  tindex,
    Int32  index,
    NormalStruct ns 
    ) const

    Retrieves the Normal data index of the tindex Normal tag.

    Parameters
    [in]tindexThe Normal tag index: 0 <= tindex < GetNormalTagCount()
    [in]indexThe Normal data index: 0 <= index < GetNormalCount()
    [out]nsAssigned the Normal data.

    ◆ SetNormal()

    void SetNormal ( Int32  tindex,
    Int32  index,
    const NormalStruct ns 
    )

    Sets the Normal data index of the tindex Normal tag.

    Parameters
    [in]tindexThe Normal tag index: 0 <= tindex < GetNormalTagCount()
    [in]indexThe Normal data index: 0 <= index < GetNormalCount()
    [in]nsThe new Normal data.