Public Member Functions
RendererContext Class Reference

## Detailed Description

This object is provided as the context object in the Renderer callbacks for a Plugin-based cus_render Custom Renderer object.

See also:
  PluginRegistrar::RegisterRenderer

Since:
  6.0

`#include <xsi_renderercontext.h>`

Inheritance diagram for RendererContext:
[legend]

List of all members.

## Public Member Functions
| RendererContext ()
| ~RendererContext ()
| RendererContext (const CRef &in_ref)
| RendererContext (const RendererContext &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
RendererContext & | operator= (const RendererContext &in_obj)
RendererContext & | operator= (const CRef &in_ref)
CTime | GetTime () const
unsigned int | GetSequenceIndex () const
unsigned int | GetSequenceLength () const
CStatus | ProgressUpdate (const CString &in_strProgressShort, const CString &in_strProgressLong, int in_iPercentage)
CStatus | NewFrame (unsigned int in_uiWidth, unsigned int in_uiHeight)
CStatus | NewFragment (const RendererImageFragment &in_fragment)
CStatus | TriggerEvent (siEventID in_eEventID, siRenderingType in_eRenderingType, const CTime &in_rTime, const CStringArray &in_filenames, siRenderFieldType in_eFieldType, siRenderingErrorType in_eRenderErrorType)
Property | GetRendererProperty (const CTime &in_rTime)
Framebuffer | GetDisplayFramebuffer ()
CRefArray | GetFramebuffers ()
CStatus | SetObjectClean (const CRef &in_ref)

## Constructor & Destructor Documentation

RendererContext | ( |  | ) |

Default constructor.

~RendererContext | ( |  | ) |

Default destructor.

RendererContext | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  in_ref | constant reference object.

RendererContext | ( | const RendererContext & | in_obj | ) |

Copy constructor.

Parameters:

  in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const`[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from Context.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Reimplemented from Context.

RendererContext& operator= | ( | const RendererContext & | in_obj | ) |

Creates an object from another object.

Parameters:

  in_obj | constant class object.

Returns:
  The new RendererContext object.

RendererContext& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  in_ref | constant class object.

Returns:
  The new RendererContext object.

Reimplemented from Context.

CTime GetTime | ( |  | ) | const

Returns the time at which the render process is occurring. The renderer should use this to set the evaluation time for the scene data being rendered. In the case of field rendering, or motion blurring, this time should be used as the base for which to derive other time stops.

Returns:
  The time at which the current frame is being rendered.

Since:
  6.01

unsigned int GetSequenceIndex | ( |  | ) | const

Returns the zero-based index of the frame being rendered within the rendered sequence. The sequence starts at zero and counts in ascending order. For single-frame renders, this function always returns zero. For sequence renders the highest value is always one less than the return value of RendererContext::GetSequenceLength.

Returns:
  The sequence index of the current frame.

Since:
  6.01

unsigned int GetSequenceLength | ( |  | ) | const

Returns the length of the sequence being rendered. For single frames, this function always returns 1.

Returns:
  The number of frames in the sequence currently being rendered.

Since:
  6.01

CStatus ProgressUpdate | ( | const CString & | in_strProgressShort,
|  | const CString & | in_strProgressLong,
|  | int | in_iPercentage
| ) |  |

Notifies XSI as to what the current status of the rendering process is.

Parameters:

  in_strProgressShort | Short progress message (when using the small progress bar).
  in_strProgressLong | Longer progress message (when using the big progress bar or the render viewer).
  in_iPercentage | The percentage of the job done, if it can be indicated, or -1

Returns:
  CStatus::OK

Since:
  6.01

CStatus NewFrame | ( | unsigned int | in_uiWidth,
|  | unsigned int | in_uiHeight
| ) |  |

Notifies the render manager that a new frame is about to be sent to whichever render viewer might be listening for frame fragments. In the case of field rendering, both frames should be sent to the viewer.

Parameters:

  in_uiWidth | The width of the new frame (needs to be the same as the value of the `ImageWidth` context parameter).
  in_uiHeight | The height of the new frame (needs to be the same as the value of the `ImageHeight` context parameter).

Returns:
  CStatus::OK

Since:
  6.01

CStatus NewFragment | ( | const RendererImageFragment & | in_fragment | ) |

Passes back a new frame fragment to the render manager. See RenderImageFragment for more details.

Return values:

  in_fragment | The new RenderImageFragment

Returns:
  CStatus::OK

Since:
  6.01

CStatus TriggerEvent | ( | siEventID | in_eEventID,
|  | siRenderingType | in_eRenderingType,
|  | const CTime & | in_rTime,
|  | const CStringArray & | in_filenames,
|  | siRenderFieldType | in_eFieldType,
|  | siRenderingErrorType | in_eRenderErrorType
| ) |  |

Triggers a specific render event. At the moment only siOnBeginFrame, siOnEndFrame, siOnBeginSequence, siOnEndSequence and siOnRenderAbort are supported.

Parameters:

  in_eEventID | The event being called.
  in_eRenderingType | The type of rendering being performed.
  in_rTime | The time at which the render event is occurring. Only relevant for siOnBeginFrame and siOnEndFrame.
  in_filenames | The list of filenames being rendered out. In case of siOnBeginSequence and siOnEndSequence these should be time-independent filenames, which can be accessed by calling Framebuffer::GetResolvedPath with no parameters.
  in_eFieldType | The field being rendered, or siRenderFieldNone if not rendering fields.
  siRenderingErrorType | The type of error for siOnRenderAbort, defaults to siRenderNoError.

Returns:
  CStatus::OK The event was sent successfully.
  CStatus::Abort The render was aborted while the event was being processed or the event requested an abort. The render should abort immediately at this point with a status code of CStatus::Fail.

Since:
  6.01

Property GetRendererProperty | ( | const CTime & | in_rTime | ) |

Returns the renderer's option property evaluated at a specific time. Which particular property instance this is, is dependent upon who triggered the render (pass, region, shaderballs, etc.)

Parameters:

  in_rTime | The time to evaluate the property at.

Returns:
  The evaluated renderer option property.

Since:
  6.01

Framebuffer GetDisplayFramebuffer | ( |  | ) |

Returns the Framebuffer object whose contents should be sent back as an image fragment to the render manager via RendererContext::NewFragment. If the Framebuffer object is not valid then no fragments are needed for viewing (for example when doing a command-line render or archive export). The display framebuffer also dictates the bit depth which the RenderImageFragment object should return its fragment data as. The object returned by this function is not guaranteed to be found in the list of Framebuffer objects returned by GetFramebuffers.

Returns:
  The Framebuffer object selected for viewing.

Since:
  6.01

CRefArray GetFramebuffers | ( |  | ) |

Returns all Framebuffer objects that should be rendered for the current frame.

Returns:
  An array of references to Framebuffer objects.

Since:
  6.01

CStatus SetObjectClean | ( | const CRef & | in_ref | ) |

Marks the given object from the dirty list as being clean. This only affects the next call to the renderer's cb_Renderer_Process Process callback, if the render got aborted and restarted. It does not update the copy of the dirty list, retrieved from Context::GetAttribute. It's up to the caller to ensure they stay synchronised during the callback.

This call is used to ensure that if the render gets restarted, for example due to a parameter values change, that the renderer does not have to re-update its copy of scene data that it considers 'clean'. The dirty list is cleared by Softimage upon the completion of a successful render.

Note:
  If the renderer gets called with a 'full' list (i.e. the "DirtyList" attribute is not defined), then the renderer should call this with an empty CRef object once the scene has been syncrhonised. Any attempts to clear out individual items with a "full" list will otherwise result in a "full" list still being given on next render. It is up to the renderer in this case to keep a map of which objects it has synchronised with, perhaps using the "RenderID" attribute to associate a synchronisation map with the current render.

Note:
  If an object was changed by the user during the Process callback, it will show up in the next call, whether it got marked clean or not.

Parameters:

  in_ref | The object to mark as clean and remove from the dirty list for the next call to the cb_Renderer_Process Process callback.

Since:
  9.0 (2011)

The documentation for this class was generated from the following file:

- xsi_renderercontext.h