ChangeQueue

References
public abstract class ChangeQueue : IDisposable
Base class for ChangeQueue. Generally used by render plugins to build interactive updating of scenes that are being rendered.

Constructors

ChangeQueue

#
protected ChangeQueue(Guid pluginId, CreatePreviewEventArgs createPreviewEventArgs)
Construct a new ChangeQueue using the given CreatePreviewEventArgs. The preview scene for these args will be used to populate the world.
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
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.
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

DisplayPipelineAttributes

#Since v6.0
public DisplayPipelineAttributes DisplayPipelineAttributes { get; }
Get the DisplayPipelineAttributes if available, null otherwise

IsPreview

#Since v6.0
public bool IsPreview { get; }
Return true if this ChangeQueue is created for preview rendering. No view was set for preview rendering.

ViewId

#Since v6.0
public Guid ViewId { get; }
Return view ID for a RhinoDoc based ChangeQueue. Returns Guid.Empty if no view was associated with the changequeue, i.e. preview rendering.

Methods

ApplyClippingPlaneChanges

#
protected virtual void ApplyClippingPlaneChanges(Guid[] deleted, List<ClippingPlane> addedOrModified)
Override this when you want to handle clippingplane changes
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.
displayPipelineAttributes (DisplayPipelineAttributes)The changed DisplayPipelineAttributes.

ApplyDynamicClippingPlaneChanges

#
protected virtual void ApplyDynamicClippingPlaneChanges(List<ClippingPlane> changed)
Override this when you want to handle dynamicclippingplane changes
changed (List<ClippingPlane>)

ApplyDynamicLightChanges

#
protected virtual void ApplyDynamicLightChanges(List<Light> dynamicLightChanges)
Handle dynamic light changes
dynamicLightChanges (List<Light>)

ApplyDynamicObjectTransforms

#
protected virtual void ApplyDynamicObjectTransforms(List<DynamicObjectTransform> dynamicObjectTransforms)
Handle dynamic object transforms
dynamicObjectTransforms (List<DynamicObjectTransform>)

ApplyEnvironmentChanges

#
protected virtual void ApplyEnvironmentChanges(Usage usage)
Override this when you want to handle environment changes
usage (RenderEnvironment.Usage)

ApplyGroundPlaneChanges

#
protected virtual void ApplyGroundPlaneChanges(GroundPlane gp)
Override this when you want to handle groundplane changes
gp (GroundPlane)

ApplyLightChanges

#
protected virtual void ApplyLightChanges(List<Light> lightChanges)
Override this when you want to handle light changes
lightChanges (List<Light>)

ApplyLinearWorkflowChanges

#
protected virtual void ApplyLinearWorkflowChanges(LinearWorkflow lw)
Override this when you want to handle linear workflow changes
lw (LinearWorkflow)

ApplyMaterialChanges

#
protected virtual void ApplyMaterialChanges(List<Material> mats)
Override when you want to handle material changes
mats (List<Material>)List of ChangeQueue::Material that have changed

ApplyMeshChanges

#
protected virtual void ApplyMeshChanges(Guid[] deleted, List<Mesh> added)
Override this when you want to handle mesh changes.
deleted (Guid[])List of Guids to meshes that have been deleted
added (List<Mesh>)List of ChangeQueueMeshes that have been added or changed

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)
deleted (List<uint>)
addedOrChanged (List<MeshInstance>)

ApplyRenderSettingsChanges

#
protected virtual void ApplyRenderSettingsChanges(DisplayRenderSettings settings)
Override this when you want to handle render setting changes. These are for the viewport settings.
settings (DisplayRenderSettings)

ApplyRenderSettingsChanges

#
protected virtual void ApplyRenderSettingsChanges(RenderSettings rs)
Override this when you need to handle background changes (through RenderSettings)
rs (RenderSettings)

ApplySkylightChanges

#
protected virtual void ApplySkylightChanges(Skylight skylight)
Override this when you want to handle skylight changes
skylight (Skylight)

ApplySunChanges

#
protected virtual void ApplySunChanges(Light sun)
Override this when you want to handle sun changes
sun (Light)

ApplyViewChange

#
protected virtual void ApplyViewChange(ViewInfo viewInfo)
Override ApplyViewChange when you want to receive changes to the view/camera
viewInfo (ViewInfo)The ViewInfo with the changes

AreViewsEqual

#Since v6.0
public virtual bool AreViewsEqual(ViewInfo aView, ViewInfo bView)
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.
aView (ViewInfo)First ViewInfo to compare
bView (ViewInfo)Second ViewInfo to compare
true if the views are considered equal

BakeFor

#
[CLSCompliant(false)] protected virtual ChangeQueue.BakingFunctions BakeFor()
Override this if you need to control baking behavior for textures. By default bake everything.

BakingSize

