RenderPipeline

public abstract class RenderPipeline : IDisposable
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.
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.
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

ConfirmationSeconds

#Since v5.0
public int ConfirmationSeconds { set; }
Sets the number of seconds that need to elapse during rendering before the user is asked if the rendered image should be saved.

PlugIn

#Since v5.0
public PlugIn PlugIn { get; }

RenderSessionId

#Since v5.11
public Guid RenderSessionId { get; }
Get the Id associated with this render session, this is useful when looking up Rhino.Render.RenderPanels.

Methods

AddLightToScene

#
protected virtual bool AddLightToScene(LightObject light)
light (LightObject)

AddRenderMeshToScene

#
protected virtual bool AddRenderMeshToScene(RhinoObject obj, Material material, Mesh mesh)
obj (RhinoObject)
material (Material)
mesh (Mesh)

CloseWindow

#Since v5.11
public bool CloseWindow()
Closes the render window associated with this render instance.
Return true if successful or false if not.

CommandResult

#Since v5.0
public Result CommandResult()

ContinueModal

#
protected abstract bool ContinueModal()
Frequently called during a rendering by the frame work in order to determine if the rendering should continue.
Returns true if the rendering should continue.

Dispose

#Since v5.0
public void Dispose()

Dispose

#
protected virtual void Dispose(bool isDisposing)
isDisposing (bool)

GetRenderWindow

#Since v5.0
public RenderWindow GetRenderWindow()
Get the RenderWindow associated with this RenderPipeline instance. This is virtual rather than abstract for V5 compat
RenderWindow if one exists, null otherwise (i.e. rendering has already completed).

GetRenderWindow

#Since v6.0
public RenderWindow GetRenderWindow(bool withWireframeChannel, bool fromRenderViewSource)
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.
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.
RenderWindow if one exists, null otherwise (i.e. rendering has already completed).

GetRenderWindow

#Since v6.0
public RenderWindow GetRenderWindow(bool withWireframeChannel)
As GetRenderWindow(), but if withWireframeChannel is true the returned RenderWindow will have the channel added.
withWireframeChannel (bool)
RenderWindow with wireframe channel enabled, or null if no RenderWindow can be found (i.e. rendering has completed already)

GetRenderWindow

#Since v7.19
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
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.
RenderWindow if one exists, null otherwise (i.e. rendering has already completed).

GetRenderWindow

#Since v7.11
public RenderWindow GetRenderWindow(ViewportInfo viewportInfo, bool fromRenderViewSource)
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
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.
RenderWindow if one exists, null otherwise (i.e. rendering has already completed).

GetRenderWindowFromRenderViewSource

#Since v6.0
public RenderWindow GetRenderWindowFromRenderViewSource(bool fromRenderViewSource)
Like GetRenderWindow(), but with the size for RenderWindow set from RenderViewSources if fromRenderViewSource is set to true
fromRenderViewSource (bool)true if
RenderWindow if one exists, null otherwise (i.e. rendering has already completed).

IgnoreRhinoObject

#
protected virtual bool IgnoreRhinoObject(RhinoObject obj)
obj (RhinoObject)

LocalizeRenderReturnCode

#Since v7.1
public static string LocalizeRenderReturnCode(RenderReturnCode rc)

NeedToProcessGeometryTable

#
protected virtual bool NeedToProcessGeometryTable()

NeedToProcessLightTable

#
protected virtual bool NeedToProcessLightTable()

OnRenderBegin

#
protected abstract bool 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

#
protected virtual bool OnRenderBeginQuiet(Size imageSize)
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.
imageSize (Size)

OnRenderEnd

#
protected abstract void OnRenderEnd(RenderEndEventArgs e)
Called by the framework when the user closes the render window or clicks on the stop button in the render window.
e (RenderEndEventArgs)

OnRenderWindowBegin

#
protected abstract bool OnRenderWindowBegin(RhinoView view, Rectangle rectangle)
view (RhinoView)
rectangle (Rectangle)

PauseRendering

#Since v6.0
public virtual void PauseRendering()
Implement to pause the current render session

Render

#Since v5.0
Call this function to render the scene normally. The function returns when rendering is complete (or cancelled).
A code that explains how rendering completed.

RenderEnterModalLoop

#
protected virtual bool RenderEnterModalLoop()

RenderExitModalLoop

#
protected virtual bool RenderExitModalLoop()

RenderPreCreateWindow

#
protected virtual bool RenderPreCreateWindow()

RenderSceneWithNoMeshes

#
protected virtual bool RenderSceneWithNoMeshes()

RenderSize

#Since v5.0 Obsolete v6.4
public static Size RenderSize()

RenderSize

#Since v6.0
public static Size RenderSize(RhinoDoc doc, bool fromRenderSources)
Get the render size as specified in the ON_3dmRenderSettings, and from RenderSources when fromRenderSources is true.
doc (RhinoDoc)
fromRenderSources (bool)
The render size.

RenderSize

#Since v6.0
public static Size RenderSize(RhinoDoc doc)
Get the render size as specified in the ON_3dmRenderSettings. Will automatically return the correct size based on the ActiveView or custom settings.
doc (RhinoDoc)
The render size.

RenderWindow

#Since v5.0
public RenderPipeline.RenderReturnCode RenderWindow(RhinoView view, Rectangle rect, bool inWindow)
Call this function to render the scene in a view window. The function returns when rendering is complete (or cancelled).
view (RhinoView)the view that the user selected a rectangle in.
rect (Rectangle)rectangle that the user selected.
inWindow (bool)true to render directly into the view window.
A code that explains how rendering completed.

ResumeRendering

#Since v6.0
public virtual void ResumeRendering()
Implement to resume current render session

SaveImage

#Since v5.14
public bool SaveImage(string fileName, bool saveAlpha)
Saves the rendered image to a file. Does not prompt the user in any way.
fileName (string)Full path to the file name to save to.
saveAlpha (bool)Determines if alpha will be saved in files that support it (e.g., PNG).

SetAsyncRenderContext

#Since v6.0
public void SetAsyncRenderContext(ref AsyncRenderContext aRC)
aRC (ref AsyncRenderContext)

SupportsPause

#Since v6.0
public virtual bool SupportsPause()
Override and return true if the renderer supports pausing
true if pausing is supported, false otherwise