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

    Actions on tag deletion

    SDK Help
    0
    4
    263
    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

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 11/11/2004 at 21:58, xxxxxxxx wrote:

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

      ---------
      I want to perform an action when one of my plugin tags is deleted from the document. There do not seem to be any Messages sent to the TagData when deletion occurs, so I stuck some code in Free() as shown below:

        
      void MorphMixerTag::Free(GeListNode *node)  
      {  
           GePrint("MorphMixerTag.Free");  
           // Ask user whether or not to reset morphs on delete  
           if (QuestionDialog(IDS_MMT_QUESTION))  
           {  
                // Get Polygonal Object receiving morphs, return if not  
                opBC = ((BaseTag* )node)->GetDataInstance();  
                lastIndex = opBC->GetLong(MORPHMIXER_LASTINDEX);  
                // Set slider to 0.0  
                for (index = MORPHMIXER_MORPHOFFSET; index != lastIndex; index++)  
                {  
                     opBC->SetReal(index, 0.0);  
                     DirectlyMorph();  
                }  
           }  
        
           if (morphs) GeFree(morphs);  
           if (desc) Description::Free(desc);  
      }  
      

      The operation after a TRUE QuestionDialog return doesn't appear to be performed and I get several more QuestionDialogs when exiting C4D. My suspicion is that these are from Undo copies being deleted since there is only one having been deleted (?).

      Is this possible? If not, I already have alternative methods in place.

      Thanks,
      Robert

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 12/11/2004 at 12:08, xxxxxxxx wrote:

        Hmm, seems to work fine for me here. The code after the questiondialog is executed for me.

        void TestTag::Free(GeListNode* node)
        {
             if(QuestionDialog("test"))
             {
                  GePrint("hallo");
             }
        }

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 12/11/2004 at 14:42, xxxxxxxx wrote:

          I wasn't getting any effect (reset of sliders). It's possible that by this stage, the node's BaseContainer or other data is no longer valid, so best to scrap this idea.

          I have gone the alternate route for several reasons. The first is that this would cause complications when removing all the tags (getting a dialog for each one unless somehow circumvented). The second is that closing document issue. Third is that deleting the selection with a button avoids these issues and makes it more user-friendly.

          Thanks,
          Robert

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

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 14/11/2004 at 10:52, xxxxxxxx wrote:

            As you've noticed, doing stuff in the Free() function is not recommended since you have no control over how many instances of your class that are created beside the instances in the document. So your alternate route sounds good.

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