FBCamera Class Reference


Detailed Description

Creates custom cameras and manages system cameras.

When you look at a scene in the MotionBuilder Viewer, you are using a camera view.

There are two types of cameras:

  1. Producer cameras. By default one of the producer cameras is used. These are always present. They can be configured but not destroyed.

  2. Custom cameras, created by the user.

The SystemCamera property indicates whether a given camera is a producer or a custom camera.

When you create a camera you should make it visible with the show property (inherited from FBModel).

Use FBCameraSwitcher to get and set the current camera. For usage, see the Python sample CameraSwitcher.py.

To see how to create a camera with a marker as an interest, see the Python sample code in FBCamera.py. For usage in C++, see the manipcamera sample.

Examples
UI/FBCamera.py, Tasks/SetAllCamerasBackgroundColor.py, Tasks/SetAllCamerasBackgroundColorFromCurrentCamera.py, Tasks/SetAllCamerasBackgroundColorFromFirstSelectedCamera.py, Samples/Camera/CameraSwitcher.py, Rendering/RenderLayers.py, BasicOperations/NewCamera.py
Inheritance diagram for FBCamera:

List of all members.

Public Member Functions

 __init__ (str pName, object pObject=None)
 Constructor.
float GetMatrix (FBCameraMatrixType pType)
 Obtains the camera's matrix.
 GetCameraMatrix (FBMatrix pMatrix, FBCameraMatrixType pType, FBEvaluateInfo pEvalInfo=None)
 Obtains the camera's matrix.
FBVector4 InverseProjection (int pX, int pY, float pDistanceFromCamera, bool pRelativeToViewport=False)
 Returns the world coordinates based on screen coordinates and input distance from the camera.

Public Attributes

FBPropertyBase SystemCamera
 Read Only Property: Indicate if this a producer (default or system) camera or a custom (user-created) camera.
FBPropertyCameraFrameSizeMode FrameSizeMode
 Read Write Property: Frame size standard mode.
FBPropertyCameraResolutionMode ResolutionMode
 Read Write Property: Resolution standard mode.
FBPropertyBase ResolutionWidth
 Read Write Property: Resolution width.
FBPropertyBase ResolutionHeight
 Read Write Property: Resolution height.
FBPropertyBase WindowWidth
 Read Only Property: Window width.
FBPropertyBase WindowHeight
 Read Only Property: Window height.
FBPropertyBase PixelAspectRatio
 Read Write Property: Pixel aspect ratio.
FBPropertyBase NearPlaneDistance
 Read Write Property: Near plane distance.
FBPropertyBase FarPlaneDistance
 Read Write Property: Far plane distance.
FBPropertyBase MouseLockCamera
 Read Write Property: Mouse lock for camera?.
FBPropertyCameraType Type
 Read Write Property: Type of camera.
FBPropertyCameraApertureMode ApertureMode
 Read Write Property: Aperture mode.
FBPropertyBaseAnimatable FieldOfView
 Read Write Property: Field of View (used when in horizontal or vertical aperture modes).
FBPropertyBaseAnimatable FieldOfViewX
 Read Write Property: Field of View X angle (used in horizontal and vertical aperture mode).
FBPropertyBaseAnimatable FieldOfViewY
 Read Write Property: Field of View Y angle (used in horizontal and vertical aperture mode).
FBPropertyBaseAnimatable OpticalCenterX
 Read Write Property: Optical Center X (mm).
FBPropertyBaseAnimatable OpticalCenterY
 Read Write Property: Optical Center Y (mm).
FBPropertyBaseAnimatable FocalLength
 Read Write Property: Focal Length.
FBPropertyCameraFilmBackType FilmBackType
 Read Write Property: Film back standard type.
FBPropertyBase FilmSizeWidth
 Read Write Property: Width of the film.
FBPropertyBase FilmSizeHeight
 Read Write Property: Height of the film.
FBPropertyBase FilmAspectRatio
 Read Write Property: Film aspect ratio.
FBPropertyBase SqueezeRatio
 Read Write Property: Squeeze ratio.
FBPropertyBase OrthoZoom
 Read Write Property: Zoom factor of an orthographic camera.
FBPropertyTexture BackGroundTexture
 Read Write Property: Background Texture.
