3ds Max C++ API Reference
ICameraContainer Class Referenceabstract

Abstracts the common properties of the camera to be rendered. More...

#include <ICameraContainer.h>

Classes

class  IChangeNotifier
 Notification callback interface for ICameraContainer. More...
 

Public Types

enum class  ProjectionType { Perspective , Orthographic }
 Camera projection types. More...
 

Public Member Functions

Camera Node/Object

Returns the camera node being used.

Will return null if a camera-less viewport is being rendered.

virtual INodeGetCameraNode () const =0
 Returns the physical camera being used, if one is being used at all - or null otherwise. More...
 
virtual IPhysicalCameraGetPhysicalCamera (const TimeValue t) const =0
 Returns the physical camera being used, if one is being used at all - or null otherwise. More...
 
Camera Projection
virtual MotionTransforms EvaluateCameraTransform (const TimeValue t, Interval &validity, const MotionBlurSettings *camera_motion_blur_settings=nullptr) const =0
 Evaluate the motion transform for the camera. More...
 
virtual ProjectionType GetProjectionType (const TimeValue t, Interval &validity) const =0
 Returns the projection type used by the camera. More...
 
virtual float GetPerspectiveFOVRadians (const TimeValue t, Interval &validity) const =0
 Returns the field-of-view of the camera, in radians. More...
 
virtual float GetOrthographicApertureWidth (const TimeValue t, Interval &validity) const =0
 Returns the width of the orthographic aperture, in system units. More...
 
virtual float GetOrthographicApertureHeight (const TimeValue t, Interval &validity) const =0
 Returns the height of the orthographic aperture, in system units. More...
 
Focus and Depth-of-Field
virtual bool GetDOFEnabled (const TimeValue t, Interval &validity) const =0
 Returns whether Depth-of-Field is enable on the camera. More...
 
virtual float GetLensFocalLength (const TimeValue t, Interval &validity) const =0
 Returns the focal length of the lends, in system units. More...
 
virtual float GetFocusPlaneDistance (const TimeValue t, Interval &validity) const =0
 Returns the distance to the focus plane, in system units. More...
 
virtual float GetLensApertureRadius (const TimeValue t, Interval &validity) const =0
 Returns the lens' aperture radius, in system units. More...
 
Clipping Planes
virtual bool GetClipEnabled (const TimeValue t, Interval &validity) const =0
 Returns the clipping planes are enabled. More...
 
virtual float GetClipNear (const TimeValue t, Interval &validity) const =0
 Returns the distance to the near clipping plane, in system units. More...
 
virtual float GetClipFar (const TimeValue t, Interval &validity) const =0
 Returns the distance to the far clipping plane, in system units. More...
 
Resolution, Region, and Bitmap
virtual IPoint2 GetResolution () const =0
 Returns the resolution of the image to be rendered. More...
 
virtual float GetPixelAspectRatio () const =0
 Returns the pixel aspect ratio of the image to be rendered. More...
 
virtual BitmapGetBitmap () const =0
 Returns the bitmap to which the image is to be rendered. More...
 
virtual Box2 GetRegion () const =0
 Returns the region to be rendered. More...
 
virtual Point2 GetImagePlaneOffset (const TimeValue t, Interval &validity) const =0
 Returns the X-Y offset of the canvas to be rendered, in the image planes, as number of pixels. More...
 
View Parameters
virtual const ViewGetView (const TimeValue t, Interval &validity) const =0
 Returns a View structure that may be passed GeomObject::GetRenderMesh(). More...
 
virtual ViewParams GetViewParams (const TimeValue t, Interval &validity) const =0
 Returns a ViewParams structure, initialize with the camera's properties. More...
 
Motion Blur
virtual MotionBlurSettings GetGlobalMotionBlurSettings (const TimeValue t, Interval &validity) const =0
 Returns the scene motion blur settings specified by the camera. More...
 
Notification

Registers a notifier callback, to be called when interactive changes occur.

virtual void RegisterChangeNotifier (IChangeNotifier &notifier) const =0
 Unregisters a notification callback, previously registered with RegisterChangeNotifier(). More...
 
virtual void UnregisterChangeNotifier (IChangeNotifier &notifier) const =0
 Unregisters a notification callback, previously registered with RegisterChangeNotifier(). More...
 

Protected Member Functions

virtual ~ICameraContainer ()
 Protected destructor prevents deletion through this interface. More...
 

Detailed Description

Abstracts the common properties of the camera to be rendered.

This container wraps and abstracts the camera to be rendered, whether it be a Standard, Physical, or viewport camera. The logic for interpreting a camera INode, ViewExp, and ViewParams are conveniently hidden away by this class. Additionally, This class provides a unified mechanism for notifying of changes in the camera properties.

Member Enumeration Documentation

◆ ProjectionType

enum ProjectionType
strong

Camera projection types.

Enumerator
Perspective 
Orthographic 
203 {
204  Perspective,
205  Orthographic
206 };
@ Perspective
Definition: MouseCursors.h:188

Constructor & Destructor Documentation

◆ ~ICameraContainer()

virtual ~ICameraContainer ( )
inlineprotectedvirtual

Protected destructor prevents deletion through this interface.

194 {}

Member Function Documentation

◆ GetCameraNode()

virtual INode* GetCameraNode ( ) const
pure virtual

Returns the physical camera being used, if one is being used at all - or null otherwise.

The physical camera exposes additional, advanced parameters which are not generic enough to be exposed directly by ICameraContainer.

Parameters
tThe time value at which the camera node is evaluated to extract the physical camera.

◆ GetPhysicalCamera()

virtual IPhysicalCamera* GetPhysicalCamera ( const TimeValue  t) const
pure virtual

Returns the physical camera being used, if one is being used at all - or null otherwise.

