THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 12/10/2010 at 00:50, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R12
Platform: Windows ;
Language(s) : C++ ;
---------
Under what circumstances would AddJoint() from CAWeightTag return -1 for the joint index?
I use the following code after I have allocated and added all joint objects to the document.
All joint object pointers are valid.
CAWeightTag* tag = CAWeightTag::Alloc();
for(i=0; i < num_joints; i++) {
LONG joint_index = tag->AddJoint( joints[i].ob ); // returns -1 ???
}
pPoly->InsertTag( tag, NULL );
Then later, calling tag->SetWeight( joint_index, vindex, weight ); will crash the program from passing -1 as joint_index.