I am trying to better understand the best practice method for a renderer plugin setting Render Properties on a Document. Our rendering plugin would ideally want to set some of the document render properties to a specific value if the document is new or made from a template.
While we could set them on Open, we don’t want to modify the values if the user has specifically changed them to something else, only the default values. Is there a way to differentiate between the EndOpenDocument event on opening a template when New was requested vs a standard open?
Despite our renderer plugin returning false if SupportsFeature is called with LinearWorkflow the document render properties enable Gamma correction, Linear Workflow and set the Gamma to 2.2. When rendering it adds a final pass with the Gamma correction which in our case we don’t want since this is handled internally.
The other properties such as Sun and Sky get correctly removed from the renderer settings when we return false in the SupportsFeature call. Not sure if that is a bug or we are misunderstanding these properties. It seems specific to Rhino 7.
Right now the user would need to edit their templates to change the default, however that would then apply to all renderers. If looks like we can’t prevent Rhino adding the Gamma correction to our plugin renderer.
Any thoughts (besides the fact that ideally we’d support the internal Rhino linear workflow which isn’t an option for now unfortunately)?
I have just committed a change into Rhino 7.7 (you’ll be able to get the release candidate next Wednesday) which disables the automatic gamma adjustment post effect when the renderer doesn’t support linear workflow.
In order to remove the UI for the linear workflow, you should override RenderSettingsSections in your CRhRdkRenderPlugIn class, call the base class and remove uuidRenderSettingsSection_ColorAdjustment_Eto and uuidRenderSettingsSection_ColorAdjustment.
Thank you, we’ll check it out when available. Regarding the RenderSettingsSections, is there an equivilant for RhinoCommon rendering plugins? Ours is not RDK based, would that be DocumentPropertiesDialogPages?
I am now getting consistent behaviour between the viewport and production render, without the gamma applied as I would expect. So looks to be working to me.
We are in a similar situation, but with a difference. We would like to have Rhino gamma when we do the render in the Render Window, but we don’t want it when we do the render in the viewport.
Unfortunately we can switch on/off linearworkflow for our Render plugin but not selectively.
Is it possible to do it selectively?
I can see that Rhino calls
override bool SupportsFeature(RenderFeature feature)
many times, so maybe if I would know when to return false and when to return true it is possible to achieve what I want, but I was not able to find the correct pattern.
It would be also good to be able to add/remove the final-pass effects programmatically. Is it possible?
And another note/question:
What is the situation with the material preview? There it seems gamma is always ON.