CAWeight Tag - Setting up Joint Links



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/12/2008 at 00:58, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R10+ 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Unfortunately, the SDK docs are really very vague on the subject.
    - I have a mesh object.
    - I have allocated a CAWeight Tag and added it to my mesh object.
    - I have a list of joints (BaseObject *'s) that need to be inserted into the CAWeight Tag's joint list.
    ...the given SDK docs really say nothing about how to go about doing this, so I might be completely wrong (well, everything I've tried crashes, so I _know_ I'm wrong - just not how far off I might be :) )...

        
        
          
        AutoAlloc<BaseLink> link;  
        link->SetLink(pJointObj);
        
        
        
        
        pWeightTag->SetParameter(DescID(DescLevel(ID_CA_WEIGHT_TAG_JOINTS,DTYPE_BASELISTLINK,0),
        
                                        DescLevel(ID_CA_WEIGHT_TAG_JOINTS_GROUP)), GeData(link), 0);
        
        
        
        
        // pWeightTag->SetParameter(DescID(DescLevel(ID_CA_WEIGHT_TAG_JOINTS),
        
                                           DescLevel(ID_CA_WEIGHT_TAG_JOINTS_GROUP)), GeData(link), 0);
        
        
        
        
        // pWeightTag->SetParameter(DescLevel(ID_CA_WEIGHT_TAG_JOINTS,DTYPE_BASELISTLINK,0),
        
                                              GeData(link), 0);
        
    

    ...none of the above (or any of numerous other 'shots in the dark') have worked - could I get some help?  I really have NO idea what SetParameter() needs to get BaseLinks to my Joint objects added to the CAWeight Tag.
    Thanks,
    Keith



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/12/2008 at 01:26, xxxxxxxx wrote:

    Hmmm... sorry, after looking more closely, I think I'm on the wrong track. I actually haven't messed with IN_EXCLUDE objects ( InExcludeData class ) yet... and it looks like that's what I need (?). 
    I'm guessing that I need to allocate an InExcludeData and then InsertObject() all of my joint objects into that and then (somehow) pass that to the CAWeight Tag via SetParameter()... any help on that would be great - thanks.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/12/2008 at 02:26, xxxxxxxx wrote:

    Hmm... I'm now trying this:

        
        
          
        CAWeightTag *pWeightTag = CAWeightTag::Alloc();  
        
        
        op->InsertTag(pWeightTag);
        
        BaseContainer *tagdata = pWeightTag->GetDataInstance();  
        InExcludeData *jointlinks = (InExcludeData * )tagdata->GetCustomDataType(ID_CA_WEIGHT_TAG_JOINTS,  
                                                                          CUSTOMDATATYPE_INEXCLUDE_LIST);  
        jointlinks->InsertObject(pJointObj, 0);  
        
    

    ...and that actually gets the joints added to the list (at least in the OM), but calls to pWeightTag->GetJointCount() or pWeightTag->FindJoint(pJointObj, pDoc) to get an Index to use for all the other calls fails to recognize that I've added them.
    I assume I'm doing something wrong still.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/12/2008 at 02:40, xxxxxxxx wrote:

    Just to clarify and save some time, what I'm attempting to do is set up both a Skin deformer and the needed CAWeight Tag on the mesh to get the joint animations 'bound' to the mesh.
    I have all the meshes in the scene.
    I have all the Joints in the scene.
    I have all the animation tracks and keyframes set up for the joints.
    I have arrays of Weights to set up for each Joint used by each mesh.
    ...in short, I have all the data I need - ready to go - the remaining issue that's holding me back is getting the CAWeight Tags set up with the list of joints for each mesh.  Once I can get an 'index' for that joint, (from the CAWeight Tag), I assume I can use the other functions (they all require a joint index) to set up the weights, etc.
    Once all of the above is set up - I'm assuming that the Skin deformer will just 'work', though I suspect that I'll still have to do something that the 'Bind' menu option is doing (?).
    Thanks,
    Keith



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/12/2008 at 02:47, xxxxxxxx wrote:

    You must use Get/SetParameter, its not just an include list stored in the container, it has additional data, e.g.

    > \> if (pTag->GetParameter(DescID(ID_CA_WEIGHT_TAG_JOINTS),jnt_data,0)) \> { \> InExcludeData \*pJntList=(InExcludeData\* )jnt_data.GetCustomDataType(CUSTOMDATATYPE_INEXCLUDE_LIST); \> if (pJntList) \> { \>     // add joints \>     pTag->SetParameter(DescID(ID_CA_WEIGHT_TAG_JOINTS),jdata,0); \> } \> } \>



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/12/2008 at 03:31, xxxxxxxx wrote:

    Excellent - that works perfectly - thanks David!


Log in to reply