THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/04/2004 at 19:43, xxxxxxxx wrote:
Cinema 4D Version: 8.500
Platform: Windows ;
Language(s) : C++ ;
I am trying to change some individual points in a point selection tag. I have a handle to the tag (i know that because it returns the correct name), but when I try and get the individual points, I'm having no luck.
I have searched the forums for info on this basic problem, but no luck so far.
Here's the code I have so far....
BaseTag* mTag = obj->GetTag(Tpointselection,0);
BaseContainer data = mTag->GetData();
Vector mVector = Vector();
id = data.GetIndexId(i++);
mSelection= "mVectorx " + RealToString(mVector.x);
mVector.x += 100;
//redraw the whole scene
This is just test code, to see what works, which is nothing so far.
My test string is just to see what I have, and I always have zero there. Then, when I try and change the x value, it does nothing anyway.
I am completely new to writing plugins, so don't be hard on me, and please help!
Thanks in advance,
On 26/04/2004 at 21:32, xxxxxxxx wrote:
OK, so I guess my question is really can I get at the vector information of the points stored in a Point Selection Tag? If so, then how?
On 01/05/2004 at 17:38, xxxxxxxx wrote:
The Tpointselection tag is a SelectionTag. Just cast it:
BaseTag* tag = ...;
if (tag->GetType() == Tpointselection)
SelectionTag* seltag = static_cast<SelectionTag*>(tag);
BaseSelect* sel = seltag->GetBaseSelect();
On 01/05/2004 at 21:17, xxxxxxxx wrote:
Thank you so much for replying!
The thing is, I already successfuly have the correct information from the selection tag - I just don't know how to get to the guts of the information - the vector information, the x, y and z co-ordinates. BaseSelect class seems to be limited to point counts ans stuff like that - how do I read the actual information stored in the point selection?
Thank so much in advance again for a quick reply.
On 04/05/2004 at 06:00, xxxxxxxx wrote:
All the point counts in the BaseSelect class refer to the PointObject::GetPoint() array. So just do
BaseObject* obj = tag->GetObject();
PointObject* pobj = static_cast<PointObject*>(obj);
Vector p = pobj->GetPoint()[i]; // i is the point index from the selection