Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
@m_magalhaes Thanks Manuel!
When I fill-in only Inner edges in NgonBase::BuildNgon, then it surprisingly works I don't know why I tested all combinations except this one There are still some minor glitches, some inner edges are randomly not hidden, but ngons created are valid for all the cases I have tested. Random glitches are easily fixable with forcing all inner edges to be hidden.
I will test it more, but this seems to be reliable for now. NGONS import - read outer edges directly from Pgon::*m_Edge array NGONS export - with NgonBase::BuildNgon(), filling Inner edges only, and force hide inner edges on quads.
Thanks a lot Manuel, Your help has been very valuable to me.
Regards, Viktor.
I just found out it's a GPU issue. Pixels are not visible on Intel UHD 630. Mac M1 well. GeForce works on 4K monitor but not on HD monitor.
So it is a bug.
I guess it is probably not doable with current api. I am marking this as solved!
I sacrifice the possibility that the generator can be changed to a Spline object with the Cinema Make Editable command. If the call to NurbsData::GetContour() returns null, no highlighting or geometry will be drawn. So I can draw everything without any collisions.
Only downside of this is that additional command for conversion of this object to a spline object is needed.
Thanks.
Hi, I am not able to draw a pixel in R25 anymore. DrawPoint2D and DrawHandle2D() with DRAWHANDLE::MINI option doesn't work anymore. R21,S22,R23,S24 works fine.
Is anything changed in R25 drawing api?
I hope it is just an error on my side. But it works in all other versions. Problem is just in R25.
Anybody else having a problem with this?
Thanks! Viktor
@m_adam said in Spline generator drawing and selection override.:
What do you mean by being part of the generator? If they are children of your generator, and your generator is registered with the OBJECT_INPUT then the cache should be automatically touched and therefor not shown.
No children. I just want to disable drawing of Spline Object by cinema. Spline object which is returned in GetContour() callback. But only for the time it is being generated. Until you call Make Editable command which destroy generator and keep just Spline object.
So I want to override drawing of that generated Spline object. And draw selected and not selected parts with differnt colors. Avoid to overdrawing selected parts over existing draw made by cinema which makes "glitches".
So in short just need to disable drawing spline object and highlighting.
Sorry for confusion. Thanks! V
Just return true in your draw method during the HIGHLIGHT_PASS, this way nothing will be drawn.
I have tested all returns of DRAWRESULT from NurbsData::Draw() callback. (R21-R25)
In R21 the spline is always white, in R25 it is orange. No matter if I exit with return SUPER::Draw(op, type, bd, bh) or return any DRAWRESULT result.
V.
@m_adam
I'll try to explain briefly the plugin first and the glitches.
Plugin NurbsData (derived from ObjectData) is complete NURBS generator. NURBS data are stored in base container as a single data parameter. Data contains geometry,topology, UV and selection. Selection depends on Cinema mode (points,<segments-edges>, <curves-surfaces- polygons>)
Object has an internal switch for curves or surfaces. When works in curves mode the NurbsData::GetContour() returns the Spline object. When works in surfaces mode the NurbsData::GetVirtualObjects() returns the Polygon object.
It is all implemented and works, only makes drawing glitches depends on Cinema version.
Problematic is when drawing NURBS selection. (specially curve segments), it is not matching the highlighted curves, It is just 1-2 pixels random difference depend on viewport settings. But it is a huge problem on large scale floor-plans with thousands of lines, because the visibility is messy then.
If still not clear, I can show it. (call with a sceen-share)
I have implemented NURBS object as a spline and polygon generator. I am trying to have the same visual look from R21 to R25. There are several visual glitches and problems specially when drawing additional geometry. So the best way would be to override the drawing of everything.
I would need to completely disable drawing of spline geometry(cache) and highlighting of selected object.
Is there a way to disable drawing spline cache object while it is part of generator object? But it have to be visible after it is converted to spline object.
Is there a way how to completely disable object highlighting per specified plugin? In R21 it was optional :
I am not able to find this in R25 and not even in SDK.
I have already missed the deadline because of struggling with this. Any advice would help. thanks!
Thank you guys for quick reply. But I was probably not clear enough with the question.
I do understated the concept of setting panel description via GetDDescription() callback. I already did the checks for whether it is request for full description of just single id. As it is listed in the example below (it is member function of C4dControls class from previous snippet
void C4dControls::AddIntChoice(int id, int gid, const String& name, const BaseContainer& items) { const DescID cid = DescLevel(id, DTYPE_LONG, 0); //--------------------------------------------------------------------- if (ex_descr && (!ex_singleid || cid.IsPartOf(*ex_singleid, nullptr)) ) { BaseContainer bc = GetCustomDataTypeDefault(DTYPE_LONG); //--------------------------------------------- bc.SetInt32 (DESC_CUSTOMGUI, ID_QUICKTABSRADIO_GADGET); bc.SetString(DESC_NAME, name); bc.SetInt32 (DESC_SCALEH, 1); // animate OFF bc.SetInt32 (DESC_ANIMATE, DESC_ANIMATE_OFF); //--------------------------------------------- bc.SetContainer(DESC_CYCLE, items); //--------------------------------------------- ex_descr->SetParameter(cid, bc, DescLevel(gid)); } }
But it is still calling to rewrite each control description several times after any event in GUI. What confuses me the most, is that each series of calls is with the different pointer to description (Description* description) For example there are five different pointers to description when ToolData::GetDDescription() is executed for the same event. (after mouse click into attribute manager)
Is this the way how it really works? There are more versions of description for the same panel, and all of them have to be initialized repeatedly after each event?
Hi, I have a questions about behavior of ToolData class member function GetDDescription(). I can't find any example and I don't understand why Cinema is calling this function several times after each user event in GUI.
Below is the code of overridden member function. I am filling description with controls every time now. (function LoadControls())
Bool LwCadToolData::GetDDescription (BaseDocument* doc, BaseContainer& data, Description* description, DESCFLAGS_DESC& flags) { // validation if (description == nullptr) return false; ApplicationOutput("GetDDescription flags: @", flags); // initialize controls LoadControls(C4dControls(description, description->GetSingleDescID())); // controls loaded into tool description flags |= DESCFLAGS_DESC::LOADED; //--------------------- // base return SUPER::GetDDescription(doc, data, description, flags); }
Problem is that after each mouse event , this function is executed several times, always a different description pointer. Below is the list of calls after a single click.
GetDDescription flags: NONE GetDDescription flags: NONE GetDDescription flags: NONE GetDDescription flags: NONE GetDDescription flags: RESOLVEMULTIPLEDATA|MAPTAGS GetDDescription flags: NONE
Could you please give me a hint, how to optimize this properly? Optimal way is to fill description only once. Is it necessary fill it every time the GetDDescription() function is executed?
Thanks!
Works like a charm! It's much more flexible than I hoped;)
Thanks a lot!