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
    • Recent
    • Tags
    • Users
    • Login

    When to refresh a deformer object?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 370 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 01/03/2011 at 02:37, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12 
      Platform:   Windows  ; Mac  ;  
      Language(s) :     C++  ;

      ---------
      In the descriptions of my deformer object, I have a link field. Now I want the deformer to be recalculated when the linked object is moved or changed. Currently, nothing happens. ModifyObject() is not called when I do something outside the deformer's hierarchy.

      I would try to add the linked object to a dependence list, but that doesn't work outside GetVirtualObjects().

      Thanks for help!

      Greetings,
      Jack

      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 01/03/2011 at 03:09, xxxxxxxx wrote:

        Could you look for MSG_DESCRIPTION_CHECKUPDATE in the Message() and then refresh from there?

        Or maybe continuously check to see if the BaseObject in your link field is not set to NULL, thus looking for a change in the linkfield..

        ~Shawn

        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 01/03/2011 at 03:37, xxxxxxxx wrote:

          You can check this in ObjectData::CheckDirty. It's called if the link changes.

          Here an example:

            
          void MyDeformer::CheckDirty(BaseObject *op, BaseDocument *doc)  
          {  
            if (!op || !doc) return;  
            
            BaseContainer *bc = op->GetDataInstance();  
            if (!bc) return;  
            ULONG dirtyness = 0;  
            
            // Get linked object  
            BaseObject    *lop = (BaseObject* )bc->GetLink(MYDEFORMER_LINK, doc, Obase);  
            if (!lop) return;  
            
            dirtyness += lop->GetDirty(DIRTYFLAGS_MATRIX|DIRTYFLAGS_DATA);  
            
            // lastlopdirty is member variable of type ULONG  
            if (dirtyness != lastlopdirty)  
            {  
                lastlopdirty = dirtyness;  
                op->SetDirty(DIRTYFLAGS_DATA);  
            }  
          }  
          

          Compare the dirty count and update accordingly (lastopdirty).

          cheers,
          Matthias

          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 01/03/2011 at 03:46, xxxxxxxx wrote:

            That works, thanks Matthias!
            I'll propably add some walking-up-the-hierarchy to check if parent have been moved.

            Cheers,
            Jack

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