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

    focus userdata

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 536 Views
    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 Offline
      Helper
      last edited by

      On 25/10/2017 at 16:49, xxxxxxxx wrote:

      Hi,

      is there any way to set the focus to any userdata item or the "userdata" tab itself ? Similar to the "doc.SetActiveObject" function ?

      Thanks !

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

        On 26/10/2017 at 01:48, xxxxxxxx wrote:

        Hi,

        it is not possible to set the user input focus to a certain parameter in Attribute Manager.

        But under certain limitations ActiveObjectManager_SetObject() can be used to select a tab (in your case "User Data") in Attribute Manager.

        First you need to make sure the object is selected in Object Manager, e.g. via BaseDocument.SetActiveObject().

        And then for example like so (op being the currently selected object) for the User Data tab:

        c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_OBJECT, op, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN, c4d.ID_USERDATA)
        

        Note: In certain cases the DescID for the tab can not be specified in this short and simple manner, but needs the more complete version, i.e. in case of a tab showing tag parameters.
        Like so (using Trestriction (ID of Restriction tag) as an example) :

        c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_OBJECT, op, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN, c4d.DescID(c4d.DescLevel(c4d.ID_TAGLIST), c4d.DescLevel(c4d.Trestriction)))
        

        As mentioned before this method has a bunch of limitations. Not saying my list is complete, but here are a few:
        - There's no way to specify the Attribute Manager, if multiple are open.
        - It's not possible to specify multiple tabs in parallel.

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

          On 26/10/2017 at 12:02, xxxxxxxx wrote:

          Hi Andreas,

          brilliant !

          It takes some time (at least for me) to get the hang of handling the DescIDs and DescLevels in order to target the corresponding tabs but now it works perfectly 🙂

          Thanks for your answer and also for mentioning the limitations.

          best regards,
          Jens

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