RenderMeshProvider
ReferencesA RenderMeshProvider delivers custom render primitives (in the form of RenderMeshes). Derive a public class from this with a public constructor, and this primitive provider will be added to the RDK forming a collection of providers. Each RenderMeshProvider::HasCustomRenderMeshes will be called and if it returns true, a call to RenderMeshes will be made. It is up to the provider to cache its own primitives - the IRenderMeshes::ProviderTracking class is provided for that. A provider may optionally return a collection of non-object Ids that it will provide custom render primitives for. An example of this is Grasshopper, which which will typically return a collection of the Ids of each CustomPreview component. Override this class if you are a plug-in developer intending to supply a custom set of primitives for a given object, or objectId. Examples of IRenderMeshProviders are CurvePiping, EdgeSoftening, Displacement, Shutlining, Grasshopper's CustomPreview component.
Finalizer
Fields
Properties
The localized name of the provider for UI display.
A provider may optionally return a collection of non-object Ids that it will provide custom render primitives for. An example of this is Grasshopper, which which will typically return a collection of the Ids of each CustomPreview component.
Methods
Dispose
#Dispose method. Note that you should only ever call Dispose if you explicitly registered this RenderMeshProvider using RegisterProvider If this provider was created using automatic registration, the Dispose function will thrown an exception.
Parameters:
| isDisposing (bool) |
Runtime access to specific parameters on for a given objectId relating to this primitive provider.
public abstract bool HasCustomRenderMeshes(MeshType mt, ViewportInfo vp, RhinoDoc doc, Guid objectId, ref Flags flags, PlugIn plugin, DisplayPipelineAttributes attrs)
Determine if custom render primitives will be supplied for a particular object.
Parameters:
| mt (MeshType) | The mesh type to provide meshes for |
| vp (ViewportInfo) | The viewport being rendered |
| doc (RhinoDoc) | The Rhino document associated with the objectId |
| objectId (Guid) | The objectId for which the primitives should be supplied. |
| flags (ref RenderMeshProvider.Flags) | See RenderMeshProvider.Flags. This is an in/out parameter: set RenderMeshProvider.Flags.Incomplete on return if the meshes supplied are provisional because asynchronous work has not finished. |
| plugin (PlugIn) | The requesting plug-in - typically the render plug-in requesting the primitives. |
| attrs (DisplayPipelineAttributes) | The display attributes currently being used - nullptr if this is production rendering. |
Returns: True if RenderMeshes will return a set of primitives, otherwise false. RenderMeshes may still return an empty collection - in case of cancelation something similar.
Provides details on the progress of custom render meshes for a document or collection of objects
Returns a complete list of progress reports for all providers for either the document or a collection of objects
Register RenderMeshProvider without relying on the auto-plug-in registration.
Parameters:
| provider (RenderMeshProvider) | |
| plugin (PlugIn) |
Register RenderMeshProviders without relying on the auto-plug-in registration
Register RenderMeshProviders without relying on the auto-plug-in registration
Parameters:
| plugin (PlugIn) |
public abstract RenderMeshes RenderMeshes(MeshType mt, ViewportInfo vp, RhinoDoc doc, Guid objectId, List<InstanceObject> ancestry, ref Flags flags, RenderMeshes previousPrimitives, PlugIn plugin, DisplayPipelineAttributes attrs)
Returns a complete set of custom render primitives for a given ObjectId.
Parameters:
| mt (MeshType) | The mesh type to provide meshes for |
| vp (ViewportInfo) | The viewport being rendered |
| doc (RhinoDoc) | The Rhino document associated with the objectId |
| objectId (Guid) | The objectId for which the primitives should be supplied. |
| ancestry (List<InstanceObject>) | The ancestry of the object - ie, block references referring to this definition. This is only used to handle ByParent attributes, and should not be used to transform geometry. |
| flags (ref RenderMeshProvider.Flags) | See RenderMeshProvider.Flags. This is an in/out parameter: set RenderMeshProvider.Flags.Incomplete on return if the meshes supplied are provisional because asynchronous work has not finished. |
| previousPrimitives (RenderMeshes) | Optionally a custom set of initial primitives. If this parameter is empty, the standard render primitives for the object will be used, or an empty set of primitives will be used where they are not available. This is typically used in meshing exporters, which produce specific meshes for the output rather than using the render primitives. |
| plugin (PlugIn) | The requesting plug-in - typically the render plug-in requesting the meshes. |
| attrs (DisplayPipelineAttributes) | The display attributes currently being used - nullptr if this is production rendering. |