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

    Button in a TagData dialog. Possible?

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 701 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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 22/07/2012 at 03:01, xxxxxxxx wrote:

      I know that I can place a button in a dialog for a TagData plugin.
      But I can only override the Draw, Execute and AddToExecution methods.
      Shouldn't I have a Command method to check for GUI elements?
      How can I check if a button is pressed in the tag dialog?

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 22/07/2012 at 04:12, xxxxxxxx wrote:

        You need to override the Message() function and look for messages of type 'MSG_DESCRIPTION_COMMAND'. You then get the DescriptionCommand structure and look for the ID of the button that was clicked in that.

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 22/07/2012 at 04:50, xxxxxxxx wrote:

          Ok, I got it working, kind of...
          When I print data, I get:

          {'id': (1007, 8, 1028854)}

          This means that it is a dict object, right?
          So, when I do:

          print data['id']

          I get (1007, 8, 1028854)

          The 1007 is the ID of the button. The 8, I assume that it is the type of GUI element, or something. The 1028854 is the ID of my tag.
          So, how do I get the individual elements. It seems like a vector but I can't get the ID of the button with data'id'
          So, how do we access those elements?

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 22/07/2012 at 06:13, xxxxxxxx wrote:

            data['id'].id 😉

            -Nik

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

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 22/07/2012 at 07:53, xxxxxxxx wrote:

              When I try something like:

              bt=data['id'].id

              it returns the error:

              AttributeError: 'c4d.DescID' object has no attribute 'id'

              😞

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

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 22/07/2012 at 08:11, xxxxxxxx wrote:

                There's an example in the Python docs:

                  
                def Message(self, node, type, data) :   
                    if type==c4d.MSG_DESCRIPTION_COMMAND:   
                        if data['id'][0].id==THE_BUTTON_ID:   
                            print "Pushed button with command ID", THE_BUTTON_ID   
                    return True   
                
                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                  On 22/07/2012 at 09:02, xxxxxxxx wrote:

                  Once again, thank you 🙂
                  These things are so poorly documented 😞

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

                    THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                    On 22/07/2012 at 14:25, xxxxxxxx wrote:

                    Uups, I'm sorry. Missed the [0] part. 😞

                    -Niklas

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