Preview¶
ILxPreviewService¶
-
class
ILxPreviewService
¶ The Preview SDK API allows a plug-in to create and perform headless, interactive Preview renders. The Preview service is solely for the purpose of creating a preview object.
Public Functions
-
LxResult
CreatePreview
(LXtObjectID self, void **ppvObj)¶
-
LxResult
GetMeshPreview
(LXtObjectID self, LXtObjectID item, int width, int height, void **ppvObj)¶
-
bool
NewPreview
(CLxLoc_Preview &preview)¶ User Class Only:
-
LxResult
ILxPreview¶
-
class
ILxPreview
¶ The Preview SDK API allows a plug-in to create and perform headless, interactive Preview renders. The Preview service is solely for the purpose of creating a preview object.
Public Functions
-
LxResult
Start
(LXtObjectID self)¶ The first method will start a Preview rendering. The Preview could either be stopped or paused. If it’s neither, this will have no effect.
-
LxResult
Stop
(LXtObjectID self)¶ And this method will stop it.
-
LxResult
Pause
(LXtObjectID self)¶ Alternatively, we can pause the Preview. This stops rendering, but a future start will not clear the image and will resume where it left off, unless the scene has been updated.
-
LxResult
Reset
(LXtObjectID self)¶ This function will both set Preview such that the next time it starts, it will do a full update, completely rebuilding all the render data and tableau from scratch.
-
LxResult
SetRes
(LXtObjectID self, int width, int height)¶ This method is used to set the resolution of a Preview render. If Preview is currently rendering, it will stop and restart Preview once it has updated the resolution.
-
LxResult
SetRenderTime
(LXtObjectID self, double time)¶ Sets what time to render at. Currently this calls select.time but might change in future to render at a different time
-
LxResult
SetQuality
(LXtObjectID self, int quality, int samples)¶ This method is used to set the quality of a Preview render.
-
LxResult
SetMotionBlur
(LXtObjectID self, int enable)¶ Sets whether to render motion blur or not
-
LxResult
SetRenderAllOutputs
(LXtObjectID self, int enable)¶ Sets whether to render all outputs or just do a final color output
-
LxResult
SetUseAllThreads
(LXtObjectID self, int enable)¶ Sets whether to use all threads or not.
-
LxResult
SetStereo
(LXtObjectID self, int enable, int eye)¶ Set whether the Preview should render in stereo or not.
-
LxResult
SetNotifier
(LXtObjectID self, LXtObjectID notifier)¶ This function takes a ILxPreviewNotifier object, which will get notified when a new image is available.
-
LxResult
SetAlpha
(LXtObjectID self, int enable)¶ Sets if Preview should set the alpha channel
-
LxResult
UseCameraOverride
(LXtObjectID self, int useCameraOverride)¶ Is used to enable/disable per preview camera overrides. If enabled, preview specific camera attributes will be used in place of attributes specific by a camera item in the scene. If disabled then the camera attributes are got from a camera item. Camera overrides allow us to change the camera settings without changing the scene itself. The settings are per preview and so do not affect any other views of the Cinema. The SetCameraOverride set of preview methods are used for setting these preview specific fields.
-
LxResult
SetCameraOverrideTransform
(LXtObjectID self, const LXtMatrix4 transform)¶ Sets the camera matrix. This will only be used when ‘UseCameraOverride’ is enabled.
-
LxResult
SetCameraOverrideFocalLength
(LXtObjectID self, float focalLength)¶ Sets the field of view for a camera that is tied only to the preview. Setting this will not change the state of any camera items.
-
LxResult
SetCameraOverrideApertureX
(LXtObjectID self, float apertureX)¶ Sets the horizontal aperture for a camera that is tied only to the preview. Setting this will not change the state of any camera items.
-
LxResult
SetCameraOverrideApertureY
(LXtObjectID self, float apertureY)¶ Sets the vertical aperture for a camera that is tied only to the preview. Setting this will not change the state of any camera items.
-
LxResult
SetCameraOverrideProjectionType
(LXtObjectID self, int projectionType)¶ Sets the projection type of a camera that is tied only to the preview. Setting this will not change the state of any camera items. The projection type can be set to one of the following integers: PERSP 0 ORTHO 1 CYLINDRICAL 2 SPHERICAL 3
-
int
GetResWidth
(LXtObjectID self)¶ Get the current resolution width of a Preview render.
-
int
GetResHeight
(LXtObjectID self)¶ Get the current resolution height of a Preview render.
-
double
GetCurrentTime
(LXtObjectID self)¶ Returns what frame preview is currently being rendered.
-
LxResult
IsComplete
(LXtObjectID self)¶ Query whether the render is complete. It returns LXe_TRUE or LXe_FALSE;
-
LxResult
GetBuffer
(LXtObjectID self, void **ppvObj)¶ And finally, we can get the current state of the rendering image. The client must release this object once it’s done.
-
bool
GetImage
(CLxLoc_Image &image)¶ User Class Only:
-
LxResult
-
LXiPREVIEW_DRAFT_QUALITY
¶ It also takes in the number of average AA samples to be fired per pixel. If the value is zero or negative, it will use the default values. Typically this is something like MAX (64, renderSettings) for draft mode, renderSettings for final mode, and some really high number (currently 16384) for extended mode.
LXiPREVIEW_FINAL_QUALITY
LXiPREVIEW_EXTENDED_QUALITY
ILxPreviewNotifier¶
-
class
ILxPreviewNotifier
¶ This is the PreviewNotifier interface class that users can implement to get notified when a preview image is availble.
Public Functions
-
LxResult
Notify
(LXtObjectID self, const LXtRenderOutputProcess *rndrProcess, LXtObjectID image, int completed)¶
-
LxResult