THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 10/02/2012 at 01:55, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) :
---------
Hi,
I am trying to get the pointscount of a polygonselection, which is stored in a polygonselectionTag.
I tried
int points = op->GetTagDataCount(Tpoint);
before that i set the selection tag as active. All i get is the full amount of points from the Object. If i use a Cube it gives me 8 Points becuase a Cube got only 8. But the right value would be 4 if i've selected only one face.
I need the pointcount to set a weightmap. If I am not mistaken i can make weightmap for my joints with the function "setWeightMap(Joint_index,map(float number),Pointcount)
So the Question is do I have to use this way:
BaseDocument *doc = GetActiveDocument();
BaseObject *obj = doc->GetActiveObject();
PolygonObject *pobj = ToPoly(obj);
AutoAlloc<SelectionTag> st(Tpolygonselection);
if(newpolytag->GetType() &Tpolygonselection)
{
BaseSelect *select= static_cast<SelectionTag*>(newpolytag)->GetBaseSelect();
sel->CopyTo(select);
}
LONG count = pobj->GetPolygonCount();
To work my way through the number of points? Or is there an easier way, to get the points amount of the selection?