Hi Paul,
Currently are the defaults hardcoded in the plugin or being read from a config file ? If hardcoded, you could change the plugin to read the defaults from a file at startup. The installer can install the defaults file to the
<DAZ Studio install path>\plugins\OctaneRender folder and then do the following:
On OctanePluginStart
{
CheckDefaultsFileAvailability();
OpenAndLoadDefaults();
}
CheckDefaultsFileAvailability() //To guarantee a defaults file is present in the %APPDATA%\OctaneRender\ folder
{
Does
%APPDATA%\OctaneRender\Defaults file Exists ?
If yes,
----Validate the file; If valid, return //If XML, parse XML, if SQLite, run query to validate the db or write file checksum to registry (at install time and whenever updated) and verify it on load
If file does not exists or not valid, copy
<DAZ Studio install path>\plugins\OctaneRender\Defaults file to
%APPDATA%\OctaneRender\ folder.
}
OpenAndLoadDefaults()
{
Open
%APPDATA%\OctaneRender\ Defaults file and initialize the plugin setting.
}
The above will guarantee that the defaults file is always available in the
%APPDATA%\OctaneRender\ folder at the plugin startup.
Then put a "Set As Default" button in the
Rendersettings and
Environment tabs which will write the current settings of that tab to the Defaults file in the
%APPDATA%\OctaneRender\ folder.
This way whatever the users of the plugin save as defaults will be there in the
%APPDATA%\OctaneRender\ folder which will be read first when the plugin load. If the file gets corrupted or deleted the initial step of checking the file exists or not and is valid or not will copy over the file from the install folder to the
%APPDATA%\OctaneRender\ folder if needed.
When a scene is opened, the plugin can check if the scene file has any render / environment settings saved within it or not, if not, it can show the defaults loaded from the defaults file in
%APPDATA%\OctaneRender\ folder otherwise show whatever was saved with the scene.
Regards,
Rajib