Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Accessing HUD elements

    SDK Help
    0
    3
    344
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 29/06/2015 at 07:20, xxxxxxxx wrote:

      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

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 30/06/2015 at 07:48, xxxxxxxx wrote:

        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().

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 30/06/2015 at 08:44, xxxxxxxx wrote:

          Amazing thanks, that looks like what I need.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post