unreal.LensComponent

class unreal.LensComponent(outer: Object | None = None, name: Name | str = 'None')

Bases: ActorComponent

Component for applying a post-process lens distortion effect to a CineCameraComponent on the same actor

C++ Source:

  • Plugin: LensComponent

  • Module: LensComponent

  • File: LensComponent.h

Editor Properties: (see get_editor_property/set_editor_property)

  • apply_distortion (bool): [Read-Write] Whether or not to apply distortion to the target camera component

  • apply_nodal_offset_on_tick (bool): [Read-Write] If checked, nodal offset will be applied automatically when this component ticks. Set to false if nodal offset needs to be manually applied at some other time (via Blueprints).

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

  • asset_user_data_editor_only (Array[AssetUserData]): [Read-Write] Array of user data stored with the component

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

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

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

  • cropped_filmback (CameraFilmbackSettings): [Read-Write] Cropped filmback to use if the filmback override settings are set to use it

  • distortion_source (DistortionHandlerPicker): [Read-Write] deprecated: This property has been deprecated. Use GetDistortionSource() and SetDistortionSource() instead.

  • distortion_state (LensDistortionState): [Read-Write] The current distortion state

  • distortion_state_source (DistortionSource): [Read-Write] Specifies from where the distortion state information comes

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

  • eval_inputs (LensFileEvaluationInputs): [Read-Only] Inputs to LensFile evaluation

  • evaluation_mode (FIZEvaluationMode): [Read-Write] Specify how the Lens File should be evaluated

  • filmback_override (FilmbackOverrideSource): [Read-Write] Controls whether this component can override the camera’s filmback, and if so, which override to use

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

  • lens_file_picker (LensFilePicker): [Read-Write] Lens File used to drive distortion with current camera settings

  • lens_model (type(Class)): [Read-Write] The current lens model used for distortion

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

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

  • original_tracked_component_transform (Transform): [Read-Only] Serialized transform of the TrackedComponent prior to nodal offset being applied

  • overscan_multiplier (float): [Read-Write] The percentage of the computed overscan that should be applied to the target camera

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

  • 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_overscan (bool): [Read-Write] Whether to scale the computed overscan by the overscan percentage

  • target_camera_component (ComponentReference): [Read-Write] The CineCameraComponent on which to apply the post-process distortion effect

property apply_distortion: bool

[Read-Write] Whether or not to apply distortion to the target camera component

Type:

(bool)

apply_nodal_offset(component_to_offset, use_manual_inputs=False, manual_focus_input=0.000000, manual_zoom_input=0.000000) None

Manually apply nodal offset to the specified component. If bUseManualInputs is true, the input Focus and Zoom values will be used to evaluate the LensFile . If bUseManualInputs is false, the LensFile be will evaluated based on the Lens Component’s evaluation mode.

Parameters:
clear_distortion_state() None

Reset the distortion state to defaults to represent “no distortion”

property distortion_source: DistortionHandlerPicker

[Read-Write] deprecated: This property has been deprecated. Use GetDistortionSource() and SetDistortionSource() instead.

Type:

(DistortionHandlerPicker)

property distortion_state: LensDistortionState

[Read-Write] The current distortion state

Type:

(LensDistortionState)

get_cropped_filmback() CameraFilmbackSettings

Get the cropped filmback (only relevant if the filmback override setting is set to use the CroppedFilmback

Return type:

CameraFilmbackSettings

get_distortion_source() DistortionSource

Get the distortion source setting

Return type:

DistortionSource

get_distortion_state() LensDistortionState

Get the current distortion state

Return type:

LensDistortionState

get_filmback_override_setting() FilmbackOverrideSource

Get the filmback override setting

Return type:

FilmbackOverrideSource

get_fiz_evaluation_mode() FIZEvaluationMode

Get the evaluation mode used to evaluate the LensFile

Return type:

FIZEvaluationMode

get_lens_distortion_handler() LensDistortionModelHandlerBase

Returns the LensDistortionHandler in use for the current LensModel

Return type:

LensDistortionModelHandlerBase

get_lens_file() LensFile

Get the LensFile used by this component

Return type:

LensFile

get_lens_file_evaluation_inputs() LensFileEvaluationInputs

Get the data used by this component to evaluate the LensFile

Return type:

LensFileEvaluationInputs

get_lens_file_picker() LensFilePicker

Get the LensFile picker used by this component

Return type:

LensFilePicker

get_lens_model()

Get the current lens model

Return type:

type(Class)

get_original_focal_length() float

Get the original (not adjusted for overscan) focal length of the camera

Return type:

float

get_overscan_multiplier() float

Get the evaluation mode used to evaluate the LensFile

Return type:

float

property original_tracked_component_transform: Transform

[Read-Only] Serialized transform of the TrackedComponent prior to nodal offset being applied

Type:

(Transform)

property overscan_multiplier: float

[Read-Write] The percentage of the computed overscan that should be applied to the target camera

Type:

(float)

property scale_overscan: bool

[Read-Write] Whether to scale the computed overscan by the overscan percentage

Type:

(bool)

set_apply_distortion(apply) None

Set whether distortion should be applied to the target camera

Parameters:

apply (bool) –

set_apply_nodal_offset_on_tick(apply_nodal_offset) None

Set whether nodal offset should be automatically applied during this component’s tick

Parameters:

apply_nodal_offset (bool) –

set_cropped_filmback(filmback) None

Set the cropped filmback (only relevant if the filmback override setting is set to use the CroppedFilmback

Parameters:

filmback (CameraFilmbackSettings) –

set_distortion_source(source) None

Set the distortion source setting

Parameters:

source (DistortionSource) –

set_distortion_state(state) None

Set the current distortion state

Parameters:

state (LensDistortionState) –

set_filmback_override_setting(setting) None

Set the filmback override setting

Parameters:

setting (FilmbackOverrideSource) –

set_fiz_evaluation_mode(mode) None

Set the evaluation mode used to evaluate the LensFile

Parameters:

mode (FIZEvaluationMode) –

set_lens_file(lens_file) None

Set the LensFile used by this component

Parameters:

lens_file (LensFile) –

set_lens_file_picker(lens_file) None

Set the LensFile picker used by this component

Parameters:

lens_file (LensFilePicker) –

set_lens_model(model) None

Set the current lens model

Parameters:

model (type(Class)) –

set_overscan_multiplier(multiplier) None

Set the LensFile used by this component

Parameters:

multiplier (float) –

should_apply_distortion() bool

Whether distortion should be applied to the target camera

Return type:

bool

should_apply_nodal_offset_on_tick() bool

Returns true if nodal offset will be automatically applied during this component’s tick, false otherwise

Return type:

bool

was_distortion_evaluated() bool

Returns true if distortion was evaluated this tick

Return type:

bool

was_nodal_offset_applied_this_tick() bool

Returns true if nodal offset was applied during the current tick, false otherwise

Return type:

bool