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

    Belhaviour on tag delete

    SDK Help
    0
    8
    735
    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
      Helper
      last edited by

      On 15/11/2015 at 02:32, xxxxxxxx wrote:

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

      ---------
      Hi, one more question about tag and behaviors.
      I tried to perform search on forum but I can't find any help.

      I'm trying to reset my object visibility and position on tag delete ? I can't perform my actions when I create free method :

        
      virtual void Free(GeListNode* node);  
      

      This free method is executed but it can't catch object, probably because object is not longer connected to it.

      Thanks guys !!

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 15/11/2015 at 03:37, xxxxxxxx wrote:

        you may store the BaseObject* as a class member, use it on Free()

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 16/11/2015 at 04:46, xxxxxxxx wrote:

          Hello,

          please do not store and handle a pointer to a BaseObject in a Free() function. Cinema will allocate and free various instances of any entity, for example with the undo system. So Free() may be called many times, even it the tag is not removed from the host object. Also, do not store pointer to object since these pointer may become invalid for the same reasons. Always use a BaseLink.

          It seems that when a tag is removed from the object no special message is sent to the tag. Only the core message EVMSG_CHANGE is triggered and sent to MessageData plugins. So you could try to catch that message there and react accordingly.

          Best wishes,
          Sebastian

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 16/11/2015 at 05:45, xxxxxxxx wrote:

            Thanks MohamedSakr for your idea. I could be great but like S_Bach said the free function is called many time. And make my pointer crash ! I'm looking to the Message way. I'll post news here ! thanks for your helps guys !

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 16/11/2015 at 06:50, xxxxxxxx wrote:

              there is another solution, a hidden tag, this hidden tag will be attached with your tag, once your tag get deleted, hidden tag will notice this and will do whatever you want, I guess this should work

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 17/11/2015 at 02:49, xxxxxxxx wrote:

                So when my tag is created on my object I need to create a hidden tag so. And at every run cycle I should ask to my hidden tag if the normal tag exist ? But this way I need to add one extra tag and my execution time will be a bit slow...

                Hum, I'm trying, it's good idea but I'm not sure I will keep it !

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 17/11/2015 at 03:08, xxxxxxxx wrote:

                  execution time should be quite fast , it is just a single if statement

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    On 17/11/2015 at 03:56, xxxxxxxx wrote:

                    Yes your right ! As fast as a Switch from a message catcher. Your right, I'm a bit greedy with execution time !

                    Should I need to create a complete new plugin with new plugin ID to do that ?

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