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

    Boolean Button User Data [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 702 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 13/12/2016 at 09:25, xxxxxxxx wrote:

      Hello there,

      Is it possible to create a boolean button user data with python as in the screenshot below:

      C4D File : boolean_button.c4d

      Also, is it possible to copy user data from one object to another using python?

      Thanks.

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

        On 14/12/2016 at 00:37, xxxxxxxx wrote:

        Have look at this thread https://developers.maxon.net/forum/topic/7277/8420_special-options--creating-userdata-with-python
        You got everything you need about creating / copy UD

        And you can also read this tutorial for a better understanding http://www.grooff.eu/tutorials/Adding User Data using Python.pdf

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

          On 14/12/2016 at 01:15, xxxxxxxx wrote:

          Hello,

          it seems one can create such a boolean button by creating a boolean user data parameter and using the custom GUI of a button:

            
          bc = c4d.GetCustomDatatypeDefault(c4d.DTYPE_BOOL)  
          bc.SetString(c4d.DESC_NAME, "Button")  
          bc.SetInt32(c4d.DESC_CUSTOMGUI, c4d.CUSTOMGUI_BUTTON)  
            
          op.AddUserData(bc)  
            
          c4d.EventAdd()  
          

          You find the functions to handle user data in the description of the BaseList2D class.

          best wishes,
          Sebastian

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

            On 14/12/2016 at 14:31, xxxxxxxx wrote:

            Hello,

            Thanks so much for your replys, thats works the boolean button.

            I have a new problem : I wanted to add a Font Data Type but I dont know how to do that. i have checked in this list : c4d.GetCustomDataTypeDefault() but I don't found the font data type.

            Thanks again.

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

              On 14/12/2016 at 17:41, xxxxxxxx wrote:

              https://developers.maxon.net/docs/py/2023_2/modules/c4d/CustomDataType/FontData/index.html

              I guess it's that but not sure 😉

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

                On 15/12/2016 at 02:26, xxxxxxxx wrote:

                Hi,

                Here's how to simply create a FontData user data:

                import c4d
                  
                bc = c4d.GetCustomDatatypeDefault(c4d.FONTCHOOSER_DATA)
                bc[c4d.DESC_NAME] = 'FontUserData'
                bc[c4d.DESC_SHORT_NAME] = 'FontUD'
                  
                op.AddUserData(bc)
                c4d.EventAdd()
                

                To enable the font size popup:

                bc[c4d.FONTCHOOSER_ENABLE_SIZE] = True
                
                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 16/12/2016 at 07:14, xxxxxxxx wrote:

                  Thank you guys for your help.

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