User Tools

Site Tools


DzBasicCamera

A basic camera.

More...

Inherits :

Inherited By : DzShaderCamera

Properties

Constructors

DAZ Script
DzBasicCamera ()

Methods

DAZ Script
BooleanapplyDimensionsPreset ( String preset )
DzVec3cursorToRay ( Number x, Number y )
DzVec3cursorToScene ( Number x, Number y, Number z )
DzFloatPropertygetApertureBladeRotationAngleControl ()
DzIntPropertygetApertureNumBladesControl ()
DzFloat2PropertygetAspectRatioControl ()
DzBoolPropertygetConstrainProportionsControl ()
DzBoolPropertygetDepthOfFieldControl ()
DzStringPropertygetDimensionPresetControl ()
BooleangetDimensionsPreset ( String preset, DzSettings settings )
DzBoolPropertygetDisplayPersistenceControl ()
DzColorPropertygetDofOverlayColorControl ()
DzFloatPropertygetDofOverlayOpacityControl ()
DzColorPropertygetDofPlaneColorControl ()
DzBoolPropertygetDofPlaneVisibilityControl ()
DzBoolPropertygetFarDofPlaneVisibilityControl ()
DzFloatPropertygetFocalDistanceControl ()
DzFloatPropertygetFocalLengthControl ()
DzFloatPropertygetFocalPointScaleControl ()
DzColorPropertygetFovColorControl ()
DzFloatPropertygetFovLengthControl ()
DzFloatPropertygetFovOpacityControl ()
DzFloatPropertygetFrameWidthControl ()
DzFloatPropertygetFStopControl ()
DzFloatPropertygetHeadlampIntensityControl ()
DzEnumPropertygetHeadlampModeControl ()
DzFloatPropertygetLensDistortionK1Control ()
DzFloatPropertygetLensDistortionK2Control ()
DzFloatPropertygetLensDistortionK3Control ()
DzFloatPropertygetLensDistortionK4Control ()
DzFloatPropertygetLensDistortionK5Control ()
DzFloatPropertygetLensDistortionScaleControl ()
DzEnumPropertygetLensDistortionTypeControl ()
DzFloatPropertygetLensMaximumFovControl ()
DzFloatPropertygetLensRadialBiasControl ()
DzFloatPropertygetLensShiftXControl ()
DzFloatPropertygetLensShiftYControl ()
DzFloatPropertygetLensStereoOffsetControl ()
DzFloatPropertygetLensThicknessControl ()
DzBoolPropertygetNearDofPlaneVisibilityControl ()
DzBoolPropertygetPerspectiveControl ()
DzInt2PropertygetPixelSizeControl ()
DzFloatPropertygetSightLineOpacityControl ()
DzBoolPropertygetUseLocalDimensionsControl ()
DzFloatPropertygetXHeadlampOffsetControl ()
DzFloatPropertygetYHeadlampOffsetControl ()
DzFloatPropertygetZHeadlampOffsetControl ()
BooleanisAtDefaultSceneCameraValues ()
BooleanisDefaultSceneCamera ()
voidsetIsDefaultSceneCamera ( Boolean yesNo )
voidsetType ( DzCamera::CameraType type )
Deprecated
DzFloatPropertygetFrameWidthChannel ()
DzFloatPropertygetFocalLengthChannel ()
DzBoolPropertygetDepthOfFieldChannel ()
DzFloatPropertygetFocalDistChannel ()
DzFloatPropertygetFStopChannel ()
DzBoolPropertygetDisplayPersistenceChannel ()
DzFloatPropertygetSightLineOpacityChannel ()
DzFloatPropertygetFocalPointScaleChannel ()
DzColorPropertygetFovColorChannel ()
DzFloatPropertygetFovOpacityChannel ()
DzFloatPropertygetFovLengthChannel ()
DzBoolPropertygetDofVisibilityChannel ()
DzColorPropertygetDofColorChannel ()
DzColorPropertygetDofOverlayColorChannel ()
DzFloatPropertygetDofOverlayOpacityChannel ()
DzBoolPropertygetNearDofVisibilityChannel ()
DzBoolPropertygetFarDofVisibilityChannel ()

Signals

Detailed Description

This is the basic camera implementation for DAZ Studio. It supplies commonly-used features like focal length adjustment and depth of field alteration.

