unreal.CameraComponent¶
- class unreal.CameraComponent(outer: Object | None = None, name: Name | str = 'None')¶
Bases:
SceneComponentRepresents 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] If RelativeLocation should be considered relative to the world, rather than the parentabsolute_rotation(bool): [Read-Write] If RelativeRotation should be considered relative to the world, rather than the parentabsolute_scale(bool): [Read-Write] If RelativeScale3D should be considered relative to the world, rather than the parentaspect_ratio(float): [Read-Write] Aspect Ratio (Width/Height)aspect_ratio_axis_constraint(AspectRatioAxisConstraint): [Read-Write] Override for the default aspect ratio axis constraint defined on the local playerasset_user_data(Array[AssetUserData]): [Read-Write] Array of user data stored with the componentasset_user_data_editor_only(Array[AssetUserData]): [Read-Write] Array of user data stored with the componentauto_activate(bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.auto_calculate_ortho_planes(bool): [Read-Write] Automatically determine a min/max Near/Far clip plane position depending on OrthoWidth valueauto_plane_shift(float): [Read-Write] Manually adjusts the planes of this camera, maintaining the distance between them. Positive moves out to the farplane, negative towards the near planecamera_mesh(StaticMesh): [Read-Write]camera_mesh_hidden_in_game(bool): [Read-Write] If the camera mesh is visible in game. Only relevant when running editor builds.can_ever_affect_navigation(bool): [Read-Write] Whether this component can potentially influence navigationcomponent_tags(Array[Name]): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.constrain_aspect_ratio(bool): [Read-Write] If bConstrainAspectRatio is true, black bars will be added if the destination view has a different aspect ratio than this camera requested.crop_overscan(bool): [Read-Write] Indicates that the overscanned pixels should be cropped at the end of the rendering pipeline, allowing the overscanned pixels to be used in post process effects that need extra pixels beyond the view frustum (e.g. lens distortion) without having to render those pixels to the screen. When bScaleResolutionWithOverscan is enabled, the cropped image will have the same resolution as the original non-overscanned image, but when disabled, the cropped image will be a lower resolution.detail_mode(DetailMode): [Read-Write] Set the required detail level of this component. It will be deleted or made invisible if the world’s detail level is higher, based on platform and scalability settings. For example, a detail mode of High may prevent this component from loading on mobile platforms.draw_frustum_allowed(bool): [Read-Write] The Frustum visibility flag for draw frustum component initializationeditable_when_inherited(bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor classenable_first_person_field_of_view(bool): [Read-Write] True if the first person field of view should be used for primitives tagged as “IsFirstPerson”.enable_first_person_scale(bool): [Read-Write] True if the first person scale should be used for primitives tagged as “IsFirstPerson”.field_of_view(float): [Read-Write] 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.
first_person_field_of_view(float): [Read-Write] The horizontal field of view (in degrees) used for primitives tagged as “IsFirstPerson”.first_person_scale(float): [Read-Write] The scale to apply to primitives tagged as “IsFirstPerson”. This is used to scale down primitives towards the camera such that they are small enough not to intersect with the scene.hidden_in_game(bool): [Read-Write] Whether to hide the primitive in game, if the primitive is Visible.is_editor_only(bool): [Read-Write] If true, the component will be excluded from non-editor buildslock_to_hmd(bool): [Read-Write] True if the camera’s orientation and position should be locked to the HMDmobility(ComponentMobility): [Read-Write] 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] Called when the component has been activated, with parameter indicating if it was from a reseton_component_deactivated(ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivatedortho_far_clip_plane(float): [Read-Write] The far plane distance of the orthographic view (in world units)ortho_near_clip_plane(float): [Read-Write] The near plane distance of the orthographic view (in world units)ortho_width(float): [Read-Write] The desired width (in world units) of the orthographic view (ignored in Perspective mode)override_aspect_ratio_axis_constraint(bool): [Read-Write] Whether to override the default aspect ratio axis constraint defined on the local playeroverscan(float): [Read-Write] Amount to increase the view frustum by, from 0.0 for no increase to 1.0 for 100% increasephysics_volume_changed_delegate(PhysicsVolumeChanged): [Read-Write] Delegate that will be called when PhysicsVolume has been changed *post_process_blend_weight(float): [Read-Write] Indicates if PostProcessSettings should be used when using this Camera to view through.post_process_settings(PostProcessSettings): [Read-Write] Post process settings to use for this camera. Don’t forget to check the properties you want to overrideprimary_component_tick(ActorComponentTickFunction): [Read-Write] Main tick function for the Componentprojection_mode(CameraProjectionMode): [Read-Write] The type of camerarelative_location(Vector): [Read-Write] Location of the component relative to its parentrelative_rotation(Rotator): [Read-Write] Rotation of the component relative to its parentrelative_scale3d(Vector): [Read-Write] Non-uniform scaling of the component relative to its parent. Note that scaling is always applied in local space (no shearing etc)replicate_using_registered_sub_object_list(bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.replicates(bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!scale_resolution_with_overscan(bool): [Read-Write] Indicates that the resolution should be scaled by the overscan amount so that the original view frustum remains the same resolution. Note that when enabled, increasing overscan will result in increased rendering workload, potentially decreasing performance as resolution increasesshould_update_physics_volume(bool): [Read-Write] Whether or not the cached PhysicsVolume this component overlaps should be updated when the component is moved. see: GetPhysicsVolume()update_ortho_planes(bool): [Read-Write] Adjusts the near/far planes and the view origin of the current camera automatically to avoid clipping and light artefactinguse_attach_parent_bound(bool): [Read-Write] If true, this component uses its parents bounds when attached. This can be a significant optimization with many components attached together.use_camera_height_as_view_target(bool): [Read-Write] If UpdateOrthoPlanes is enabled, this setting will use the cameras current height to compensate the distance to the general view (as a pseudo distance to view target when one isn’t present)use_field_of_view_for_lod(bool): [Read-Write] 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] 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] 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_axis_constraint: AspectRatioAxisConstraint¶
[Read-Write] Override for the default aspect ratio axis constraint defined on the local player
- Type:
- property auto_calculate_ortho_planes: bool¶
[Read-Write] Automatically determine a min/max Near/Far clip plane position depending on OrthoWidth value
- Type:
(bool)
- property auto_plane_shift: float¶
[Read-Write] Manually adjusts the planes of this camera, maintaining the distance between them. Positive moves out to the farplane, negative towards the near plane
- Type:
(float)
- property b_use_controller_view_rotation: bool¶
‘b_use_controller_view_rotation’ was renamed to ‘use_pawn_control_rotation’.
- Type:
deprecated
- property b_use_pawn_view_rotation: bool¶
‘b_use_pawn_view_rotation’ was renamed to ‘use_pawn_control_rotation’.
- Type:
deprecated
- property camera_mesh: StaticMesh¶
[Read-Write]
- Type:
[Read-Write] If the camera mesh is visible in game. Only relevant when running editor builds.
- Type:
(bool)
- property constrain_aspect_ratio: bool¶
[Read-Write] 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 crop_overscan: bool¶
[Read-Write] Indicates that the overscanned pixels should be cropped at the end of the rendering pipeline, allowing the overscanned pixels to be used in post process effects that need extra pixels beyond the view frustum (e.g. lens distortion) without having to render those pixels to the screen. When bScaleResolutionWithOverscan is enabled, the cropped image will have the same resolution as the original non-overscanned image, but when disabled, the cropped image will be a lower resolution.
- Type:
(bool)
- property draw_frustum_allowed: bool¶
[Read-Write] The Frustum visibility flag for draw frustum component initialization
- Type:
(bool)
- property enable_first_person_field_of_view: bool¶
[Read-Write] True if the first person field of view should be used for primitives tagged as “IsFirstPerson”.
- Type:
(bool)
- property enable_first_person_scale: bool¶
[Read-Write] True if the first person scale should be used for primitives tagged as “IsFirstPerson”.
- Type:
(bool)
- property field_of_view: float¶
[Read-Write] 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)
- property first_person_field_of_view: float¶
[Read-Write] The horizontal field of view (in degrees) used for primitives tagged as “IsFirstPerson”.
- Type:
(float)
- property first_person_scale: float¶
[Read-Write] The scale to apply to primitives tagged as “IsFirstPerson”. This is used to scale down primitives towards the camera such that they are small enough not to intersect with the scene.
- 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:
- property lock_to_hmd: bool¶
[Read-Write] True if the camera’s orientation and position should be locked to the HMD
- Type:
(bool)
- property ortho_far_clip_plane: float¶
[Read-Write] The far plane distance of the orthographic view (in world units)
- Type:
(float)
- property ortho_near_clip_plane: float¶
[Read-Write] The near plane distance of the orthographic view (in world units)
- Type:
(float)
- property ortho_width: float¶
[Read-Write] The desired width (in world units) of the orthographic view (ignored in Perspective mode)
- Type:
(float)
- property override_aspect_ratio_axis_constraint: bool¶
[Read-Write] Whether to override the default aspect ratio axis constraint defined on the local player
- Type:
(bool)
- property overscan: float¶
[Read-Write] Amount to increase the view frustum by, from 0.0 for no increase to 1.0 for 100% increase
- Type:
(float)
- property post_process_blend_weight: float¶
[Read-Write] Indicates if PostProcessSettings should be used when using this Camera to view through.
- Type:
(float)
- property post_process_settings: PostProcessSettings¶
[Read-Write] Post process settings to use for this camera. Don’t forget to check the properties you want to override
- Type:
- property projection_mode: CameraProjectionMode¶
[Read-Write] The type of camera
- Type:
- remove_blendable(blendable_object) None¶
Removes a blendable.
- Parameters:
blendable_object (BlendableInterface)
- property scale_resolution_with_overscan: bool¶
[Read-Write] Indicates that the resolution should be scaled by the overscan amount so that the original view frustum remains the same resolution. Note that when enabled, increasing overscan will result in increased rendering workload, potentially decreasing performance as resolution increases
- Type:
(bool)
- set_aspect_ratio_axis_constraint(aspect_ratio_axis_constraint) None¶
Set Aspect Ratio Axis Constraint
- Parameters:
aspect_ratio_axis_constraint (AspectRatioAxisConstraint)
- set_auto_calculate_ortho_planes(auto_calculate) None¶
Set Auto Calculate Ortho Planes
- Parameters:
auto_calculate (bool)
- set_auto_plane_shift(auto_plane_shift) None¶
Set Auto Plane Shift
- Parameters:
auto_plane_shift (float)
- set_constraint_aspect_ratio(constrain_aspect_ratio) None¶
Set Constraint Aspect Ratio
- Parameters:
constrain_aspect_ratio (bool)
- set_crop_overscan(crop_overscan) None¶
Sets whether to crop the overscanned pixels at the end of the rendering pipeline, allowing the overscanned pixels to be used in post process effects that need extra pixels beyond the view frustum (e.g. lens distortion) without having to render those pixels to the screen. When bScaleResolutionWithOverscan is enabled, the cropped image will have the same resolution as the original non-overscanned image, but when disabled, the cropped image will be a lower resolution.
- Parameters:
crop_overscan (bool)
- set_enable_first_person_field_of_view(enable_first_person_field_of_view) None¶
Set Enable First Person Field Of View
- Parameters:
enable_first_person_field_of_view (bool)
- set_enable_first_person_scale(enable_first_person_scale) None¶
Set Enable First Person Scale
- Parameters:
enable_first_person_scale (bool)
- set_first_person_field_of_view(first_person_field_of_view) None¶
Set First Person Field Of View
- Parameters:
first_person_field_of_view (float)
- set_first_person_scale(first_person_scale) None¶
Set First Person Scale
- Parameters:
first_person_scale (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_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_scale_resolution_with_overscan(scale_resolution_with_overscan) None¶
Sets whether to scale the resolution by the amount of overscan so that the original view frustum remains the same resolution. Note that when enabled, increasing overscan will result in increased rendering workload, potentially decreasing performance as resolution increases
- Parameters:
scale_resolution_with_overscan (bool)
- set_update_ortho_planes(update_ortho_planes) None¶
Set Update Ortho Planes
- Parameters:
update_ortho_planes (bool)
- set_use_camera_height_as_view_target(use_camera_height_as_view_target) None¶
Set Use Camera Height as View Target
- Parameters:
use_camera_height_as_view_target (bool)
- 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 update_ortho_planes: bool¶
[Read-Write] Adjusts the near/far planes and the view origin of the current camera automatically to avoid clipping and light artefacting
- Type:
(bool)
- property use_camera_height_as_view_target: bool¶
[Read-Write] If UpdateOrthoPlanes is enabled, this setting will use the cameras current height to compensate the distance to the general view (as a pseudo distance to view target when one isn’t present)
- Type:
(bool)