ChangeQueue
ReferencesBase class for ChangeQueue. Generally used by render plugins to build interactive updating of scenes that are being rendered.
Constructors
ChangeQueue
#Construct a new ChangeQueue using the given CreatePreviewEventArgs. The preview scene for these args will be used to populate the world.
Parameters:
| pluginId (Guid) | Id of plugin instantiating ChangeQueue |
| createPreviewEventArgs (CreatePreviewEventArgs) |
ChangeQueue
#[CLSCompliant(false)]
protected ChangeQueue(Guid pluginId, uint docRuntimeSerialNumber, ViewInfo viewinfo, bool bRespectDisplayPipelineAttributes)
Construct a new ChangeQueue from the given document
Parameters:
| pluginId (Guid) | Id of plugin instantiating ChangeQueue |
| docRuntimeSerialNumber (uint) | |
| viewinfo (ViewInfo) | |
| bRespectDisplayPipelineAttributes (bool) | Determines whether the display pipeline attributes for this viewport should be taken into account when supplying data. If you are using this queue to populate a scene for the "Render" command, set this to false. If you are using it to draw a realtime preview, you will probably want to set it to true. |
ChangeQueue
#[CLSCompliant(false)]
protected ChangeQueue(Guid pluginId, uint docRuntimeSerialNumber, ViewInfo viewinfo, DisplayPipelineAttributes attributes, bool bRespectDisplayPipelineAttributes, bool bNotifyChanges)
Construct a new ChangeQueue from the given document, using given display pipeline attributes.
Parameters:
| pluginId (Guid) | Id of plugin instantiating ChangeQueue |
| docRuntimeSerialNumber (uint) | |
| viewinfo (ViewInfo) | |
| attributes (DisplayPipelineAttributes) | Display pipeline attributes to use. |
| bRespectDisplayPipelineAttributes (bool) | Determines whether the display pipeline attributes for this viewport should be taken into account when supplying data. If you are using this queue to populate a scene for the "Render" command, set this to false. If you are using it to draw a realtime preview, you will probably want to set it to true. |
| bNotifyChanges (bool) | Determines whether you want to receive updates when the model changes. If you are rendering for a view capture, print or something similar, you will probably want to set this to false. |
Properties
Get the DisplayPipelineAttributes if available, null otherwise
Return true if this ChangeQueue is created for preview rendering. No view was set for preview rendering.
Methods
ApplyClippingPlaneChanges
#protected virtual void ApplyClippingPlaneChanges(Guid[] deleted, List<ClippingPlane> addedOrModified)
Override this when you want to handle clippingplane changes
Parameters:
| deleted (Guid[]) | |
| addedOrModified (List<ClippingPlane>) |
ApplyDisplayPipelineAttributesChanges
#protected virtual void ApplyDisplayPipelineAttributesChanges(DisplayPipelineAttributes displayPipelineAttributes)
Override if you need to react to display attribute changes. This function is needed to be able to react to different sample settings for i.e. capture preview rendering.
Parameters:
| displayPipelineAttributes (DisplayPipelineAttributes) | The changed DisplayPipelineAttributes. |
ApplyDynamicClippingPlaneChanges
#Override this when you want to handle dynamicclippingplane changes
Parameters:
| changed (List<ClippingPlane>) |
ApplyDynamicObjectTransforms
#protected virtual void ApplyDynamicObjectTransforms(List<DynamicObjectTransform> dynamicObjectTransforms)
Handle dynamic object transforms
Parameters:
| dynamicObjectTransforms (List<DynamicObjectTransform>) |
ApplyEnvironmentChanges
#Override this when you want to handle environment changes
Parameters:
| usage (RenderEnvironment.Usage) |
ApplyGroundPlaneChanges
#protected virtual void ApplyGroundPlaneChanges(GroundPlane gp)
Override this when you want to handle groundplane changes
Parameters:
| gp (GroundPlane) |
ApplyLightChanges
#Override this when you want to handle light changes
Parameters:
| lightChanges (List<Light>) |
ApplyLinearWorkflowChanges
#Override this when you want to handle linear workflow changes
Parameters:
| lw (LinearWorkflow) |
ApplyMaterialChanges
#Override when you want to handle material changes
Parameters:
| mats (List<Material>) | List of ChangeQueue::Material that have changed |
ApplyMeshChanges
#Override this when you want to handle mesh changes.
ApplyMeshInstanceChanges
#[CLSCompliant(false)]
protected virtual void ApplyMeshInstanceChanges(List<uint> deleted, List<MeshInstance> addedOrChanged)
Override this when you want to handle mesh instance changes (block instances and first-time added new meshes)
Parameters:
| deleted (List<uint>) | |
| addedOrChanged (List<MeshInstance>) |
ApplyRenderSettingsChanges
#Override this when you want to handle render setting changes. These are for the viewport settings.
Parameters:
| settings (DisplayRenderSettings) |
ApplyRenderSettingsChanges
#Override this when you need to handle background changes (through RenderSettings)
Parameters:
| rs (RenderSettings) |
ApplySkylightChanges
#protected virtual void ApplySkylightChanges(Skylight skylight)
Override this when you want to handle skylight changes
Parameters:
| skylight (Skylight) |
ApplySunChanges
#protected virtual void ApplySunChanges(Light sun)
Override this when you want to handle sun changes
Parameters:
| sun (Light) |
ApplyViewChange
#Override ApplyViewChange when you want to receive changes to the view/camera
Parameters:
| viewInfo (ViewInfo) | The ViewInfo with the changes |
Compare to ViewInfo instances and decide whether they are equal or not. If you need to change the way the comparison is done you can override this function and implement your custom comparison.
BakeFor
#Override this if you need to control baking behavior for textures. By default bake everything.
BakingSize
#Override this if you need to control the size of the baked bitmaps for textures. By default the value returned is 2048.
Parameters:
| ro (RhinoObject) | |
| material (RenderMaterial) | |
| type (TextureType) |
ContentRenderHash
#[CLSCompliant(false)]
protected virtual uint ContentRenderHash(RenderContent content, CrcRenderHashFlags flags, string excludeParameterNames, LinearWorkflow lw)
Override this if you need to modify the way render hashes are calcuated in the change queue. This will alter the way materials are grouped.
Parameters:
| content (RenderContent) | |
| flags (CrcRenderHashFlags) | |
| excludeParameterNames (string) | |
| lw (LinearWorkflow) |
public static void ConvertCameraBasedLightToWorld(ChangeQueue changequeue, Light light, ViewInfo vp)
Convert given (camera-based) light to a world-based light (in-place)
Parameters:
| changequeue (ChangeQueue) | |
| light (Light) | |
| vp (ViewInfo) |
Helper function to get a CRC from a Guid.
Parameters:
| guid (Guid) |
Signal the queue to do the initialisation of the queue, seeding it with the content currently available.
Parameters:
| bFlushWhenReady (bool) | Set to true CreateWorld should automatically flush at the end. Note that the Flush called when true is passed doesn't apply changes. |
Get RenderEnvironment for given RenderHash. Can return null.
Parameters:
| crc (uint) |
Returns: RenderEnvironment if render hash gives a match, null otherwise
Get the RenderEnvironment from the ChangeQueue content cache from the original instance id
Parameters:
| id (Guid) | The original instance id |
Returns: RenderEnvironment
Get RenderEnvironment RenderHash for given usage.
Parameters:
| usage (RenderEnvironment.Usage) |
public void Flush()
Tell the ChangeQueue to flush all collected events. This can trigger a host of Apply* calls. The following is the order in which those calls get made if there are changes for that specific data type: ApplyViewChange ApplyLinearWorkflowChanges ApplyDynamicObjectTransforms ApplyDynamicLightChanges ApplyRenderSettingsChanges ApplyEnvironmentChanges (background) ApplyEnvironmentChanges (refl) ApplyEnvironmentChanges (sky) ApplySkylightChanges ApplySunChanges ApplyLightChanges ApplyMaterialChanges ApplyMeshChanges ApplyMeshInstanceChanges ApplyGroundPlaneChanges ApplyClippingPlaneChanges
public GroundPlane GetQueueGroundPlane()
Get groundplane known to the queue at the time of the Flush
Get render settings known to the queue at the time of the Flush
Get the scene bounding box
Returns: Scene bounding box
public Skylight GetQueueSkylight()
Get skylight known to the queue at the time of the Flush
Get view known to the queue at the time of the Flush
Returns: ViewInfo
Get the RenderMaterial from the ChangeQueue material cache based on RenderHash
Parameters:
| crc (uint) | The RenderHash |
Returns: RenderMaterial
Get the RenderMaterial from the ChangeQueue material cache from the original instance id
Parameters:
| id (Guid) | The original instance id |
Returns: RenderMaterial
NotifyBeginUpdates
#protected virtual void NotifyBeginUpdates()
Override this when you want to be notified of begin of changes
NotifyDynamicUpdatesAreAvailable
#protected virtual void NotifyDynamicUpdatesAreAvailable()
Override this when you want to be notified dynamic updates are available
NotifyEndUpdates
#protected virtual void NotifyEndUpdates()
Override this when you want to be notified when change notifications have ended.
public void OneShot()
Call Flush() once, after that automatically dispose the queue.
Return the collection of original document instance ids assocaited with the Environment id.
Parameters:
| crc (uint) | The Environment id |
Return the collection of original document instance ids assocaited with the material id.
Parameters:
| crc (uint) | The material id |
Return the collection of original document instance ids assocaited with the Texture id.
Parameters:
| crc (uint) | The Texture id |
ProvideOriginalObject
#Override ProvideOriginalObject and return true if you want original objects supplied with ChangeQueue.Mesh. This will then also allow access to the Attributes.UserData of the original object from which the Mesh was generated.
public void RefreshMaterials()
Signal the queue to refresh all of the materials in the scene.
Get RenderTexture for given RenderHash. Can return null.
Parameters:
| crc (uint) | render hash of the content to search for |
Returns: RenderTexture if found for render hash, null otherwise
Get the RenderTexture from the ChangeQueue content cache from the original instance id
Parameters:
| id (Guid) | The original instance id |
Returns: RenderTexture