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

    Instant GetDirty

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 689 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 28/07/2012 at 05:11, xxxxxxxx wrote:

      I'm using the code:

      import c4d
      prev_state = -1

      def main() :
          global prev_state
          state = op.GetDirty(c4d.DIRTY_DATA)
          if state != prev_state:
              # parameters have changed!
          prev_state = state

      ...to check for the change of a polygonal object inside a Message method.
      It works fine except for the fact that, if I move the vertexes of the polygonal object, I only get a notification of it being "dirty" after I release the vertexes in the new position.
      Is it possible to be able to check in realtime if a polygonal object is being changed?

      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 28/07/2012 at 05:17, xxxxxxxx wrote:

        Have you tried checking for c4d.DIRTY_CACHE ?

        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 28/07/2012 at 05:59, xxxxxxxx wrote:

          Yes, and it is not working 😞

          Let me explain in general, what I'm trying to do.
          I created an ObjectData object.
          I want to update it whenever another object (a polygonal object) changes.
          This means that if I move the points of the polygonal object or if I move the polygonal object or if I deform the polygonal object, my ObjectData object gets updated.
          I placed the code that updates the ObjectData object inside the GetVirtualObjects method.
          It works fine but it is constantly updating the object, and that will eventually slow down the editor if I have many ObjectData objects in my scene.
          So, I just want them to update when that polygonal object changes.
          Is that possible?

          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 28/07/2012 at 06:05, xxxxxxxx wrote:

            Ok, I found out that what I really need is the c4d.DIRTY_DATA
            The problem resides in the fact that the Message method is not being called in real time.
            Could that be changed?

            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 28/07/2012 at 07:14, xxxxxxxx wrote:

              What you may need to do is poll the polygonal object in your GVO routine. If the object has changed, update your generated object. If it hasn't then don't.

              Unfortunately this does meand that you will have to keep track of the state of the polygonal object so you can see if it has changed.

              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 28/07/2012 at 07:26, xxxxxxxx wrote:

                Well, if I make the verification of c4d.DIRTY_DATA inside GetVirtualObjects, it is checked in realtime.
                However, I can't return with None if there wasn't any change because that would make my ObjectData object disappear.
                So, I must ALWAYS return something from GetVirtualObjects, in order to show something in the editor, right?

                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 28/07/2012 at 11:59, xxxxxxxx wrote:

                  In the grand scheme of things, we are supposed to use GetCache(hierarchyhelp)
                  for PyObject Generators (GetVirtualObject()) when "making" anything but true splines.
                  For True Splines we are supposed to use GetContour() and CheckDirty().

                  This actually works for sources that actually -do- return a Cache.
                  However, it all fall flat on its face as undeformed point objects in Py
                  - do not return any form of Cache - ! , and hence always are "dirty" forcing our
                  beloved Python Object Generators depending on extarnal sources do constantly update.

                  So until we have a -complete working example- to build from, we are out of luck.

                  Cheers
                  Lennart

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