SOLVED Spline generator drawing and selection override.

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.

  1. 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.

  2. Is there a way how to completely disable object highlighting per specified plugin?
    In R21 it was optional :
    6b686d34-7db3-4f35-aa79-49123c1f9421-image.png

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!

Hi @WTools3D, unfortunately your description is a bit too fuzzy for us to be able to help you.

I have implemented NURBS object as a spline and polygon generator.
What does it mean? You have a PolygonGenerator that output spline?

If I understand you correctly your 2 questions, should help you to workaround the "several visual glitches". But can you elaborate a bit more on this topic? So we can fix the issue, or provide proper way to not have "visual glitches and problems".

  1. Just return true in your draw method during the HIGHLIGHT_PASS, this way nothing will be drawn.

For the first question, I would need to understand more your plugins.

Is there a way to disable drawing spline cache object while it is part of generator object?

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.

But it have to be visible after it is converted to spline object.
What do you mean here? how does the conversion occurs? Is it when the user make editable your generator? If yes, you can react to the MSG_EDITABLE_END to customize the result.

Cheers,
Maxime.

@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)

Thanks!
Viktor

@m_adam said in Spline generator drawing and selection override.:

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 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

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.