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

    GetDirty(DIRTYFLAGS_MATRIX)

    Cinema 4D SDK
    3
    10
    1.3k
    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.
    • SamirGFXS
      SamirGFX
      last edited by

      Hi I have stumbled on a strange problem while calling the object GetDirty(DIRTYFLAGS_MATRIX).
      The return value is always updated when I toggle the object visibility in either the VP or in render
      from the object manager. My problem is that I'm currently checking whether the children of my generator
      have changed and when they do, I tell the generator to recalculate it's output but because
      GetDirty(DIRTYFLAGS_MATRIX) is updated every time a child visibility is toggled the generator
      does an unnecessary update that I would like to avoid. I'm using R19 SDK.

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        could you be more verbose about the kind of object you are using ? For example mograph's object are really special, almost always dirty.
        Please also, take a loog at our guidelines to use the forum's functionalities (specially the tags)
        I'm pretty sure you are talking about python, that information is useful.

        Also, sharing some code (if you can) will help us to reproduce the issue.

        Are you using a python generator or you are creating your own plugin and your own NodeData ?

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • SamirGFXS
          SamirGFX
          last edited by

          Hi,

          Thanks for the reply.
          I'm talking about a c++ generator but it also happens in Python. There is really no need to share any code,
          Just print the GetDirty(DIRTYFLAGS_MATRIX) using python after you toggle the object visibility in the object manager
          and watch it produce a different number every time.

          1 Reply Last reply Reply Quote 0
          • ManuelM
            Manuel
            last edited by Manuel

            hi,

            SetDirty(DIRTYFLAGS::MATRIX); is called when you change the editor or render mode.
            I need to ask our tech team if somebody remember the reason for that.

            Cheers,
            Manuel

            MAXON SDK Specialist

            MAXON Registered Developer

            1 Reply Last reply Reply Quote 0
            • SamirGFXS
              SamirGFX
              last edited by

              Hi,
              Thanks. Waiting for your reply.

              1 Reply Last reply Reply Quote 0
              • SamirGFXS
                SamirGFX
                last edited by

                Hi Manuel,
                Any updates on this?

                1 Reply Last reply Reply Quote 0
                • ManuelM
                  Manuel
                  last edited by Manuel

                  hi,

                  we are in the week of our summit 2021, answer may take longer 🙂

                  there's no really workaround expect tracking all the child object's state for the viewport/render mode and check by yourself if those have changes.
                  Depending on what you want to do it could even be worst than rebuilding your cache.

                  edit : this code have been there for more than 14 years.

                  Cheers,
                  Manuel

                  MAXON SDK Specialist

                  MAXON Registered Developer

                  1 Reply Last reply Reply Quote 0
                  • SamirGFXS
                    SamirGFX
                    last edited by

                    Hi,
                    Thanks, that seems like a bug to me, I mean the matrix should not be flagged as dirty on object visibility change.
                    Any chance this could be fixed?
                    Thanks.

                    1 Reply Last reply Reply Quote 0
                    • fwilleke80F
                      fwilleke80
                      last edited by

                      To have dirty checks behave exactly the way you want it, you might simply store and compare the matrix or data of objects yourself.
                      That's what I usually do, and it frees you from all blackbox behavior.

                      www.frankwilleke.de
                      Only asking personal code questions here.

                      1 Reply Last reply Reply Quote 0
                      • ManuelM
                        Manuel
                        last edited by

                        Hi,

                        sorry but, we don't have enough ressources to investigate why it have been coded that way 14 years ago and what could be the side effect on changing it.

                        Cheers,
                        Manuel

                        MAXON SDK Specialist

                        MAXON Registered Developer

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