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

    Bitmap Button

    Cinema 4D SDK
    python
    2
    14
    2.6k
    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.
    • merkvilsonM
      merkvilson
      last edited by merkvilson

      I tried this way and it kinda works. but let's assume that I want to scale the sphere object from my object generator plugin. It works only if I'm updating the render settings or reloading python plugins. Is it possible to update it according to the DIRTY FLAGS of the object generator plugin?

      let me know if I'm doing something wrong.

      1 Reply Last reply Reply Quote 0
      • S
        s_bach
        last edited by

        Hello,

        you could set DIRTYFLAGS_DESCRIPTION after an interaction with the TEST_SLIDER parameter (e.g. in SetDParameter or after MSG_DESCRIPTION_POSTSETPARAMETER). That should update the description.

        best wishes,
        Sebastian

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        merkvilsonM 1 Reply Last reply Reply Quote 1
        • merkvilsonM
          merkvilson @s_bach
          last edited by

          @s_bach

          SetDParameter seems to be easier but seems like I'm doing something wrong. Can you provide a code snippet, how to do this properly?

          1 Reply Last reply Reply Quote 0
          • merkvilsonM
            merkvilson
            last edited by

            I'm probably doing something wrong.

                def SetDParameter(self, node, id, t_data, flags) :   
            
                    if id[0].id == c4d.TEST_SLIDER:
                        node.SetDirty(c4d.DIRTYFLAGS_DESCRIPTION)
            
            
            1 Reply Last reply Reply Quote 0
            • S
              s_bach
              last edited by

              Hello,

              it seems to work better if you change the dirty status of the bitmap. Something like this:

              def GetDParameter(self, node, id, flags):
                  if id[0].id == c4d.THE_BITMAP_BUTTON:
                      data = c4d.BitmapButtonStruct(node, id, self.bmp.GetDirty())
                      return (True, data, flags | c4d.DESCFLAGS_GET_PARAM_GET)
                  
                  return True
              
              def SetDParameter(self, node, id, t_data, flags):
              
                  if id[0].id == c4d.THE_OTHER_PARAMETER:
                      self.bmp.SetDirty()
                      node.SetDirty(c4d.DIRTYFLAGS_DATA)
              
                  return False
              

              best wishes,
              Sebastian

              MAXON SDK Specialist

              Development Blog, MAXON Registered Developer

              1 Reply Last reply Reply Quote 1
              • merkvilsonM
                merkvilson
                last edited by merkvilson

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • merkvilsonM
                  merkvilson
                  last edited by

                  This post is deleted!
                  1 Reply Last reply Reply Quote 0
                  • merkvilsonM
                    merkvilson
                    last edited by merkvilson

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • merkvilsonM
                      merkvilson
                      last edited by merkvilson

                      btw, is it possible to prevent the description from constant updates during manipulating the slider and set the DIRTYFLAGS when the slider is already set to the desired value?
                      Seems like C4D's material preview is capable of detecting time intervals between manipulations and if the interval is not high enough, no update takes place. Should I import pythons datetime or maybe it is possible to accomplish this task directly from c4d's module?

                      1 Reply Last reply Reply Quote 0
                      • merkvilsonM
                        merkvilson
                        last edited by

                        This goes off topic so I'll make a new post.

                        The main issue is already solved, thanks to Sebastian! 💙

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