unreal.CameraComponent

class unreal.CameraComponent(outer=None, name='None')

Bases: unreal.SceneComponent

Represents a camera viewpoint and settings, such as projection type, field of view, and post-process overrides. The default behavior for an actor used as the camera view target is to look for an attached camera component and use its location, rotation, and settings.

C++ Source:

  • Module: Engine

  • File: CameraComponent.h

Editor Properties: (see get_editor_property/set_editor_property)

  • absolute_location (bool): [Read-Write] Absolute Location: If RelativeLocation should be considered relative to the world, rather than the parent

  • absolute_rotation (bool): [Read-Write] Absolute Rotation: If RelativeRotation should be considered relative to the world, rather than the parent

  • absolute_scale (bool): [Read-Write] Absolute Scale: If RelativeScale3D should be considered relative to the world, rather than the parent

  • aspect_ratio (float): [Read-Write] Aspect Ratio: Aspect Ratio (Width/Height)

  • asset_user_data (Array(AssetUserData)): [Read-Write] Asset User Data: Array of user data stored with the component

  • auto_activate (bool): [Read-Write] Auto Activate: Whether the component is activated at creation or must be explicitly activated.

  • camera_mesh (StaticMesh): [Read-Write] Camera Mesh

  • camera_mesh_hidden_in_game (bool): [Read-Write] Camera Mesh Hidden in Game: If the camera mesh is visible in game. Only relevant when running editor builds.

  • can_ever_affect_navigation (bool): [Read-Write] Can Ever Affect Navigation: Whether this component can potentially influence navigation

  • component_tags (Array(Name)): [Read-Write] Component Tags: Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • constrain_aspect_ratio (bool): [Read-Write] Constrain Aspect Ratio: If bConstrainAspectRatio is true, black bars will be added if the destination view has a different aspect ratio than this camera requested.

  • detail_mode (DetailMode): [Read-Write] Detail Mode: If detail mode is >= system detail mode, primitive won’t be rendered.

  • draw_frustum_allowed (bool): [Read-Write] Draw Frustum Allowed: The Frustum visibility flag for draw frustum component initialization

  • editable_when_inherited (bool): [Read-Write] Editable when Inherited: True if this component can be modified when it was inherited from a parent actor class

  • field_of_view (float): [Read-Write] Field Of View: The horizontal field of view (in degrees) in perspective mode (ignored in Orthographic mode)

    If the aspect ratio axis constraint (from ULocalPlayer, ALevelSequenceActor, etc.) is set to maintain vertical FOV, the AspectRatio property will be used to convert this property’s value to a vertical FOV.

  • hidden_in_game (bool): [Read-Write] Hidden in Game: Whether to hide the primitive in game, if the primitive is Visible.

  • is_editor_only (bool): [Read-Write] Is Editor Only: If true, the component will be excluded from non-editor builds

  • lock_to_hmd (bool): [Read-Write] Lock to Hmd: True if the camera’s orientation and position should be locked to the HMD

  • mobility (ComponentMobility): [Read-Write] Mobility: How often this component is allowed to move, used to make various optimizations. Only safe to set in constructor.

  • on_component_activated (ActorComponentActivatedSignature): [Read-Write] On Component Activated: Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] On Component Deactivated: Called when the component has been deactivated

  • ortho_far_clip_plane (float): [Read-Write] Ortho Far Clip Plane: The far plane distance of the orthographic view (in world units)

  • ortho_near_clip_plane (float): [Read-Write] Ortho Near Clip Plane: The near plane distance of the orthographic view (in world units)

  • ortho_width (float): [Read-Write] Ortho Width: The desired width (in world units) of the orthographic view (ignored in Perspective mode)

  • physics_volume_changed_delegate (PhysicsVolumeChanged): [Read-Write] Physics Volume Changed Delegate: Delegate that will be called when PhysicsVolume has been changed *

  • post_process_blend_weight (float): [Read-Write] Post Process Blend Weight: Indicates if PostProcessSettings should be used when using this Camera to view through.

  • post_process_settings (PostProcessSettings): [Read-Write] Post Process Settings: Post process settings to use for this camera. Don’t forget to check the properties you want to override

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Primary Component Tick: Main tick function for the Component

  • projection_mode (CameraProjectionMode): [Read-Write] Projection Mode: The type of camera

  • relative_location (Vector): [Read-Write] Relative Location: Location of the component relative to its parent

  • relative_rotation (Rotator): [Read-Write] Relative Rotation: Rotation of the component relative to its parent

  • relative_scale3d (Vector): [Read-Write] Relative Scale 3D: Non-uniform scaling of the component relative to its parent. Note that scaling is always applied in local space (no shearing etc)

  • replicates (bool): [Read-Write] Replicates: Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

  • should_update_physics_volume (bool): [Read-Write] Should Update Physics Volume: Whether or not the cached PhysicsVolume this component overlaps should be updated when the component is moved. see: GetPhysicsVolume()

  • use_attach_parent_bound (bool): [Read-Write] Use Attach Parent Bound: If true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together.

  • use_field_of_view_for_lod (bool): [Read-Write] Use Field Of View for LOD: If true, account for the field of view angle when computing which level of detail to use for meshes.

  • use_pawn_control_rotation (bool): [Read-Write] Use Pawn Control Rotation: If this camera component is placed on a pawn, should it use the view/control rotation of the pawn where possible? see: APawn::GetViewRotation()

  • visible (bool): [Read-Write] Visible: Whether to completely draw the primitive; if false, the primitive is not drawn, does not cast a shadow.

