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

    Set attribute manager mode

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 637 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 08/04/2017 at 07:09, xxxxxxxx wrote:

      Hello,

      Is it possible to set the attribute manager mode, via a script, for example?
      Would it need to be active/in focus first?
      It would be nice to have the modes as buttons or tabs for quicker/easier access.
      Maybe this post would be better suited for the plugin requests, I wasn't sure.

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

        On 08/04/2017 at 07:38, xxxxxxxx wrote:

        I guess this function is made for that.
        https://developers.maxon.net/docs/py/2023_2/modules/c4d.gui/index.html?highlight=manager#c4d.gui.ActiveObjectManager_SetObject

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

          On 08/04/2017 at 08:36, xxxxxxxx wrote:

          This seems to work sometimes, I made this super minimalist script 
          https://github.com/NNNenov/C4Dhandy/blob/master/scripts/setAttributeManagerWindow.py

          In the cases it doesn't work, e.g. ACTIVEOBJECTMODE_TOOL;
          I have an editable poly cube and I set the attribute manager to a mode other than tool mode, when I execute the script with id as
          c4d.ACTIVEOBJECTMODE_TOOL

          It shows project settings mode instead, noticed this happens with other modes too. Maybe I didn't set up the script properly and it defaults to project settings mode..

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

            On 08/04/2017 at 08:58, xxxxxxxx wrote:

            Basicly c4d help you and set the mode according to the op you pass throught it.
            Here you have a quick exemple...

            import c4d
              
              
            def main() :
                #obj
                obj = op
                c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_OBJECT, obj, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN)
                
                #tag
                tag = op.GetTags()[0]
                c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_TAG, tag, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN)
                
                #mat
                mat = doc.GetActiveMaterial()
                c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_MATERIAL, mat, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN)
              
                #shader
                sha = mat.GetFirstShader()
                c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_SHADER, sha, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN)
                
                #tool
                tool = c4d.plugins.FindPlugin(doc.GetAction(), c4d.PLUGINTYPE_TOOL)
                c4d.gui.ActiveObjectManager_SetObject(c4d.ACTIVEOBJECTMODE_TOOL, tool, c4d.ACTIVEOBJECTMANAGER_SETOBJECTS_OPEN)
              
            if __name__=='__main__':
                main()
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 08/04/2017 at 10:07, xxxxxxxx wrote:

              Ahh I see, that makes sense! thanks a lot!

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