FBPropertyVideo BackGroundMedia
FBPropertyCameraViewPlaneMode ViewBackGroundPlaneMode
 Read Write Property: Background plane view mode.
FBPropertyBase BackGroundImageCenter
 Read Write Property: Center the background image.
FBPropertyBase BackGroundImageFit
 Read Write Property: Fit the background image.
FBPropertyBase BackGroundImageKeepRatio
 Read Write Property: Keep the background image's ratio.
FBPropertyBase BackGroundImageCrop
 Read Write Property: Crop the background image.
FBPropertyBase BackGroundPlaneDistance
 Read Write Property: Set the distance for the background plane.
FBPropertyCameraDistanceMode BackGroundPlaneDistanceMode
 Read Write Property: Select mode for the background plane's distance.
FBPropertyBaseAnimatable ForeGroundAlpha
 Read Write Property: Opacity of foreground.
FBPropertyBase ForeGroundMaterialThreshold
 Read Write Property: Material threshold for a transparent foreground.
FBPropertyBase ForeGroundTransparent
 Read Write Property: Is the foreground transparent?.
FBPropertyTexture ForeGroundTexture
 Read Write Property: ForeGround Texture.
FBPropertyVideo ForeGroundMedia
FBPropertyCameraViewPlaneMode ViewForeGroundPlaneMode
 Read Write Property: Foreground plane view mode.
FBPropertyBase ForeGroundImageCenter
 Read Write Property: Center the foreground image.
FBPropertyBase ForeGroundImageFit
 Read Write Property: Fit the foreground image.
FBPropertyBase ForeGroundImageKeepRatio
 Read Write Property: Keep the foreground image's ratio?.
FBPropertyBase ForeGroundImageCrop
 Read Write Property: Crop the foreground image.
FBPropertyBase ForeGroundPlaneDistance
 Read Write Property: Set the distance for the foreground plane.
FBPropertyCameraDistanceMode ForeGroundPlaneDistanceMode
 Read Write Property: Select mode for the foreground plane's distance.
FBPropertyBase ViewCameraInterest
 Read Write Property: Show the camera interest?.
FBPropertyBase ViewNearFarPlane
 Read Write Property: Show near/far planes?.
FBPropertyBase ViewShowName
 Read Write Property: Show name?.
FBPropertyBase ViewShowGrid
 Read Write Property: Show grid?.
FBPropertyBase ViewShowAxis
 Read Write Property: Show axis?.
FBPropertyBase ViewShowTimeCode
 Read Write Property: Show time code?.
FBPropertyBase ViewDisplaySafeArea
 Read Write Property: Display safe area?.
FBPropertyBase ViewOpticalCenter
 Read Write Property: View optical center?.
FBPropertyCameraSafeAreaMode SafeAreaMode
 Read Write Property: Select mode for safe area.
FBPropertyBaseAnimatable BackGroundColor
 Read Write Property: Background color for camera.
FBPropertyBase UseFrameColor
 Read Write Property: Use frame color?.
FBPropertyBase FrameColor
 Read Write Property: Frame color for camera.
FBPropertyBase UseAntiAliasing
 Read Write Property: Use anti-aliasing?.
FBPropertyBase UseDepthOfField
 Read Write Property: Use depth of field calculations?.
FBPropertyBase InteractiveMode
 Read Write Property: Interactive mode?.
FBPropertyBase AntiAliasingIntensity
 Read Write Property: Anti-aliasing intensity.
FBPropertyCameraAntiAliasingMethod AntiAliasingMethod
 Read Write Property: Anti-aliasing method.
FBPropertyBase NumberOfSamples
 Read Write Property: Number of samples to oversample with.
FBPropertyCameraSamplingType SamplingType
 Read Write Property: Type of over sampling.
FBPropertyBase UseAccumulationBuffer
 Read Write Property: Use accumulation buffer?.
FBPropertyCameraFocusDistanceSource FocusDistanceSource
 Read Write Property: Select source for focusing.
FBPropertyBase FocusSpecificDistance
 Read Write Property: Specfic distance for focusing.
FBPropertyBase FocusAngle
 Read Write Property: Focus Angle (rendering dof).
FBPropertyBase Use2DMagnifier
 Read Write Property: Enable/Disable the 2D Magnifier.