add_or_update_blendable(blendable_object, weight=1.000000) None

Adds an Blendable (implements IBlendableInterface) to the array of Blendables (if it doesn’t exist) and update the weight

Parameters
  • blendable_object (BlendableInterface) –

  • weight (float) –

property aspect_ratio

[Read-Write] Aspect Ratio: Aspect Ratio (Width/Height)

Type

(float)

property b_use_controller_view_rotation

‘b_use_controller_view_rotation’ was renamed to ‘use_pawn_control_rotation’.

Type

deprecated

property b_use_pawn_view_rotation

‘b_use_pawn_view_rotation’ was renamed to ‘use_pawn_control_rotation’.

Type

deprecated

property camera_mesh

[Read-Write] Camera Mesh

Type

(StaticMesh)

property camera_mesh_hidden_in_game

[Read-Write] Camera Mesh Hidden in Game: If the camera mesh is visible in game. Only relevant when running editor builds.

Type

(bool)

property constrain_aspect_ratio

[Read-Write] Constrain Aspect Ratio: If bConstrainAspectRatio is true, black bars will be added if the destination view has a different aspect ratio than this camera requested.

Type

(bool)

property draw_frustum_allowed

[Read-Write] Draw Frustum Allowed: The Frustum visibility flag for draw frustum component initialization

Type

(bool)

property field_of_view

[Read-Write] Field Of View: The horizontal field of view (in degrees) in perspective mode (ignored in Orthographic mode)

If the aspect ratio axis constraint (from ULocalPlayer, ALevelSequenceActor, etc.) is set to maintain vertical FOV, the AspectRatio property will be used to convert this property’s value to a vertical FOV.

Type

(float)

get_camera_view(delta_time) MinimalViewInfo

Returns camera’s Point of View. Called by Camera class. Subclass and postprocess to add any effects.

Parameters

delta_time (float) –

Returns

desired_view (MinimalViewInfo):

Return type

MinimalViewInfo

property lock_to_hmd

[Read-Write] Lock to Hmd: True if the camera’s orientation and position should be locked to the HMD

Type

(bool)

property ortho_far_clip_plane

[Read-Write] Ortho Far Clip Plane: The far plane distance of the orthographic view (in world units)

Type

(float)

property ortho_near_clip_plane

[Read-Write] Ortho Near Clip Plane: The near plane distance of the orthographic view (in world units)

Type

(float)

property ortho_width

[Read-Write] Ortho Width: The desired width (in world units) of the orthographic view (ignored in Perspective mode)

Type

(float)

property post_process_blend_weight

[Read-Write] Post Process Blend Weight: Indicates if PostProcessSettings should be used when using this Camera to view through.

Type

(float)

property post_process_settings

[Read-Write] Post Process Settings: Post process settings to use for this camera. Don’t forget to check the properties you want to override

Type

(PostProcessSettings)

property projection_mode

[Read-Write] Projection Mode: The type of camera

Type

(CameraProjectionMode)

remove_blendable(blendable_object) None

Removes a blendable.

Parameters

blendable_object (BlendableInterface) –

set_aspect_ratio(aspect_ratio) None

Set Aspect Ratio

Parameters

aspect_ratio (float) –

set_constraint_aspect_ratio(constrain_aspect_ratio) None

Set Constraint Aspect Ratio

Parameters

constrain_aspect_ratio (bool) –

set_field_of_view(field_of_view) None

Set Field Of View

Parameters

field_of_view (float) –

set_ortho_far_clip_plane(ortho_far_clip_plane) None

Set Ortho Far Clip Plane

Parameters

ortho_far_clip_plane (float) –

set_ortho_near_clip_plane(ortho_near_clip_plane) None

Set Ortho Near Clip Plane

Parameters

ortho_near_clip_plane (float) –

set_ortho_width(ortho_width) None

Set Ortho Width

Parameters

ortho_width (float) –

set_post_process_blend_weight(post_process_blend_weight) None

Set Post Process Blend Weight

Parameters

post_process_blend_weight (float) –

set_projection_mode(projection_mode) None

Set Projection Mode

Parameters

projection_mode (CameraProjectionMode) –

set_use_field_of_view_for_lod(use_field_of_view_for_lod) None

Set Use Field Of View for LOD

Parameters

use_field_of_view_for_lod (bool) –

property use_field_of_view_for_lod

[Read-Write] Use Field Of View for LOD: If true, account for the field of view angle when computing which level of detail to use for meshes.

Type

(bool)

property use_pawn_control_rotation

[Read-Write] Use Pawn Control Rotation: If this camera component is placed on a pawn, should it use the view/control rotation of the pawn where possible? see: APawn::GetViewRotation()

Type

(bool)