Creating HUD for information of plugin objects

Hi everyone,

I am developing plugin that already functional as desired for now. I want to add HUD feature for that. I was looking samples and documentation about that but a bit confused when I try to impement HUD.

  1. I created MyPluginDisplayMode object inherited from RealtimeDisplayMode object to use HUDs. (I didn’t add any implementation for overriden methods come from RealtimeDisplayMode)
  2. I registered this object as MyPluginDisplayMode.RegisterDisplayModes(PlugIn);
  3. I initialized it in MyPluginViewModel object which is inherited from Rhino.UI.ViewModel
  4. Lastly I used this method variableName.HudShow();

When I open my plugin in rhino nothing initializing, what I am missing something in structure?

I want to achieve below image

Thanks in advance

I can be wrong maybe sth changed but AFAIK to draw on top of viewport you have to override DisplayConduit

Not familiar with this though…

I guess this is the problem (?) to draw those shouldn’t you use e.Display.MethodName ?

The HUD feature for realtime display mode integrations is probably not what you’re looking for, unless you plan to actually integrate a realtime rendering engine.

DisplayConduit is what you need.

Probably the most useful sample code:

Hi @nathanletwory and @D-W,

I tried sample, it’s kind of that I am trying to do but I want them in different Display Mode.

I want to create plugin specific display mode that when user switch to it, will be able to see some dynamic values, some of them text some of them graphs as you can see below image.

Is it possible to do that with DisplayConduit

Thanks for replies

You should be able to know what display mode is currently picked so i guess checking it and turning on/off hud will work - @nathanletwory should know if there is event to hook up like OnDisplayModeChanged or sth similar.

1 Like

Check if the View.DisplayMode of the DrawEventArgs you get in your implementation corresponds to your display mode. If not just return early from the draw function.

As response my question briefly, is it enough to use DisplayConduit for HUD texts and graphs? Or will I need RealtimeDisplayMode? I still confused sorry.

You don’t need the RealtimeDisplayMode, unless you integrate a render engine like Cycles (from Blender) is integrated in Rhino as Raytraced. If you just have a regular display mode, and want to show extra information you use just the DisplayConduit.

1 Like

@nathanletwory @D-W
Thanks for enlightening to both of you, I will try with this structure and let this topic know for other people.
Best wishes!