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

    Message telling that a tag is about to be deleted

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 699 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 02/08/2012 at 08:21, xxxxxxxx wrote:

      Is there any way to know, inside a TagData plugin that the tag is about to deleted? Or that the tag is being moved from one object to another?

      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 04/08/2012 at 04:49, xxxxxxxx wrote:

        I believe it is a bit hard to look into the future what the
        user is about to be doing:)

        Occasionally I've used a hidden check tag that is added
        by the main tag.
        The check tag is looking for the main tag and is filled
        with selected data from it.
        If then the main tag is deleted, the check tag do what it
        should based on selected data before deleting itself.

        Cheers
        Lennart

        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 04/08/2012 at 05:02, xxxxxxxx wrote:

          I was asking this because, for example, in RealBasic, when a user closes a window, that windows receives an event telling that it is about to be closed so that we can decide what to do before actually closing the window.
          I hoped that tags or objects could also receive that type of event message.
          But your solution works, of course. It is just more complex 😉
          Thank you,

          Rui Batista

          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 04/08/2012 at 06:16, xxxxxxxx wrote:

            Originally posted by xxxxxxxx

            Is there any way to know, inside a TagData plugin that the tag is about to deleted?

            Yes. TagData is derived from NodeData, which has a Free() function. The C++ SDK says that Free() is:
            'Called when a node instance is deallocated. You can use this to for example deallocate member variables of your node data class.'

            So when the tag is about to be deleted, you get a call to Free() which you can override and do what you need. One thing you can't do as far as I can see is actually prevent the deletion.

            For when a tag is moved to another object, you would have to poll the tag and check to see if its owner had changed.

            Steve

            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 04/08/2012 at 07:09, xxxxxxxx wrote:

              Ok, thank you very much, Steve. This is a great help 🙂

              Rui Batista

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

                When I try to access the object where the tag is attached with:

                def Free(self,node) :
                     obj=node.GetObject()
                     print obj
                     return

                I always get None. Isn't there a way to know what object the tag is attached before deleting it?

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

                  Well, I solved it by storing the current object that holds the tag inside the tag container, in the Execute method 😉

                  Rui Batista

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