Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

Accessing HUD elements

Author
Message
  Topic Search Topic Search
supergeordie View Drop Down
Member
Member
Avatar

Joined: 2010 Oct 28
Online Status: Offline
Posts: 73
Direct Link To This Post Topic: Accessing HUD elements
    Posted: 2015 Jun 29 at 7:20am

User Information:

Cinema 4D Version:   16 
Platform:      Mac OSX  ; 
Language(s):     C++  ;   PYTHON  ; 

---------

Hi everyone,

I was wondering if there is anything in the SDK for Python or C++ to access HUD elements. All I'm looking to do at this stage is have control of the positions of HUD objects like a user data slider or an info string.

Thanks,

Adam

http://pixelsinprogress.com
Back to Top
Yannick Puech View Drop Down
Forum Moderator
Forum Moderator


Joined: 2011 Apr 13
Location: Spain
Online Status: Offline
Posts: 1143
Direct Link To This Post Posted: 2015 Jun 30 at 7:48am
Hi Adam,

It's currenly only possible to access the HUD elements (or controls) with the C++ API. Note the library lib_viewport.h that enables this access isn't documented and doesn't appear in the documentation. See this header to know its definitions.
Here's a simple code snippet to access an existing HUD added to an integer user data with ID 1:
AutoAlloc<ViewportHUD> viewHUD;
if (!viewHUD)
  return false;

ViewportHUDControl* control = viewHUD->FindControl(doc, doc->GetActiveBaseDraw(), op, DescID(DESCID_DYNAMICSUB, DescLevel(1, DTYPE_LONG, 0)));
if (!control)
  return false;
doc is the active document and op the active object.

Then to control the position ViewportHUDControl has the method SetTopLeft().





Edited by Yannick Puech - 2015 Jun 30 at 11:53pm
MAXON
Developer Support
Back to Top
supergeordie View Drop Down
Member
Member
Avatar

Joined: 2010 Oct 28
Online Status: Offline
Posts: 73
Direct Link To This Post Posted: 2015 Jun 30 at 8:44am
Amazing thanks, that looks like what I need.
http://pixelsinprogress.com
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.