Properties


Number : currentViewHeight

Holds the current height of the view. (Read Only)


Number : currentViewWidth

Holds the current width of the view. (Read Only)


Boolean : depthOfField

Holds whether or not the camera performs depth of field calculations.


Number : farDofPlane

Holds the distance of the far DOF plane from this camera. (Read Only)

Since:

  • 4.15.1.84

Number : fStop

Holds the f/stop of the camera.


Boolean : isPerspective

Holds whether or the camera is a perspective or orthographic view.


Number : nearDofPlane

Holds the distance of the near DOF plane from this camera. (Read Only)

Since:

  • 4.15.1.84

Boolean : useActiveViewport

Holds whether or not the local dimensions will use the active viewport when enabled.

Since:

  • 4.9.3.108

Constructors


DzBasicCamera()

Create a camera.

Example:

(function(){
 
	// Create a new camera
	var oCamera = new DzBasicCamera();
 
	// Name the camera
	oCamera.setName( "My Camera" );
 
	// Set the type to orthographic, forward facing along the Z axis
	oCamera.setType( DzCamera.FRONT_CAMERA );
 
	// Add the camera to the scene
	Scene.addNode( oCamera );
 
})();

Methods


Boolean : applyDimensionsPreset( String preset )

Applies the settings in a dimensions preset.

Parameter(s):

  • preset - The name of the preset to retrieve the settings for. An empty string is interpreted to mean “Custom.”

Return Value:

  • true if preset was found, otherwise false.

Since:

  • 4.9.3.108

DzVec3 : cursorToRay( Number x, Number y )

A ray through the scene for a perspective view.

Parameter(s):

  • x - The x position of the cursor in the viewport.
  • y - The y position of the cursor in the viewport.

Return Value:

  • A directional vector that defines a ray that intersects the camera's center point.

DzVec3 : cursorToScene( Number x, Number y, Number z )

Calculates a location in the scene based on an x, y position in the viewport and distance from the camera.

Parameter(s):

  • x - The x coordinate of the cursor in the viewport.
  • y - The y coordinate of the cursor in the viewport.
  • z - The distance from the camera in world space at which to calculate the target point.

Return Value:

  • A positional vector that represents the resulting location in the scene.

DzFloatProperty : getApertureBladeRotationAngleControl()

Return Value:

  • The “Aperture Blade Rotation” property for this camera.

Since:

  • 4.9.3.121

DzIntProperty : getApertureNumBladesControl()

Return Value:

  • The “Aperture Blades” property for this camera.

Since:

  • 4.9.3.121

DzFloat2Property : getAspectRatioControl()

Return Value:

  • The “Aspect Ratio” property for this camera.

Since:

  • 4.15.1.84

DzBoolProperty : getConstrainProportionsControl()

Return Value:

  • The “Constrain Proportions” property for this camera.

Since:

  • 4.15.1.84

DzBoolProperty : getDepthOfFieldControl()

Return Value:

  • The “Depth of Field” property for this camera.

Since:

  • 4.15.1.84

DzStringProperty : getDimensionPresetControl()

Return Value:

  • The “Dimension Preset” property for this camera.

Since:

  • 4.15.1.84

Boolean : getDimensionsPreset( String preset, DzSettings settings )

Retrieves the settings of a dimensions preset.

Parameter(s):

  • preset - The name of the preset to retrieve the settings for. An empty string is interpreted to mean “Custom.”
  • settings - The settings object that the settings will be assigned to.

Return Value:

  • true if preset was found, otherwise false.

Since:

  • 4.9.3.108

DzBoolProperty : getDisplayPersistenceControl()

Return Value:

  • The “Display Persistence” property for this camera.

Since:

  • 4.15.1.84

DzColorProperty : getDofOverlayColorControl()

Return Value:

  • The “DOF Overlay Color” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getDofOverlayOpacityControl()

Return Value:

  • The “DOF Overlay Opacity” property for this camera.

Since:

  • 4.15.1.84

DzColorProperty : getDofPlaneColorControl()

Return Value:

  • The “DOF Plane Color” property for this camera.

Since:

  • 4.15.1.84

DzBoolProperty : getDofPlaneVisibilityControl()

