On 05/05/2013 at 07:10, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi Folks,
I'm trying to add points and polygons to an object's Tpoint and Tpolygon tag. But I can't seem to be able to write anything to them. This is what I've managed so far for trying to get points to the point tag:
BaseDocument *doc = GetActiveDocument();
BaseObject *obj= doc->GetActiveObject();
BaseTag *TPnt_Tag = obj->GetTag(Tpoint);
if(!TPnt_Tag){GePrint("obj Error: Point tag not found.");}
PointTag *PntTag = (PointTag* )TPnt_Tag;
Vector *WritePoints = (Vector* )PntTag->GetDataAddressW();
// INSERT POINTS
WritePoints[0] = Vector(-100,-100,-100);
WritePoints[1] = Vector(-100,100,-100);
WritePoints[2] = Vector(100,-100,-100);
WritePoints[3] = Vector(100,100,-100);
WritePoints[4] = Vector(100,-100,100);
WritePoints[5] = Vector(100,100,100);
WritePoints[6] = Vector(-100,-100,100);
WritePoints[7] = Vector(-100,100,100);
ProxyMan->Message(MSG_UPDATE);
EventAdd();
I'm not worried about polys yet. Will have a go at working that one out for myself first. But from the code above, I'm trying to make a box with 8 points. I've gone a bit in circles so not really sure where to go to from here. I thought I may have to Alloc/Init the point count, but I'm not sure where that might fit in? Is someone able to bump me in the next possible direction here?
Cheers,
WP.