Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Attribute Manamger Update Delay When Description Added Dynamically

    Cinema 4D SDK
    python r23
    4
    15
    2.0k
    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.
    • beatgramB
      beatgram @Cairyn
      last edited by beatgram

      @Cairyn Thank you again for helping me.
      Yep, SetDirty(c4d.DIRTYFLAGS_DESCRIPTION) works like a charm! 👍

          def Message(self, node, type, data):
              if type == c4d.MSG_DESCRIPTION_COMMAND:
                  if data["id"][0].id == c4d.TTESTTAG_ADD_BUTTON:
                      bc = c4d.GetCustomDataTypeDefault(c4d.DTYPE_BASELISTLINK)
                      self.links_list.append(bc)
                      node.SetDirty(c4d.DIRTYFLAGS_DESCRIPTION)  # This was needed!
              return True
      

      I'm sorry but I'm not sure what you mean about float fields for 2nd to 4th "Add". On my end, my code adds link fields everytime user click the Add button.
      Let me know if my understanding is wrong.

      CairynC 1 Reply Last reply Reply Quote 0
      • M
        mp5gosu
        last edited by

        By the way, it is also worth mentioning the Note on MSG_CHANGE

        beatgramB 1 Reply Last reply Reply Quote 0
        • beatgramB
          beatgram @mp5gosu
          last edited by

          @mp5gosu Oh I couldn't find that. Thank you for your heads up!

          1 Reply Last reply Reply Quote 0
          • CairynC
            Cairyn @beatgram
            last edited by

            @beatgram I changed some parts of the code since I was wondering about a few details, so this may be solely on my side. Do you have a ttesttag.h file that you don't show, and a .str file? For my test, I created these files (plugin didn't start without). That may have created some differences.

            beatgramB 1 Reply Last reply Reply Quote 0
            • beatgramB
              beatgram @Cairyn
              last edited by

              @Cairyn Okay, here's my .h / .str files. Sorry, I should have shared these in the first post.

              ttesttag.h

              #ifndef _TTESTTAG_H_
              #define _TTESTTAG_H_
              
              enum
              {
                  TTESTTAG_LINKS_GROUP = 1001,
                  TTESTTAG_ADD_BUTTON = 1002,
                  TTESTTAG_REMOVE_BUTTON = 1003,
              }
              
              #endif
              

              ttesttag.str

              STRINGTABLE Ttesttag
              {
                  Ttesttag "Test Tag";
                  TTESTTAG_LINKS_GROUP "";
                  TTESTTAG_ADD_BUTTON "Add";
                  TTESTTAG_REMOVE_BUTTON "Remove";
              }
              
              CairynC 1 Reply Last reply Reply Quote 0
              • CairynC
                Cairyn @beatgram
                last edited by

                @beatgram Ah yes, that makes sense that these files exist. It doesn't explain the phenomenon though, since I chose precisely the same numeric values...

                I believe C4D is doing something in the background with these files, otherwise you wouldn't be able to write c4d.TTESTTAG_LINKS_GROUP - this is not a constant that C4D defines, so somehow it is generated in the header parsing process. I suppose I need to look into that, although the original question has been answered now 😉

                beatgramB 1 Reply Last reply Reply Quote 0
                • beatgramB
                  beatgram @Cairyn
                  last edited by

                  @Cairyn Interesting investigation but it's a bit difficult for newbie like me. 🙄
                  Anyway, I appreciate your help!

                  1 Reply Last reply Reply Quote 0
                  • M
                    m_adam
                    last edited by

                    Hi @beatgram so far nothing to add from our side, what @Cairyn said is the correct way to proceed with node.SetDirty(c4d.DIRTYFLAGS_DESCRIPTION).

                    Regarding ttesttag.h and more generally about resources in Cinema 4D.
                    They are parsed during the startup of Cinema 4D, due to a bug currently if you change the content of the file it will not update it and you will need to update the symbolcache for more information about it see Dealing with Symbolcache.

                    However, I can't really explain why it was creating float description and not DTYPE_BASELISTLINK, if you are able to reproduce the issue please share the whole project so we can look at it. And except if you override the value of DTYPE_BASELISTLINK I don't see any valid reason for the Python symbol parser to produce the change.

                    Cheers,
                    Maxime.

                    MAXON SDK Specialist

                    Development Blog, MAXON Registered Developer

                    beatgramB 1 Reply Last reply Reply Quote 0
                    • beatgramB
                      beatgram @m_adam
                      last edited by

                      @m_adam Thank you for confirming.
                      I already know symbolcache thingy, so it's no problem.

                      1 Reply Last reply Reply Quote 0
                      • M
                        m_adam
                        last edited by

                        Hi with the latest update of Cinema 4D (R24 SP1),
                        any update to a description files should now be reflected correctly to the symbolcache files, so it's not needed to delete it manually anymore.

                        Cheers,
                        Maxime.

                        MAXON SDK Specialist

                        Development Blog, MAXON Registered Developer

                        beatgramB 1 Reply Last reply Reply Quote 0
                        • beatgramB
                          beatgram @m_adam
                          last edited by beatgram

                          @m_adam Oh, that's a little update for many users but huge for tiny developers like me!
                          Thank you so much for the heads up. 😳

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