RenderPipeline
Provides facilities to a render plug-in for integrating with the standard Rhino render window. Also adds helper functions for processing a render scene. This is the suggested class to use when integrating a renderer with Rhino and maintaining a "standard" user interface that users will expect.
Constructors
RenderPipeline
#protected RenderPipeline(RhinoDoc doc, RunMode mode, PlugIn plugin, Size sizeRendering, string caption, StandardChannels channels, bool reuseRenderWindow, bool clearLastRendering, ref AsyncRenderContext aRC)
Constructs a subclass of this object on the stack in your Rhino plug-in's Render() or RenderWindow() implementation. This constructor should be used when a non-blocking RenderWindow is required. Note that the asynchronous render context will not be used when mode is Scripted.
Parameters:
| doc (RhinoDoc) | A Rhino document. |
| mode (RunMode) | A command running mode, such as scripted or interactive. |
| plugin (PlugIn) | A plug-in. |
| sizeRendering (Size) | The width and height of the rendering. |
| caption (string) | The caption to display in the frame window. |
| channels (RenderWindow.StandardChannels) | The color channel or channels. |
| reuseRenderWindow (bool) | This parameter is obsolete. |
| clearLastRendering (bool) | true if the last rendering should be removed. Indicates that this render is being done using RenderQuiet(). It specifically makes sure the render mesh iterator does not display any progress user interface. |
| aRC (ref AsyncRenderContext) | The asynchronous render context to set |
RenderPipeline
#protected RenderPipeline(RhinoDoc doc, RunMode mode, PlugIn plugin, Size sizeRendering, string caption, StandardChannels channels, bool reuseRenderWindow, bool clearLastRendering)
Constructs a subclass of this object on the stack in your Rhino plug-in's Render() or RenderWindow() implementation.
Parameters:
| doc (RhinoDoc) | A Rhino document. |
| mode (RunMode) | A command running mode, such as scripted or interactive. |
| plugin (PlugIn) | A plug-in. |
| sizeRendering (Size) | The width and height of the rendering. |
| caption (string) | The caption to display in the frame window. |
| channels (RenderWindow.StandardChannels) | The color channel or channels. |
| reuseRenderWindow (bool) | This parameter is obsolete. |
| clearLastRendering (bool) | true If the last rendering should be removed. Indicates that this render is being done using RenderQuiet(). It specifically makes sure the render mesh iterator does not display any progress user interface. |
Finalizer
~RenderPipeline
#~RenderPipeline()
Properties
Sets the number of seconds that need to elapse during rendering before the user is asked if the rendered image should be saved.
Methods
AddLightToScene
#Parameters:
| light (LightObject) |
AddRenderMeshToScene
#Parameters:
| obj (RhinoObject) | |
| material (Material) | |
| mesh (Mesh) |
Closes the render window associated with this render instance.
Returns: Return true if successful or false if not.
ContinueModal
#Frequently called during a rendering by the frame work in order to determine if the rendering should continue.
Returns: Returns true if the rendering should continue.
public void Dispose()
Get the RenderWindow associated with this RenderPipeline instance. This is virtual rather than abstract for V5 compat
Returns: RenderWindow if one exists, null otherwise (i.e. rendering has already completed).
As GetRenderWindow(). The parameter withWireframeChannel controls whether the returned RenderWindow will have the channel added. The parameter fromRenderViewSource controls from where the RenderSize is queried.
Parameters:
| withWireframeChannel (bool) | true if the RenderWindow needs to have a wireframe channel. |
| fromRenderViewSource (bool) | true if the RenderWindow size needs to be set from RenderViewSource size. false will use the active view. |
Returns: RenderWindow if one exists, null otherwise (i.e. rendering has already completed).
As GetRenderWindow(), but if withWireframeChannel is true the returned RenderWindow will have the channel added.
Parameters:
| withWireframeChannel (bool) |
Returns: RenderWindow with wireframe channel enabled, or null if no RenderWindow can be found (i.e. rendering has completed already)
public RenderWindow GetRenderWindow(ViewportInfo viewportInfo, bool fromRenderViewSource, Rectangle region)
As GetRenderWindow(). The parameter withWireframeChannel controls whether the returned RenderWindow will have the channel added. The parameter fromRenderViewSource controls from where the RenderSize is queried. The viewportInfo instance will be used to set up wireframe channel. This is necessary for rendering different view than is currently active in the viewport
Parameters:
| viewportInfo (ViewportInfo) | ViewportInfo used to generate the wireframe channel |
| fromRenderViewSource (bool) | true if the RenderWindow size needs to be set from RenderViewSource size. false will use the active view. |
| region (Rectangle) | The region to render. Usually the same as the full render window but in the case of RenderWindow and RenderInWindow, it is the region the user selected in the viewport. |
Returns: RenderWindow if one exists, null otherwise (i.e. rendering has already completed).
As GetRenderWindow(). The parameter withWireframeChannel controls whether the returned RenderWindow will have the channel added. The parameter fromRenderViewSource controls from where the RenderSize is queried. The viewportInfo instance will be used to set up wireframe channel. This is necessary for rendering different view than is currently active in the viewport
Parameters:
| viewportInfo (ViewportInfo) | ViewportInfo used to generate the wireframe channel for |
| fromRenderViewSource (bool) | true if the RenderWindow size needs to be set from RenderViewSource size. false will use the active view. |
Returns: RenderWindow if one exists, null otherwise (i.e. rendering has already completed).
Like GetRenderWindow(), but with the size for RenderWindow set from RenderViewSources if fromRenderViewSource is set to true
Parameters:
| fromRenderViewSource (bool) | true if |
Returns: RenderWindow if one exists, null otherwise (i.e. rendering has already completed).
IgnoreRhinoObject
#Parameters:
| obj (RhinoObject) |
Parameters:
| rc (RenderPipeline.RenderReturnCode) |
OnRenderBegin
#Called by the framework when it is time to start rendering, the render window will be created at this point and it is safe to start
OnRenderBeginQuiet
#Called by the framework when it is time to start rendering quietly, there is no user interface when rendering in this mode and the default post process effects will get applied to the scene when the rendering is complete.
Parameters:
| imageSize (Size) |
OnRenderEnd
#Called by the framework when the user closes the render window or clicks on the stop button in the render window.
Parameters:
| e (RenderEndEventArgs) |
OnRenderWindowBegin
#public virtual void PauseRendering()
Implement to pause the current render session
Call this function to render the scene normally. The function returns when rendering is complete (or cancelled).
Returns: A code that explains how rendering completed.
Get the render size as specified in the ON_3dmRenderSettings, and from RenderSources when fromRenderSources is true.
Get the render size as specified in the ON_3dmRenderSettings. Will automatically return the correct size based on the ActiveView or custom settings.
Parameters:
| doc (RhinoDoc) |
Returns: The render size.
Call this function to render the scene in a view window. The function returns when rendering is complete (or cancelled).
public virtual void ResumeRendering()
Implement to resume current render session
Saves the rendered image to a file. Does not prompt the user in any way.
Parameters:
| aRC (ref AsyncRenderContext) |