Generator object not drawn if origin outside of view
-
Hi,
I just started a little plugin project for fun. It's a generator object, pretty simple stuff with only the OBJECT_GENERATOR flag, returning a geometry in GetVirtualObjects().
I noticed something that's new to me: When the object's origin is not visible in the viewport, the whole object is not drawn anymore. The object's geometry should be well visible, but as soon as the object origin leaves the visible frame, the whole geometry vanishes.
Any ideas what might be the reason? I thought, maybe it's a way to optimise the viewport performance, and maybe implementing GetDimension would fix it, because the object then has a reasonable bounding box. But that didn't help.
I'm on R20, as R21 does not run on my private computer.
Cheers,
Frank -
I assume that with "geometry" you mean a
PolygonObject
?I observed this behavior when not setting up the
PolygonObject
correctly. E.g. not doing an update after its internal data was changed (points and polygons).polyObject->Message(MSG_UPDATE);
-
Hi @fwilleke80, thanks for reaching out us.
Kudos to @PluginStudent for the hint because that's likely to be the cause that prevent object to be displayed when the origin is not visible. You can experiment it by commenting out this line in the Plane-by-Polygons example.
Please check the code and eventually report if that's not the case.
Final notes: please Frank use the Q&A functionality to mark a thread as question and don't forget to mark the correct answer or set the thread to solved if no further effort is needed from us.
Best, R
-
Oh man, it really was the missing message. Never thought it would have such weird consequences to forget that. Thanks guys!