FBPropertyBase Display2DMagnifierFrame
 Read Write Property: Enable/Disable the drawing of the 2D Magnifier frame box.
FBPropertyBaseAnimatable MagnifierZoom
 Read Write Property: 2D Magnifier Zoom value.
FBPropertyBaseAnimatable MagnifierPosX
 Read Write Property: 2D Magnifier X Position.
FBPropertyBaseAnimatable MagnifierPosY
 Read Write Property: 2D Magnifier Y Position.
FBPropertyModel Interest
 Read Write Property: Direct camera's interest.
FBPropertyBaseAnimatable Roll
 Read Write Property: Camera's roll on it's Z axis.
FBPropertyBaseAnimatable TurnTable
 Read Write Property: Camera's rotation around its interest.
FBPropertyBase DisplayTurnTableIcon
 Read Write Property: Enable/Disable the drawing of the Turn Table icon.
FBPropertyBaseAnimatable MotionBlurIntensity
 Read Write Property: Motion Blur Intensity.
FBPropertyBase UseMotionBlur
 Read Write Property: Enable Motion Blur.
FBPropertyBase UseRealTimeMotionBlur
 Read Write Property: Enable Real-time Motion Blur.
FBPropertyBase CameraViewportX
  Read Only Property: Camera Viewport start position's X value.
FBPropertyBase CameraViewportY
  Read Only Property: Camera Viewport start position's Y value.
FBPropertyBase CameraViewportWidth
  Read Only Property: Camera Viewport width.
FBPropertyBase CameraViewportHeight
  Read Only Property: Camera Viewport height.
FBPropertyListHUD HUDs
  List : HUDs present in this camera.
float OrthoFactor
 Constant scale factor to be used with OrthoZoom for orthographic cameras.

Member Function Documentation

float GetMatrix ( FBCameraMatrixType  pType)

Obtains the camera's matrix.

