On 08/06/2014 at 17:48, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 14
Platform: Mac OSX ;
Language(s) : C++ ;
---------
I have a tag that displays stuff on the editor using DrawPoly.
But I found out that DisplayControl from SceneHook would be perfect for what I need.
How can I create a modified SceneHook for displaying a single object (the one that has my tag attached).
In simpler terms... I found this snippet of code:
Bool LiquidToolData::InitDisplayControl(BaseDocument *doc, BaseContainer &data;, BaseDraw *bd, const AtomArray *active)
{
return TRUE;
}
void LiquidToolData::FreeDisplayControl()
{
}
Bool LiquidToolData::DisplayControl(BaseDocument *doc, BaseObject *op, BaseObject *chainstart, BaseDraw *bd, BaseDrawHelp *bh, ControlDisplayStruct &cds;)
{
if (chainstart && op) // FIX[46030]
{
if (chainstart->IsInstanceOf(Opoint) && op->IsInstanceOf(Opoint) && ToPoint(chainstart)->GetPointCount()==ToPoint(op)->GetPointCount()) op=chainstart;
else return TRUE;
}
if (!op || !op->IsInstanceOf(Opoint)) return TRUE;
LONG pcnt = ToPoint(op)->GetPointCount();
cds.vertex_color = GeAllocTypeNC(SVector,pcnt);
if (!cds.vertex_color) return FALSE;
Random rnd;
rnd.Init(45346);
LONG i;
for (i=0; i<pcnt; i++)
{
cds.vertex_color _= SVector(rnd.Get01(), rnd.Get01(), rnd.Get01());
}
return TRUE;
}
So, let us say that I want the object that has my tag attached, is displayed with random colored faces, using this code.
How can I make it work with only the objects that have my tag?