Return Value:

  • The “DOF Plane Visibility” property for this camera.

Since:

  • 4.15.1.84

DzBoolProperty : getFarDofPlaneVisibilityControl()

Return Value:

  • The “Far DOF Plane Visibility” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getFocalDistanceControl()

Return Value:

  • The “Focal Distance” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getFocalLengthControl()

Return Value:

  • The “Focal Length (mm)” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getFocalPointScaleControl()

Return Value:

  • The “Focal Point Scale” property for this camera.

Since:

  • 4.15.1.84

DzColorProperty : getFovColorControl()

Return Value:

  • The “FOV Color” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getFovLengthControl()

Return Value:

  • The “FOV Length” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getFovOpacityControl()

Return Value:

  • The “FOV Opacity” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getFrameWidthControl()

Return Value:

  • The “Frame Width (mm)” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getFStopControl()

Return Value:

  • The “F/Stop” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getHeadlampIntensityControl()

Return Value:

  • The “Headlamp Intensity” property for this camera.

Since:

  • 4.7.1.94

DzEnumProperty : getHeadlampModeControl()

Return Value:

  • The “Headlamp Mode” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getLensDistortionK1Control()

Return Value:

  • The “Lens Distortion K1” property for this camera.

See Also:

Since:

  • 4.9.3.121

DzFloatProperty : getLensDistortionK2Control()

Return Value:

  • The “Lens Distortion K2” property for this camera.

See Also:

Since:

  • 4.9.3.121

DzFloatProperty : getLensDistortionK3Control()

Return Value:

  • The “Lens Distortion K3” property for this camera.

See Also:

Since:

  • 4.9.3.121

DzFloatProperty : getLensDistortionK4Control()

Return Value:

  • The “Lens Distortion K4” property for this camera.

See Also:

Since:

  • 4.16.1.19

DzFloatProperty : getLensDistortionK5Control()

Return Value:

  • The “Lens Distortion K5” property for this camera.

See Also:

Since:

  • 4.16.1.19

DzFloatProperty : getLensDistortionScaleControl()

Return Value:

  • The “Lens Distortion Scale” property for this camera.

Since:

  • 4.9.3.121

DzEnumProperty : getLensDistortionTypeControl()

Return Value:

  • The “Lens Distortion Type” property for this camera.

Attention:

  • The radial distortion models define the relationship between the undistorted radial pixel coordinate ru and the distorted radial pixel coordinate rd with regards to the ideal perspective camera.
  • These options do not make use of “Lens Distortion K#” control values
    • none : Conventional perspective camera.
    • spherical : Conventional spherical camera mapping.
    • cylindrical : Conventional cylindrical camera mapping.
  • These options make use of the value of getLensDistortionK1Control()
    • poly3 : Third order radial distortion model
 rd = ru * (1 - k1 + k1 * ru2) 
  • inv_poly3 : Third order inverse radial distortion model
 ru = rd * (1 - k1 + k1 * rd2) 
 rd = ru * (1 + k1 * ru2 + k2 * ru4) 
  • inv_poly5 : Fifth order inverse radial distortion model
 ru = rd * (1 + k1 * rd2 + k2 * rd4) 
 rd = ru * (1 - k1 - k2 - k3 + k1 * ru + k2 * ru2 + k3 * ru3) 
  • inv_ptlens : Fourth order inverse radial distortion model
 ru = rd * (1 - k1 - k2 - k3 + k1 * rd + k2 * rd2 + k3 * rd3) 
 rd = ru * (k1 + k2 * ru + k3 * ru2 + k4 * ru3 + k5 * ru4) 
  • inv_brown : Fifth order inverse radial distortion model
 ru = rd * (k1 + k2 * rd + k3 * rd2 + k4 * rd3 + k5 * rd4) 
  • equidistant : Equidistant fish-eye with a fourth order radial distortion model
 ru = k1 + k2 * rd + k3 * rd2 + k4 * rd3 + k5 * rd4 

Since:

  • 4.9.3.121

DzFloatProperty : getLensMaximumFovControl()

Return Value:

  • The “Lens Maximum FOV” property for this camera.

See Also:

Since:

  • 4.16.1.19

DzFloatProperty : getLensRadialBiasControl()

Return Value:

  • The “Lens Radial Bias” property for this camera.

