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

    Set/GetWorldPluginData and SPLINE

    Scheduled Pinned Locked Moved SDK Help
    3 Posts 0 Posters 313 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 13/07/2011 at 06:44, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R10-R12 
      Platform:   Windows  ;   Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      In my plugin, the user can store the current settings to be used as default using SetWorldPluginData().  And they are retrieved for a new instance (in Init()) using GetWorldPluginData().  All of the values are stored and retrieved except for the SPLINE customgui/customdatatype settings.  It comes up empty when the plugin data is retrieved and applied to the plugin container.  How do I do this?

      In Message for MSG_DESCRIPTION_COMMAND, the user can store the current settings:

      DescriptionCommand* dc = static_cast<DescriptionCommand*>(data);  
      BaseObject* op = static_cast<BaseObject*>(node);  
      if (!dc)    return;  
      LONG id =    dc->id[0].id;  
      // Save As User Default Settings  
      if (id == COLLISIONDEFORMER_SETDEFAULT)  
      {  
        // Set a World Preference from this object's BaseContainer settings  
         SetWorldPluginData(ID_COLLISIONDEFORMER_OBJ, op->GetData(), TRUE);  
      }
      

      And when a new plugin object is created, I do this in the Init() :

      BaseContainer*    bc =    ((BaseList2D* )node)->GetDataInstance();  
      if (!bc)                            return FALSE;  
      BaseContainer*    wbc =    GetWorldPluginData(ID_COLLISIONDEFORMER_OBJ);  
      if (!wbc)  
      {  
        FactoryReset(bc);  
        return;  
      }  
      // General  
      // ... Other settings retrieved (and working)  
      // - Bulge Shape (Spline)  
      // ... Doing this to see if it needs initialization before retrieval (?)  
      GeData        d(CUSTOMDATATYPE_SPLINE, DEFAULTVALUE);  
      SplineData*    sd =    (SplineData* )d.GetCustomDataType(CUSTOMDATATYPE_SPLINE);  
      if (sd)  
      {  
        sd->MakeLinearSpline(2L);  
        sd->SetRound(1.0);  
      }  
      bc->SetData(COLLISIONDEFORMER_BSHAPE,        d);  
      bc->SetData(COLLISIONDEFORMER_BSHAPE,        wbc->GetData(COLLISIONDEFORMER_BSHAPE));
      
      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 15/07/2011 at 12:41, xxxxxxxx wrote:

        Hello and Bump?

        Really no idea how to do this?  I have not been able to do this successfully yet.  Yeah, it works during the session but if I close and restart C4D, nothing shows up in the SPLINE.  I've even tried breaking down the BaseContainer entries into another container for SetWorldPluginData(). Nothing.  Could be that the information is being saved and it is not being setup or initialized into the SPLINE CustomGui properly.  No idea.  Need help.

        Thanks,

        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 22/07/2011 at 04:48, xxxxxxxx wrote:

          I can confirm this strange behaviour. The container itself seems to be saved and there is an entry under the ID of your spline data but it's empty and returns DA_NIL for its data type.

          I will report this.

          cheers,
          Matthias

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