What is the correct (preferred) way to store data for custom render engine?
As far I can see I have at least three options:
Store it in a custom container and read/write it during plugin ReadDocument/WriteDocument functions.
Store as UserData (Rhino.RhinoDoc.ActiveDoc.RenderSettings.UserData)
And in the example “SampleCsCustomRednerSettingsSections” in the code it stores it in a data object (wich comes somehow from IRdkViewModel???):
GetData(Rhino.UI.Controls.DataSource.ProviderIds.RhinoSettings, false, true) as RhinoSettings;
I am really not sure where it saves the data actually…
Hi, the simplest way is to use plug-in settings. Here is how the Raytraced mode saves settings for the Cycles render engine:
RcPlugin is the plug-in object for my plug-in:
While you are integrating your engine, please have a look at the ChangeQueue to build upon. This is the preferred way to start integrating your engine.
Let me know if you have any further questions regarding render engine integration, we’ll happily assist you as much as we can. (Didn’t notice I was using my personal account when writing above reply).
It is not only sample code, it is the entire implementation of the Raytraced mode (: a reference implementation for render engine integration, if you will.
The sample code more or less shows global settings (application-wide). You’ll have to come up with a model that uses custom UserData your plug-in knows how to handle. See https://github.com/mcneel/rhino-developer-samples/tree/6/rhinocommon/cs/SampleCsUserData for user custom user data sample code. Note then that you want to put them on the render settings as custom user data.