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
    • Register
    • Login

    ExpressionPluginTag lose BaseContainer

    Scheduled Pinned Locked Moved SDK Help
    1 Posts 0 Posters 135 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 16/09/2005 at 18:08, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------

      Cafe Regular
      **

      Group: Members
      Posts: 87
      Joined: 10-January 05
      From: Denmark
      Member No.: 3,656

      I am having trouble keeping passed variables in a dynamically created ExpressionPluginTag.

      The setup is as follows:

      I have a created a MenuPlugin with a dialog, that can receive dropped objects.
      Clicking a button creates a new object based on extracted data from the objects dropped into the MenuPlugin's dialog. Hereby, I can create multiple new objects by dropping new objects into the dialog and hitting the create button.

      The MenuPlugin also applies an ExpressionPluginTag, which are supposed to carry important informations, on the created object. As the ExpressionPluginTag is generated, variables, which are passed from the MenuPlugin, are stored in the BaseContainer of newly created ExpressionPluginTag. To ensure that this information is stored properly, I have overwritten the Load(), Save(), and Copy() functions like this:

      MyExpressionPluginTag::Save(hf)  
      {  
      var ct = GetContainer();  
      hf->WriteContainer(ct);  
      }  
        
      MyExpressionPluginTag::Load(hf)  
      {  
      var ct = hf->ReadContainer();  
      SetContainer(ct);  
      }  
        
      MyExpressionPluginTag::Copy(dest)  
      {  
      var ct = GetContainer();  
      dest->SetContainer(ct->GetClone());  
      }
      

      It all seems to work fine until I change the content of the dialog of the MenuPlugin by replacing or dropping new objects. In fact, even, if I just hover the dragged object over a drop area in the dialog and not dropping it, the code breaks.

      This means that the stored data in BaseContainer of ExpressionPluginTag is no longer stored, and the BaseContainer's ID has also changed.

      So basically the question is, how do you pass data from a MenuPlugin to an ExpressionPluginTag generated by the first, and keeping that data safe, even if the original data in the MenuPlugin changes?

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