Since:

  • 4.9.3.121

DzFloatProperty : getLensShiftXControl()

Return Value:

  • The “Lens Shift X” property for this camera in mm.

Since:

  • 4.9.3.121

DzFloatProperty : getLensShiftYControl()

Return Value:

  • The “Lens Shift Y” property for this camera in mm.

Since:

  • 4.9.3.121

DzFloatProperty : getLensStereoOffsetControl()

Return Value:

  • The “Lens Stereo Offset” for this camera in mm.

Since:

  • 4.9.3.121

DzFloatProperty : getLensThicknessControl()

Return Value:

  • The “Lens Thickness” property for this camera. Thickness is in mm.

Since:

  • 4.8.0.16

DzBoolProperty : getNearDofPlaneVisibilityControl()

Return Value:

  • The “Near DOF Plane Visibility” property for this camera.

Since:

  • 4.15.1.84

DzBoolProperty : getPerspectiveControl()

Return Value:

  • The “Perspective” property for this camera.

Since:

  • 4.15.1.84

DzInt2Property : getPixelSizeControl()

Return Value:

  • The “Pixel Size” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getSightLineOpacityControl()

Return Value:

  • The “Sight Line Opacity” property for this camera.

Since:

  • 4.15.1.84

DzBoolProperty : getUseLocalDimensionsControl()

Return Value:

  • The “Use Local Dimensions” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getXHeadlampOffsetControl()

Return Value:

  • The “X Headlamp Offset” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getYHeadlampOffsetControl()

Return Value:

  • The “Y Headlamp Offset” property for this camera.

Since:

  • 4.15.1.84

DzFloatProperty : getZHeadlampOffsetControl()

Return Value:

  • The “Z Headlamp Offset” property for this camera.

Since:

  • 4.15.1.84

Boolean : isAtDefaultSceneCameraValues()

Return Value:

  • true if this camera is at default scene camera values, otherwise false.

Boolean : isDefaultSceneCamera()

Return Value:

  • true if this camera is the default scene camera, otherwise false.

void : setIsDefaultSceneCamera( Boolean yesNo )

Parameter(s):

  • yesNo - If true, sets this camera as the default scene camera.

Attention:

  • Assigning more than one camera as the default scene camera will not be preserved across save/load sequences.

void : setType( DzCamera::CameraType type )

Changes the type of the camera.

Parameter(s):

  • type - The new type for this camera.

DzFloatProperty : getFrameWidthChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFrameWidthControl() instead.


DzFloatProperty : getFocalLengthChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFocalLengthControl() instead.


DzBoolProperty : getDepthOfFieldChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getDepthOfFieldControl() instead.


DzFloatProperty : getFocalDistChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFocalDistanceControl() instead.


DzFloatProperty : getFStopChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFStopControl() instead.


DzBoolProperty : getDisplayPersistenceChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getDisplayPersistenceControl() instead.


DzFloatProperty : getSightLineOpacityChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getSightLineOpacityControl() instead.


DzFloatProperty : getFocalPointScaleChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFocalPointScaleControl() instead.


DzColorProperty : getFovColorChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFovColorControl() instead.


DzFloatProperty : getFovOpacityChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFovOpacityControl() instead.


DzFloatProperty : getFovLengthChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFovLengthControl() instead.


DzBoolProperty : getDofVisibilityChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getDofPlaneVisibilityControl() instead.


DzColorProperty : getDofColorChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getDofPlaneColorControl() instead.


DzColorProperty : getDofOverlayColorChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getDofOverlayColorControl() instead.


DzFloatProperty : getDofOverlayOpacityChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getDofOverlayOpacityControl() instead.


DzBoolProperty : getNearDofVisibilityChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getNearDofPlaneVisibilityControl() instead.


DzBoolProperty : getFarDofVisibilityChannel()

Deprecated

Exists only to keep old code working. Do not use in new code. Use getFarDofPlaneVisibilityControl() instead.

Signals


void : depthOfFieldChanged()

Signature:“projectionChanged()”

Emitted when the camera's depth of field setting has changed.


void : fStopChanged( DzTimeRange range )

Signature:“fStopChanged(const DzTimeRange&)”

Emitted when the camera's f-Stop setting has changed.