ViewportHUD

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 02/08/2010 at 02:22, xxxxxxxx wrote:

User Information:
Cinema 4D Version:   11.5 
Platform:      
Language(s) :     C++  ;

---------
Hi,

does anybody know how to use the ViewportHUD class? I couldn't find any info at all.

What i want to do is to draw a string in the viewport during the mouse loop of a tool plugin - exactly like the move/scale/rotate tools do it.

I tried the following:

  
// in MouseInput   
viewportHud = ViewportHUD::Alloc()   
viewportHud->BeginGroup();   
ViewportHUDControl* ctrl = viewportHud->AddControl(HUDCONTROL_TYPE_STATIC, doc, bd, NULL, DescID(10000), BaseContainer(), GeData("Hallo!"), DA_STRING);       
ctrl->SetTopLeft(500, 500);   
viewportHud->EndGroup();   
  
// in Draw   
viewportHud->DrawHUD(doc, NULL, doc->GetFps(), bd, HUDCONTROL_DFLAGS_NAME | HUDCONTROL_DFLAGS_FRAME);   

this code draws nothing, and DrawHUD returns False 😞

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 02/08/2010 at 05:37, xxxxxxxx wrote:

Hi Michael,

I think it´s not working. At least I never got it working and if I remember correctly someone (guess it was Mikael back then) told me that it´s not possible to draw custom elements in the c4d HUD. Although I am not sure if that still applies but as it´s not working for you either it seems to be still valid.

Instead use a GeClipMap and draw into it, then let it be drawn with DrawTexture instead. That works fine for me and I use it in my tree tool too, so that works for sure.

HTH

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 02/08/2010 at 05:56, xxxxxxxx wrote:

Thanks for the info at least 😉

I think i will use the workaround with the GeClipMap then.

best regards,
Michael

THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

On 04/08/2010 at 03:52, xxxxxxxx wrote:

The classes and functions within lib_viewport.h are currently private and not meant for plugin development.

cheers,
Matthias