Deprecated:
Use FBCamera.GetCameraMatrix() instead
Parameters:
pTypeMatrix type to obtain.
Returns:
Matrix of doubles (the camera's matrix in question).
GetCameraMatrix ( FBMatrix  pMatrix,
FBCameraMatrixType  pType,
FBEvaluateInfo  pEvalInfo = None 
)

Obtains the camera's matrix.

Parameters:
pMatrixMatrix to fill with requested information.
pTypeCamera Matrix type to obtain.
pEvalInfoTake Display if none specified.
FBVector4 InverseProjection ( int  pX,
int  pY,
float  pDistanceFromCamera,
bool  pRelativeToViewport = False 
)

Returns the world coordinates based on screen coordinates and input distance from the camera.

Parameters:
pXScreen horizontal coordinate in pixel. When pRelativeToViewport is false, the range is between 0 and (WindowWidth - 1). When pRelativeToViewport is true, the range is between 0 to (CameraViewportWidth - 1). The coordinate starts at left of the region.
pYScreen vertical coordinate in pixel. When pRelativeToViewport is false, the range is between 0 and (WindowHeight - 1). When pRelativeToViewport is true, the range is between 0 to (CameraViewportHeight - 1). The coordinate starts at top of the region.
pDistanceFromCameraDistance from the camera to the resulting world coordinate position
pRelativeToViewporttrue indicates (pX,pY) is relative to the window; false indicates (pX,pY) is relative to the viewport of the camera.
Returns:
The world coordinates in 3D space

Member Data Documentation

FBPropertyBase SystemCamera

Read Only Property: Indicate if this a producer (default or system) camera or a custom (user-created) camera.

FBPropertyCameraFrameSizeMode FrameSizeMode

Read Write Property: Frame size standard mode.

FBPropertyCameraResolutionMode ResolutionMode

Read Write Property: Resolution standard mode.

FBPropertyBase ResolutionWidth

Read Write Property: Resolution width.

FBPropertyBase ResolutionHeight

Read Write Property: Resolution height.

FBPropertyBase WindowWidth

Read Only Property: Window width.

FBPropertyBase WindowHeight

Read Only Property: Window height.

FBPropertyBase PixelAspectRatio

Read Write Property: Pixel aspect ratio.

FBPropertyBase NearPlaneDistance

Read Write Property: Near plane distance.

FBPropertyBase FarPlaneDistance

Read Write Property: Far plane distance.

FBPropertyBase MouseLockCamera

Read Write Property: Mouse lock for camera?.

FBPropertyCameraType Type

Read Write Property: Type of camera.

FBPropertyCameraApertureMode ApertureMode

Read Write Property: Aperture mode.

FBPropertyBaseAnimatable FieldOfView

Read Write Property: Field of View (used when in horizontal or vertical aperture modes).

FBPropertyBaseAnimatable FieldOfViewX

Read Write Property: Field of View X angle (used in horizontal and vertical aperture mode).

FBPropertyBaseAnimatable FieldOfViewY

Read Write Property: Field of View Y angle (used in horizontal and vertical aperture mode).

FBPropertyBaseAnimatable OpticalCenterX

Read Write Property: Optical Center X (mm).

FBPropertyBaseAnimatable OpticalCenterY

Read Write Property: Optical Center Y (mm).

FBPropertyBaseAnimatable FocalLength

Read Write Property: Focal Length.

FBPropertyCameraFilmBackType FilmBackType

Read Write Property: Film back standard type.

FBPropertyBase FilmSizeWidth

Read Write Property: Width of the film.

FBPropertyBase FilmSizeHeight

Read Write Property: Height of the film.

FBPropertyBase FilmAspectRatio

Read Write Property: Film aspect ratio.

FBPropertyBase SqueezeRatio

Read Write Property: Squeeze ratio.

FBPropertyBase OrthoZoom

Read Write Property: Zoom factor of an orthographic camera.


OrthoZoom is only applicable if the camera has orthographic projection (i.e., Type == FBCameraType.kFBCameraTypeOrthogonal).
This value changes when the orthographic camera is zoomed in or out.
Refer to the following code if you wish to compute the left, right, top, and bottom view planes of the camera.

     double lW = mCam.CameraViewportWidth;
     double lH = mCam.CameraViewportHeight;
     double lPixelRatio = mCam.PixelAspectRatio;
     const double lFactor = mCam.OrthoZoom * FBCamera::OrthoFactor;
     if( lW < lH )
     {
        mLeftPlane   =  -lFactor * lPixelRatio;
        mRightPlane  =   lFactor * lPixelRatio;
        mBottomPlane = -(lFactor * lH) / lW;
        mTopPlane    =  (lFactor * lH) / lW;
     }
     else
     {
        lW *= lPixelRatio;
        mLeftPlane   = -(lFactor * lW) / lH;
        mRightPlane  =  (lFactor * lW) / lH;
        mBottomPlane =  -lFactor;
        mTopPlane    =   lFactor;
     }
FBPropertyTexture BackGroundTexture

Read Write Property: Background Texture.

FBPropertyVideo BackGroundMedia
Deprecated:
Read Write Property: BackGround Image
FBPropertyCameraViewPlaneMode ViewBackGroundPlaneMode

Read Write Property: Background plane view mode.

FBPropertyBase BackGroundImageCenter

Read Write Property: Center the background image.

FBPropertyBase BackGroundImageFit

Read Write Property: Fit the background image.

FBPropertyBase BackGroundImageKeepRatio

Read Write Property: Keep the background image's ratio.

FBPropertyBase BackGroundImageCrop

Read Write Property: Crop the background image.

FBPropertyBase BackGroundPlaneDistance

Read Write Property: Set the distance for the background plane.

FBPropertyCameraDistanceMode BackGroundPlaneDistanceMode

Read Write Property: Select mode for the background plane's distance.

FBPropertyBaseAnimatable ForeGroundAlpha

Read Write Property: Opacity of foreground.

Read Write Property: Material threshold for a transparent foreground.

FBPropertyBase ForeGroundTransparent

Read Write Property: Is the foreground transparent?.

FBPropertyTexture ForeGroundTexture

Read Write Property: ForeGround Texture.

FBPropertyVideo ForeGroundMedia
Deprecated:
Read Write Property: ForeGround Image
FBPropertyCameraViewPlaneMode ViewForeGroundPlaneMode

Read Write Property: Foreground plane view mode.

FBPropertyBase ForeGroundImageCenter

Read Write Property: Center the foreground image.

FBPropertyBase ForeGroundImageFit

Read Write Property: Fit the foreground image.

FBPropertyBase ForeGroundImageKeepRatio

Read Write Property: Keep the foreground image's ratio?.

FBPropertyBase ForeGroundImageCrop

Read Write Property: Crop the foreground image.

FBPropertyBase ForeGroundPlaneDistance

Read Write Property: Set the distance for the foreground plane.

FBPropertyCameraDistanceMode ForeGroundPlaneDistanceMode

Read Write Property: Select mode for the foreground plane's distance.

FBPropertyBase ViewCameraInterest

Read Write Property: Show the camera interest?.

FBPropertyBase ViewNearFarPlane

Read Write Property: Show near/far planes?.

FBPropertyBase ViewShowName

Read Write Property: Show name?.

FBPropertyBase ViewShowGrid

Read Write Property: Show grid?.

FBPropertyBase ViewShowAxis

Read Write Property: Show axis?.

FBPropertyBase ViewShowTimeCode

Read Write Property: Show time code?.

FBPropertyBase ViewDisplaySafeArea

Read Write Property: Display safe area?.

FBPropertyBase ViewOpticalCenter

Read Write Property: View optical center?.

FBPropertyCameraSafeAreaMode SafeAreaMode

Read Write Property: Select mode for safe area.

FBPropertyBaseAnimatable BackGroundColor

Read Write Property: Background color for camera.

FBPropertyBase UseFrameColor

Read Write Property: Use frame color?.

FBPropertyBase FrameColor

Read Write Property: Frame color for camera.

FBPropertyBase UseAntiAliasing

Read Write Property: Use anti-aliasing?.

FBPropertyBase UseDepthOfField

Read Write Property: Use depth of field calculations?.

FBPropertyBase InteractiveMode

Read Write Property: Interactive mode?.

FBPropertyBase AntiAliasingIntensity

Read Write Property: Anti-aliasing intensity.

FBPropertyCameraAntiAliasingMethod AntiAliasingMethod

Read Write Property: Anti-aliasing method.

FBPropertyBase NumberOfSamples

Read Write Property: Number of samples to oversample with.

FBPropertyCameraSamplingType SamplingType

Read Write Property: Type of over sampling.

FBPropertyBase UseAccumulationBuffer

Read Write Property: Use accumulation buffer?.

FBPropertyCameraFocusDistanceSource FocusDistanceSource

Read Write Property: Select source for focusing.

FBPropertyBase FocusSpecificDistance

Read Write Property: Specfic distance for focusing.

FBPropertyBase FocusAngle

Read Write Property: Focus Angle (rendering dof).

FBPropertyBase Use2DMagnifier

Read Write Property: Enable/Disable the 2D Magnifier.

FBPropertyBase Display2DMagnifierFrame

Read Write Property: Enable/Disable the drawing of the 2D Magnifier frame box.

FBPropertyBaseAnimatable MagnifierZoom

Read Write Property: 2D Magnifier Zoom value.

FBPropertyBaseAnimatable MagnifierPosX

Read Write Property: 2D Magnifier X Position.

FBPropertyBaseAnimatable MagnifierPosY

Read Write Property: 2D Magnifier Y Position.

FBPropertyModel Interest

Read Write Property: Direct camera's interest.

FBPropertyBaseAnimatable Roll

Read Write Property: Camera's roll on it's Z axis.

FBPropertyBaseAnimatable TurnTable

Read Write Property: Camera's rotation around its interest.

FBPropertyBase DisplayTurnTableIcon

Read Write Property: Enable/Disable the drawing of the Turn Table icon.

FBPropertyBaseAnimatable MotionBlurIntensity

Read Write Property: Motion Blur Intensity.

FBPropertyBase UseMotionBlur

Read Write Property: Enable Motion Blur.

FBPropertyBase UseRealTimeMotionBlur

Read Write Property: Enable Real-time Motion Blur.

FBPropertyBase CameraViewportX

Read Only Property: Camera Viewport start position's X value.

FBPropertyBase CameraViewportY

Read Only Property: Camera Viewport start position's Y value.

FBPropertyBase CameraViewportWidth

Read Only Property: Camera Viewport width.

FBPropertyBase CameraViewportHeight

Read Only Property: Camera Viewport height.

List : HUDs present in this camera.

Constant scale factor to be used with OrthoZoom for orthographic cameras.


FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera
FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera FBCamera