Reset plugin preferences?



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

    On 14/10/2010 at 20:41, xxxxxxxx wrote:

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

    ---------

    How do I reset my plugin preferences?  I'm creating a filter export plugin, and my export dialog has some
    checkboxes which are unchecked.  I want them checked when the program starts up, but this isn't working:

      
    Bool   
    MySaverData::Init(GeListNode *node) {
     //BaseContainer *bc = ((BaseList2D* )node)->GetDataInstance(); // ??  
     //BaseContainer* bc = GetWorldPluginData(MY_PLUGIN_ID); // returns NULL!
     BaseSceneSaver *saver = (BaseSceneSaver* )node;  
     BaseContainer *bc = saver->GetDataInstance();  
     if(bc) {  
        bc->SetBool( MY_EXPORT_OPTION, TRUE );  // Doesn't work, option still unchecked  
        bc->SetLong( MY_EXPORT_OPTION, (LONG)1 );  // Doesn't work, option still unchecked  
        bc->SetData( MY_EXPORT_OPTION, GeData((LONG)1) ); // Doesn't work, option still unchecked  
     }
     return TRUE;  
    }  
    

    My resource .res file looks like:

      
    CONTAINER Fmy_export  
    {  
     NAME Fmy_export;  
     INCLUDE Fbase;  
     GROUP MY_EXPORT_GROUP  
     {  
      BOOL MY_EXPORT_OPTION { }  
     }  
    }  
    

    Also, I don't know where my preferences are saved on file.  There's a "Open Preferences Folder..." button,
    but the plugins directory in that folder is empty.  So, don't know how to delete them from file either.



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

    On 15/10/2010 at 03:14, xxxxxxxx wrote:

    Initializing the values in Init() like you can see in the STL im/exporter example works fine. Just note that once you changed the im/exporter settings they are saved with the preferences. You can delete the CINEMA 4D.prf file in the preferences folder to reset the preferences.

    cheers,
    Matthias



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

    On 16/10/2010 at 13:20, xxxxxxxx wrote:

    Thanks, but the STL plugin only has a unitscale selector, no checkboxes.  So, I tried adding some checkbox options to it,
    modified the STL .res, .h, and .str files appropriately, and they didn't show up.  Only the unitscale selector still showed.
    And I tried deleting the CINEMA 4D.prf file, but that didn't work either.  All of my filter's checkbox options are still unchecked.
    And I'm using the pluginID obtained from plugincafe, so my plugin preferences shouldn't conflict with any other
    plugin.



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

    On 16/10/2010 at 14:50, xxxxxxxx wrote:

    Well, ignore my last post, it's working now.  My checkboxes are now checked.  Thanks.
    Just a clarification question on Init() and CINEMA 4D.prf.
    Are you saying if my plugin preferences already exist in CINEMA 4D.prf, then any settings from Init() will be ignored?
    Or will Init() override existing plugin settings in CINEMA 4D.prf everytime?
    Also, I'm guessing Cinema4D saves preferences under your pluginID.  Would that mean if two plugins used the same
    pluginID, and the same resouce IDs, they could potentially corrupt each other's preferences?



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

    On 18/10/2010 at 02:02, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    Are you saying if my plugin preferences already exist in CINEMA 4D.prf, then any settings from Init() will be ignored?

    Or will Init() override existing plugin settings in CINEMA 4D.prf everytime?

    Yes, Init() will only initialize the prefs for the first time they are created.

    Also, I'm guessing Cinema4D saves preferences under your pluginID.  Would that mean if two plugins used the same
    pluginID, and the same resouce IDs, they could potentially corrupt each other's preferences?

    Yes, that could probably happen that's why plugin IDs have to be unique for each plugin.

    cheers,
    Matthias


Log in to reply