The physical camera exposes additional, advanced parameters which are not generic enough to be exposed directly by ICameraContainer.

Parameters
tThe time value at which the camera node is evaluated to extract the physical camera.

◆ EvaluateCameraTransform()

virtual MotionTransforms EvaluateCameraTransform ( const TimeValue  t,
Interval validity,
const MotionBlurSettings camera_motion_blur_settings = nullptr 
) const
pure virtual

Evaluate the motion transform for the camera.

Parameters
tThe time at which to evaluate the transform.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.
camera_motion_blur_settingsThe optional motion blur settings to used when evaluating the transform. If null is passed, then the camera's and node's motion blur settings are used, just as IRenderSessionContext::EvaluateMotionTransforms().

◆ GetProjectionType()

virtual ProjectionType GetProjectionType ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the projection type used by the camera.

Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetPerspectiveFOVRadians()

virtual float GetPerspectiveFOVRadians ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the field-of-view of the camera, in radians.

Remarks
Only valid for perspective cameras.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetOrthographicApertureWidth()

virtual float GetOrthographicApertureWidth ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the width of the orthographic aperture, in system units.

Remarks
Only valid for orthographic cameras.
The ratio between the aperture width and height is image aspect ratio.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.
See also
GetOrthographicApertureHeight()

◆ GetOrthographicApertureHeight()

virtual float GetOrthographicApertureHeight ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the height of the orthographic aperture, in system units.

Remarks
Only valid for orthographic cameras.
The ratio between the aperture width and height is image aspect ratio.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.
See also
GetOrthographicApertureWidth()

◆ GetDOFEnabled()

virtual bool GetDOFEnabled ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns whether Depth-of-Field is enable on the camera.

Remarks
Only valid for perspective cameras.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetLensFocalLength()

virtual float GetLensFocalLength ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the focal length of the lends, in system units.

Remarks
Only valid for perspective cameras.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetFocusPlaneDistance()

virtual float GetFocusPlaneDistance ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the distance to the focus plane, in system units.

This is the distance at which the lens is focused, not to be confused with the lens focal length.

Remarks
Only valid for perspective cameras.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetLensApertureRadius()

virtual float GetLensApertureRadius ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the lens' aperture radius, in system units.

This is the absolute radius, not the f-stop.

Remarks
Only valid for perspective cameras.
Returns 0 if the camera does not specify the lens aperture size (not all cameras do).
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetClipEnabled()

virtual bool GetClipEnabled ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the clipping planes are enabled.

Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetClipNear()

virtual float GetClipNear ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the distance to the near clipping plane, in system units.

Remarks
returns 0 if clipping planes are disabled.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetClipFar()

virtual float GetClipFar ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the distance to the far clipping plane, in system units.

Remarks
returns std::numeric_limits<float>::max() if clipping planes are disabled.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetResolution()

virtual IPoint2 GetResolution ( ) const
pure virtual

Returns the resolution of the image to be rendered.

Remarks
This is identical to the resolution of the Bitmap returned by GetBitmap().

◆ GetPixelAspectRatio()

virtual float GetPixelAspectRatio ( ) const
pure virtual

Returns the pixel aspect ratio of the image to be rendered.

Remarks
The image aspect ratio is: pixel_aspect_ratio * resolution.x / resolution.y

◆ GetBitmap()

virtual Bitmap* GetBitmap ( ) const
pure virtual

Returns the bitmap to which the image is to be rendered.

Remarks
Progressive renderers should generally not render into this Bitmap directly, as this may cause artifacts when saving the image while it is being rendered. Instead, they should render to an internal frame buffer and using IRenderSessionContext::GetMainFrameBufferProcessor() to copy the buffer to the bitmap.

◆ GetRegion()

virtual Box2 GetRegion ( ) const
pure virtual

Returns the region to be rendered.

The renderer should only render pixels within this region; pixels outside the region should generally not not be overwritten in the Bitmap.

Remarks
The region covers the entire image if region rendering is not being used; the region is thus guaranteed to be clipped to the current resolution and to be at least one pixel in size.
The box is relative to the upper-left corner of the image (i.e. upper-left is (0,0)).
The region is inclusive: the last row/column of the region must be rendered.

◆ GetImagePlaneOffset()

virtual Point2 GetImagePlaneOffset ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the X-Y offset of the canvas to be rendered, in the image planes, as number of pixels.

The offset is expressed as floating-points as it may include fractions of a pixel.

Remarks
The offset is relative to the upper-left corner of the image (i.e. upper-left is (0,0)).
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetView()

virtual const View& GetView ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns a View structure that may be passed GeomObject::GetRenderMesh().

Remarks
The View that is returned does not implement View::CheckForRenderAbort(), as this method is not supported by the RenderingAPI in general.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetViewParams()

virtual ViewParams GetViewParams ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns a ViewParams structure, initialize with the camera's properties.

Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ GetGlobalMotionBlurSettings()

virtual MotionBlurSettings GetGlobalMotionBlurSettings ( const TimeValue  t,
Interval validity 
) const
pure virtual

Returns the scene motion blur settings specified by the camera.

Remarks
These are the settings to be used for the scene, not the settings for the camera's own motion blur.
Parameters
tThe time value at which to evaluate the camera.
validity[in, out] The validity of the returned value is intersected into the input value of this parameter.

◆ RegisterChangeNotifier()

virtual void RegisterChangeNotifier ( IChangeNotifier notifier) const
pure virtual

Unregisters a notification callback, previously registered with RegisterChangeNotifier().

◆ UnregisterChangeNotifier()

virtual void UnregisterChangeNotifier ( IChangeNotifier notifier) const
pure virtual

Unregisters a notification callback, previously registered with RegisterChangeNotifier().