#
protected virtual int BakingSize(RhinoObject ro, RenderMaterial material, TextureType type)
Override this if you need to control the size of the baked bitmaps for textures. By default the value returned is 2048.
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.
content (RenderContent)
flags (CrcRenderHashFlags)
excludeParameterNames (string)
lw (LinearWorkflow)

ConvertCameraBasedLightToWorld

#Since v6.0
public static void ConvertCameraBasedLightToWorld(ChangeQueue changequeue, Light light, ViewInfo vp)
Convert given (camera-based) light to a world-based light (in-place)
changequeue (ChangeQueue)
light (Light)
vp (ViewInfo)

CrcFromGuid

#Since v6.0
[CLSCompliant(false)] public static uint CrcFromGuid(Guid guid)
Helper function to get a CRC from a Guid.
guid (Guid)

CreateWorld

#Since v6.0
public void CreateWorld()
Calls CreateWorld with true passed.

CreateWorld

#Since v6.0
public void CreateWorld(bool bFlushWhenReady)
Signal the queue to do the initialisation of the queue, seeding it with the content currently available.
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.

Dispose

#Since v6.0
public void Dispose()
Dispose our ChangeQueue

Dispose

#
protected virtual void Dispose(bool isDisposing)
Dispose our ChangeQueue. Disposes unmanaged memory.
isDisposing (bool)

EnvironmentForid

#Since v6.0
[CLSCompliant(false)] public RenderEnvironment EnvironmentForid(uint crc)
Get RenderEnvironment for given RenderHash. Can return null.
crc (uint)
RenderEnvironment if render hash gives a match, null otherwise

EnvironmentFromOriginalInstanceId

#Since v8.5
public RenderEnvironment EnvironmentFromOriginalInstanceId(Guid id)
Get the RenderEnvironment from the ChangeQueue content cache from the original instance id
id (Guid)The original instance id
RenderEnvironment

EnvironmentIdForUsage

#Since v6.0
[CLSCompliant(false)] public uint EnvironmentIdForUsage(Usage usage)
Get RenderEnvironment RenderHash for given usage.
usage (RenderEnvironment.Usage)

Flush

#Since v6.0
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

GetQueueGroundPlane

#Since v6.0
public GroundPlane GetQueueGroundPlane()
Get groundplane known to the queue at the time of the Flush

GetQueueRenderSettings

#Since v6.0
public RenderSettings GetQueueRenderSettings()
Get render settings known to the queue at the time of the Flush

GetQueueSceneBoundingBox

#Since v6.0
public BoundingBox GetQueueSceneBoundingBox()
Get the scene bounding box
Scene bounding box

GetQueueSkylight

#Since v6.0
public Skylight GetQueueSkylight()
Get skylight known to the queue at the time of the Flush

GetQueueSun

#Since v6.0
public Light GetQueueSun()
Get sun known to the queue at the time of the Flush

GetQueueView

#Since v6.0
public ViewInfo GetQueueView()
Get view known to the queue at the time of the Flush
ViewInfo

MaterialFromId

#Since v6.0
[CLSCompliant(false)] public RenderMaterial MaterialFromId(uint crc)
Get the RenderMaterial from the ChangeQueue material cache based on RenderHash
crc (uint)The RenderHash
RenderMaterial

MaterialFromOriginalInstanceId

#Since v8.5
public RenderMaterial MaterialFromOriginalInstanceId(Guid id)
Get the RenderMaterial from the ChangeQueue material cache from the original instance id
id (Guid)The original instance id
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.

OneShot

#Since v6.0
public void OneShot()
Call Flush() once, after that automatically dispose the queue.

OriginalInstanceIdsFromEnvironmentId

#Since v8.23
[CLSCompliant(false)] public Guid[] OriginalInstanceIdsFromEnvironmentId(uint crc)
Return the collection of original document instance ids assocaited with the Environment id.
crc (uint)The Environment id

OriginalInstanceIdsFromMaterialId

#Since v8.23
[CLSCompliant(false)] public Guid[] OriginalInstanceIdsFromMaterialId(uint crc)
Return the collection of original document instance ids assocaited with the material id.
crc (uint)The material id

OriginalInstanceIdsFromTextureId

#Since v8.23
[CLSCompliant(false)] public Guid[] OriginalInstanceIdsFromTextureId(uint crc)
Return the collection of original document instance ids assocaited with the Texture id.
crc (uint)The Texture id

ProvideOriginalObject

#
protected virtual bool 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.

RefreshMaterials

#Since v9.0
public void RefreshMaterials()
Signal the queue to refresh all of the materials in the scene.

TextureForId

#Since v7.0
[CLSCompliant(false)] public RenderTexture TextureForId(uint crc)
Get RenderTexture for given RenderHash. Can return null.
crc (uint)render hash of the content to search for
RenderTexture if found for render hash, null otherwise

TextureFromOriginalInstanceId

#Since v8.5
public RenderTexture TextureFromOriginalInstanceId(Guid id)
Get the RenderTexture from the ChangeQueue content cache from the original instance id
id (Guid)The original instance id
RenderTexture