On 11/06/2013 at 13:30, xxxxxxxx wrote:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
bare with me here, I'm wanting to clean up some fundamentals in my plugin that I can't seem to work out myself.
My plugin houses it's own polygon object data and draw. You can edit the mesh, etc etc. But there's a few nitty gritty things that are bugging me.
1. the drawn object in the viewport (looks like) it's not drawing the Z depth correctly. Polygons at the rear are showing up in front of polygons that are in front. I have no idea what to look for here... a flag for the basedraw? This happens when in object/model mode. It displays fine when in point/polygon/line mode. And it renders correctly.
2. my viewport mesh won't display a texture. When I add a texture tag to the polygon object draw (PolygonObject) Pobj->InsertTag(Ttexture) Cinema crashes. What do I need to be looking for to draw textures/materials on poly objects that I draw my in the viewport?
3. how does the cache system work? Can I 'set' the cache? Or, can I return a PolyObj of the cache? I can't use GVO to do my object drawing because of the plugin being an editable object.
4. can I run a modeling command on a polygon object during the Draw() function? I tried the below code, but it crashes Cinema:
ModelingCommandData mcd; BaseContainer bc; bc.SetBool(MDATA_SUBDIVIDE_HYPER, TRUE); bc.SetReal(MDATA_SUBDIVIDE_SUB, 2); // 2 used just for example mcd.bc = &bc; mcd.op = PMesh; // also tried (BaseObject* )PMesh; --> PMesh is a PolygonObject mcd.mode = MODELINGCOMMANDMODE_ALL; mcd.doc = doc; SendModelingCommand(MCOMMAND_SUBDIVIDE, mcd);
Edit: updates to some of the points - might make the query a bit clearer.. removed some of the late-night jibber-jabber I had written that's irrelevant..