On 26/02/2018 at 23:06, xxxxxxxx wrote:
Cinema 4D Version: r19
Platform: Mac OSX ;
Language(s) : C++ ;
i've got a project, the main idea is to draw the object wireframe in a selected color. (based on the object color or the layer color or an arbitrary color)
I've decided to rebuild something like the layermanager. So i got a sceneHook to store a list of dummy nodes with colors. When i drag object on those "mylayer" i'm adding in the object's BaseContainer a baselink to the layer. (not sure if it's something i'll go with)
In the scenehook, i'm using inside the function DisplayControl the function
bd->DrawPolygonObject(bh, op, DRAWOBJECT_FORCELINES|DRAWOBJECT_USE_CUSTOM_COLOR,nullptr,mycolor);
And it's working fast.
The problem is when i'm trying to access the object base container and retrieve the color of my "mylayer"
the function "DisplayControl" is executed twice, the first "pass" i'm only getting an empty basecontainer with this code
const BaseContainer* bcNode = op->GetDataInstance();
that's the same if i'm asking for the name's object or anything else but the mesh informations (pointscount, polycount) (asking for the first tag doesn't work neither)
The second time "DisplayControl" is executed, i can get my color but the "DrawPolygonObject" return DRAWRESULT_SKIP.
i've tried to use the "Draw" functions with some draw lines but my code is so slow ^^'
i don't know where to look. I'm pretty sure you'll have some tips.
i hope my description is clear enough