Solved Changing hierarchy draw order / priority


I have some custom modifiers inside a custom generator. I usually draw only a few of the modifiers to the viewport, and very often I wish I could draw some of them on top of the others (if selected, for example), but the lower objects always are drawn on top. Is there a way to change the order of drawing for an object's hierarchy?

In thee Draw Manual, it says...

To avoid drawing order problems the drawing operations of multiple objects or tags can be replaced by the use of the "Draw" function in a SceneHookData plugin.

It sounds like what I need, how does it work? Should I remove the Draw() calls from objects and call manually from the SceneHook?

There's nothing in the manuals or in the sdk examples about SceneHook plugins (please add something!). Of course I know the SceneHookData API reference, but there's no way to learn about it's capabilities, we have to guess and try, what's very time consuming and usually don't take us very far.

Hi @rsodre,

There is actually no proper example or manuals, but I think you can find all the information needed in the 2D viewport drawing using a SceneHook article.

Further information can be found in the Draw Manual.

If you still have a question, please let me know.

The SceneHookData Draw() is clear now for me.

But please, add a proper Manual page in the docs and a complete example. I spent some time trying to find out if DisplayControl would be useful for me, and still don't understand exactly what's it good for, besides painting polygons.

And would be nice to have articles like this should referenced on the manual pages.


Hi @rsodre, thanks for your feedback, and glad you solved your issue.

Regarding the DisplayControl I let you read this topic: SceneHook and DisplayControl.

Manuals, for scenehooks is definitely something we consider.