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

    Check if the object parameters has been changed

    Cinema 4D SDK
    python
    3
    6
    916
    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.
    • mfersaouiM
      mfersaoui
      last edited by mfersaoui

      Hello,

      The following line of code is supposed returning True only if parameters of the object changed? But why it also returning True when my object selected and I Move / Scale / Zoom / rotate the perspective view.

      # dirty = True if a cache is dirty or if the data (any parameters) of the object changed.
      dirty = op.CheckCache(hh) or op.IsDirty(c4d.DIRTY_DATA)
      

      Thanks.

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by

        Hi @mfersaoui thanks for writing us.

        The following line of code is supposed returning True only if parameters of the object changed?

        That's partially true: the expression can be True also if the object's cache is dirty

        But why it also returning True when my object selected and I Move / Scale / Zoom / rotate the perspective view.

        That's weird and to answer here you've to show how you're using it with the rest of your ObjectData::GetVirtualObjects() method.

        Best, R

        mfersaouiM 1 Reply Last reply Reply Quote 0
        • ferdinandF
          ferdinand
          last edited by ferdinand

          Hi,

          I am a bit confused about @r_gigante answer, I might be misunderstanding something here.

          BaseObject.GetCache will return the hierarchical cache tree for an object or None if neither the object nor its cache children has a cache.

          Since objects (in a pythonic sense) do evaluate as True, your expression will evaluate in 99% of the cases as True. The natural language version of the expression would be: Has the object been touched or has itself or one of its cache children a cache? You are probably missing a not/ negation in your expression.

          Cheers,
          zipit

          MAXON SDK Specialist
          developers.maxon.net

          r_giganteR 1 Reply Last reply Reply Quote 0
          • r_giganteR
            r_gigante @ferdinand
            last edited by

            @zipit: I'm a bit confused of your remarks here as well 🤣
            In my answer I see no reference to BaseObject::GetCache() here and looking at the documentation of both methods reported in the initial boolean expression, to answer first @mfersaoui's question, it results to be True if the cache is dirty or any object's parameter has become dirty.

            Cheers, R

            ferdinandF 1 Reply Last reply Reply Quote 0
            • ferdinandF
              ferdinand @r_gigante
              last edited by

              @r_gigante

              jeah, my bad, happens when you write stuff on the train. I was mixing up BaseObject.CheckCache with GetCache.

              Cheers,
              zipit

              MAXON SDK Specialist
              developers.maxon.net

              1 Reply Last reply Reply Quote 0
              • mfersaouiM
                mfersaoui @r_gigante
                last edited by mfersaoui

                Hi, Thank you @r_gigante, @zipit for your replies.

                The problem comes from the GetDDescription funtion because I use some of dynamic parameters on my objects.
                It is for this reason that op.IsDirty(c4d.DIRTY_DATA) returning True when I Move, Scale, Zoom or Rotate the perspective view.

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