Camera¶
16 tools for camera and spring arm components, Gameplay Camera assets and rigs, and camera shakes.
Back to the index.
add_camera_component¶
Destructive
Add a UCameraComponent to an actor placed in the editor world, found by name or label, attached to its root or to parent_component (e.g. a boom from add_spring_arm), and set FOV, projection, aspect, transform, rotation flags and post-process in one undo step. Pick it over add_component_to_actor for a non-root parent or for post_process_settings: each value it sets also turns on its bOverride_ flag, which a plain property write does not, so it takes effect; for a Blueprint's camera use add_component_to_blueprint. If the actor already has a camera component, that first one is configured instead, whatever its name, overwriting only the fields you pass. The level is marked dirty, not saved. An invalid projection_mode or a post_process_settings key that names no property is an error and nothing is created or written.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Name or label of the target actor. |
component_name |
string | no | Optional name for a new component (defaults to "Camera"); a name another object of the actor already has gets a unique variant, returned in component_name. Ignored when the actor already has a camera component, which is configured whatever its name. |
parent_component |
string | no | Optional name of a USceneComponent on the same actor to attach to (e.g. "SpringArm"). Default = actor root component. |
field_of_view |
number | no | Optional float. Horizontal FOV in degrees (1..170). |
aspect_ratio |
number | no | Optional float. Aspect ratio (e.g. 16/9). 0 = auto. |
ortho_width |
number | no | Optional float. Orthographic width (only used when projection_mode = "Orthographic"). |
projection_mode |
string | no | Optional string. "Perspective" or "Orthographic". |
location |
array | no | Optional [X, Y, Z] relative location vs parent. |
rotation |
array | no | Optional [Pitch, Yaw, Roll] relative rotation vs parent. |
b_use_controller_view_rotation |
boolean | no | Optional bool. Match pawn control rotation. |
b_use_pawn_control_rotation |
boolean | no | Optional bool. Alias for b_use_controller_view_rotation — sets UCameraComponent::bUsePawnControlRotation. |
b_lock_to_hmd |
boolean | no | Optional bool. Lock orientation to the HMD. |
post_process_settings |
object | no | Optional object of FPostProcessSettings fields by property name, e.g. {"BloomIntensity": 2}; each value also turns on its bOverride_ companion unless the object sets that companion itself; a key that names no property is an error. |
post_process_blend_weight |
number | no | Optional float. Weight of post-process (0..1). 0 means post-process disabled. |
Returns: { actor_name, component_name, parent_component, already_existed, applied_count, field_of_view, aspect_ratio, projection_mode, location: [x,y,z], rotation: [pitch,yaw,roll], post_process_blend_weight }
add_camera_node_child¶
Destructive Idempotent
Populates the Children of a composite rig node (the rig RootNode must be a UArrayCameraNode ("Sequence"); set it via set_camera_rig_root_node node_type=ArrayCameraNode). Creates a new UCameraNode of child_node_type outered to the rig and appends it, in one undo step, then saves the rig. Idempotent via optional index: index<Children.Num() REPLACES that slot instead of appending. added is the read-back of the new child in its slot; a failed save fails the call, with saved false and save_error, and leaves the change in memory. Gameplay Camera System is EXPERIMENTAL (plugin GameplayCameras). Set its parameters with set_properties on its object_path from get_camera_rig_nodes; inverse: remove_camera_node_child.
| Parameter | Type | Required | Description |
|---|---|---|---|
camera_rig_path |
string | yes | /Game/... path to the UCameraRigAsset whose composite RootNode is edited (required) |
child_node_type |
string | yes | A concrete UCameraNode subclass name for the new child, e.g. "OffsetCameraNode", "FieldOfViewCameraNode" (required) |
index |
integer | no | Optional child slot. If given and < current child count, REPLACES that slot (deterministic re-runs); otherwise appends. |
Returns: { camera_rig_path, child_node_type, child_class, child_index, children_count, added, replaced, saved, save_error }
add_gameplay_camera_component¶
Additive Idempotent
Add a UGameplayCameraComponent to an editor-world actor (name or label) and point it at a UCameraAsset via SetCameraAsset, which also rebuilds its parameter overrides; add_component_to_actor does neither. A new one is an instance component attached to the actor's root (an actor without a root takes it as its root), in one undo step; parent_component and is_root say where it went. Idempotent: an actor that already has one has that first one re-pointed, its attachment kept, and when it already points at the asset nothing is written (changed false). A camera asset that does not load is an error and nothing changes. The level is marked dirty, not saved (save_level). Activation needs a running game or PIE.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Display label or internal name of the target editor-world actor (required) |
camera_asset_path |
string | yes | /Game/... path to the UCameraAsset to reference (required) |
Returns: { actor_name, component_name, already_existed, camera_asset_path, camera_set, changed: bool (false when the component already pointed at the asset: nothing written), parent_component: string (what the component is attached to; empty when it is the root or unattached), is_root: bool }
add_spring_arm¶
Destructive
Add a USpringArmComponent (camera boom) to an actor placed in the editor world, found by name or label; if the actor already has a spring arm, that first one is configured instead, whatever its name, overwriting only the fields you pass. A new arm becomes an instance component attached to the root. One undo step; the level is marked dirty, not saved. Negative lengths, sizes and speeds clamp to 0; an unknown probe_channel is an error and nothing is created or written. Attach a camera with add_camera_component (parent_component = the returned component_name); for a Blueprint asset use add_component_to_blueprint.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Name or label of the target actor in the editor world. |
component_name |
string | no | Optional name for a new component (defaults to "SpringArm"); a name another object of the actor already has gets a unique variant, returned in component_name. Ignored when the actor already has a spring arm, which is configured whatever its name. |
target_arm_length |
number | no | Optional float. Natural length of the spring arm (uu). Default 300. |
socket_offset |
array | no | Optional [X, Y, Z] relative offset applied at the spring-arm tip. |
target_offset |
array | no | Optional [X, Y, Z] world-space offset applied at the start of the spring. |
probe_size |
number | no | Optional float. Collision probe radius. |
probe_channel |
string | no | Optional string name of ECollisionChannel (e.g. "Camera", "Visibility"). Default "Camera". |
b_do_collision_test |
boolean | no | Optional bool. Enable camera collision probe. |
b_use_pawn_control_rotation |
boolean | no | Optional bool. Use the parent pawn's view rotation. |
b_inherit_pitch |
boolean | no | Optional bool. Inherit pitch from parent. |
b_inherit_yaw |
boolean | no | Optional bool. Inherit yaw from parent. |
b_inherit_roll |
boolean | no | Optional bool. Inherit roll from parent. |
b_enable_camera_lag |
boolean | no | Optional bool. Enable positional lag. |
b_enable_camera_rotation_lag |
boolean | no | Optional bool. Enable rotational lag. |
camera_lag_speed |
number | no | Optional float. Positional lag speed (units/sec). |
camera_rotation_lag_speed |
number | no | Optional float. Rotational lag speed (deg/sec). |
Returns: { actor_name, component_name, already_existed, applied_count, target_arm_length, socket_offset: [x,y,z], target_offset: [x,y,z], probe_size, probe_channel, b_do_collision_test, b_use_pawn_control_rotation, b_inherit_pitch, b_inherit_yaw, b_inherit_roll, b_enable_camera_lag, b_enable_camera_rotation_lag, camera_lag_speed, camera_rotation_lag_speed }
build_camera_rig¶
Destructive
Build a Gameplay Cameras UCameraRigAsset, found by content path, in memory as the rig editor's Build does: its node hierarchy, interface and parameters are rebuilt from the current nodes, replacing the previous build data. built is true when build_status comes back Clean or CleanWithWarnings; WithErrors fails the call with the build errors in its message, and messages lists every build message with its severity (the editor log gets them too). Nothing is saved (saving the rig builds it again anyway); what the build changes is recorded in the call's undo step. A rig that does not resolve is an error. Edit the rig first with set_camera_rig_root_node, add_camera_node_child or set_properties on a node path; read its nodes with get_camera_rig_nodes; create one with create_camera_rig_asset.
| Parameter | Type | Required | Description |
|---|---|---|---|
camera_rig_path |
string | yes | Content path to the UCameraRigAsset, e.g. "/Game/Cameras/CR_Player" (required) |
Returns: { camera_rig_path, built, build_status, messages: [{ severity, message }] }
create_camera_asset¶
Additive
Create a UCameraAsset (Gameplay Camera System, Experimental plugin) at package_path/name and save it; one already there is returned unchanged with created=false, already_existed=true and saved=false (nothing is written), another asset class there is an error. A failed save of a new asset makes success false, with saved=false and save_error. Returns asset_path and saved. Next: set_camera_asset_director, then add_gameplay_camera_component.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Name of the UCameraAsset to create, e.g. "CA_Player"; also the last segment of its path |
package_path |
string | no | Target content folder (default "/Game/Cameras") |
Returns: { name, asset_path, asset_class, created, already_existed, saved, save_error?, note? }
create_camera_rig_asset¶
Additive Idempotent
Create an empty camera rig asset (UCameraRigAsset, from the Experimental Gameplay Cameras plugin) at package_path/name and save it; it has no root node yet. Idempotent: a camera rig already at that path is returned unchanged with created=false, already_existed=true and saved=false, since nothing is written; an asset of another class there is an error. Not an undo step. Then give it a root node with set_camera_rig_root_node, tune it with add_camera_node_child or set_properties on a node path from get_camera_rig_nodes, build it with build_camera_rig, and run it from a camera asset (create_camera_asset) through set_camera_asset_director; get_camera_rig_nodes reads it back. A failed save of a new rig makes success false, with saved=false and save_error, and the rig left in memory.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Asset name, e.g. 'CR_Player'; package_path/name must form a valid long package name. |
package_path |
string | no | Content folder as a long package path, e.g. '/Game/Cameras/Rigs' (default "/Game/Cameras"). |
Returns: { name, asset_path, asset_class, created, already_existed, saved, save_error?, note? }
create_camera_shake_blueprint¶
Additive Idempotent Refused during PIE
Create a Blueprint asset parented to UCameraShakeBase, compile and save it. UCameraShakeBase is abstract but Blueprintable; the generated Blueprint subclass is concrete. Idempotent: if the asset already exists it is loaded and returned.
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | yes | Asset name (e.g. BP_ExplosionShake) |
package_path |
string | no | Target /Game package path (optional, default "/Game/Blueprints") |
Returns: { name: string, asset_path: string, parent_class: string, generated_class: string, is_camera_shake: bool, already_existed: bool, created: bool }
get_camera_asset_info¶
Read-only
Reports which camera director a Gameplay Cameras camera asset (UCameraAsset) uses and, for a SingleCameraDirector (the one-rig director), the camera rig asset it runs. Read-only: loads the asset, changes and saves nothing; a path that does not load a UCameraAsset is an error. An asset without a director gives has_director false and director_class "None"; any director other than SingleCameraDirector gives an empty camera_rig_path, as does one whose rig is unset. To give the asset a one-rig director use set_camera_asset_director; to look inside the rig, get_camera_rig_nodes; to create an asset, create_camera_asset; to use it on an actor, add_gameplay_camera_component.
| Parameter | Type | Required | Description |
|---|---|---|---|
camera_asset_path |
string | yes | Package or object path of the UCameraAsset (required), e.g. "/Game/Cameras/CA_ThirdPerson", as create_camera_asset returns it. |
Returns: { camera_asset_path, has_director, director_class, camera_rig_path } -- camera_asset_path is the resolved object path; camera_rig_path is empty unless a SingleCameraDirector has a rig
get_camera_post_process¶
Read-only
Read the overridden PostProcessSettings off a camera actor's camera component: only the fields whose bOverride_* companion is on are returned (those actually contributing). set_properties writes them (PostProcessSettings with its bOverride_* flags). Pure reader.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_name |
string | yes | Name or label of the camera actor to query. |
Returns: { actor_name: string, post_process_blend_weight: number, overridden_count: int, settings: object (overridden field -> value; scalars as numbers, wheels as [R,G,B,master], scene_color_tint as [R,G,B,A]) }
get_camera_rig_nodes¶
Read-only
Reports a camera rig's RootNode class and its camera-parameter fields (name + value), plus, for a composite ArrayCameraNode root, its Children (index, class and their own camera-parameter fields). Read-only. It gives the node paths set_properties writes, and reads what add_camera_node_child adds and remove_camera_node_child removes.
| Parameter | Type | Required | Description |
|---|---|---|---|
camera_rig_path |
string | yes | /Game/... path to the UCameraRigAsset (required) |
Returns: { camera_rig_path, has_root_node, root_node_class, root_node_path, parameters:[{name, value}], children:[{index, class, object_path, parameters:[{name, value}]}] }
get_cameras¶
Read-only
List the camera actors (ACameraActor or CineCameraActor) in the editor world with their world location [X, Y, Z], rotation [Pitch, Yaw, Roll] in degrees and FOV, or with camera_name only the one camera found by object name or label (case-insensitive, first match; an unknown name is an error). set_actor_transform is the writer of the transform.
| Parameter | Type | Required | Description |
|---|---|---|---|
max_results |
integer | no | Maximum number of cameras to return (optional, default 1000, valid 1-10000) |
camera_name |
string | no | Optional camera to report alone, matched by actor name or label; a camera without a camera component reports fov 90 |
Returns: { cameras: [{ name: string, label: string, is_valid: bool, location: [number, number, number], rotation: [number, number, number], fov: number? }], total_count: number, max_results: number, truncated: bool, camera_name?: string }
list_camera_node_types¶
Read-only
Lists the concrete UCameraNode subclasses usable in a camera rig, sorted by name and paged with offset/limit. Read-only reflection (GetDerivedClasses).
| Parameter | Type | Required | Description |
|---|---|---|---|
offset |
integer | no | Index of the first entry returned, counted from 0 (default 0). Read the next page at the reply's next_offset. |
limit |
integer | no | Most entries returned per call, 1..1000 (default 100). |
Returns: { base_class, count (entries in this page), types:[{name, path}], total: int, offset: int, limit: int, returned: int, truncated: bool, next_offset: int|null }
remove_camera_node_child¶
Destructive
Remove the child at index from the composite ArrayCameraNode root of a camera rig, in one undo step, then save the rig. Inverse of add_camera_node_child; the children after it move down one index. A root that is not an ArrayCameraNode or an index out of range is an error and nothing changes; a failed save fails the call, with saved false and save_error, and leaves the change in memory. The reply re-reads the children (children). Gameplay Camera System is EXPERIMENTAL (plugin GameplayCameras). Read: get_camera_rig_nodes.
| Parameter | Type | Required | Description |
|---|---|---|---|
camera_rig_path |
string | yes | /Game/... path to the UCameraRigAsset whose composite RootNode is edited (required) |
index |
integer | yes | Index of the child to remove (get_camera_rig_nodes lists them) (required) |
Returns: { camera_rig_path, index, removed_class, removed, children_count, children:[string], saved, save_error }
set_camera_asset_director¶
Destructive Idempotent
Wires a new USingleCameraDirector on a UCameraAsset, pointing it at a UCameraRigAsset (the "one rig" director) and replacing any director it had, then saves the asset. One undo step. director_set is the GetCameraDirector read-back; a failed save fails the call, with saved false and save_error, and leaves the change in memory.
| Parameter | Type | Required | Description |
|---|---|---|---|
camera_asset_path |
string | yes | /Game/... path to the UCameraAsset (required) |
camera_rig_path |
string | yes | /Game/... path to the UCameraRigAsset the director runs (required) |
Returns: { camera_asset_path, camera_rig_path, director_class, director_set, saved, save_error }
set_camera_rig_root_node¶
Destructive Idempotent
Replace the RootNode of a Gameplay Cameras UCameraRigAsset with a new, default-valued node of node_type; the previous root and everything under it (children, parameter values) is dropped. Runs in an undo transaction and saves the rig; a failed save fails the call, with saved false and save_error, and leaves the change in memory. Does not build the rig (build_camera_rig does). Valid node_type names come from list_camera_node_types; configure the new root with set_properties on its root_node_path from get_camera_rig_nodes, give an ArrayCameraNode root children with add_camera_node_child, and read it back with get_camera_rig_nodes.
| Parameter | Type | Required | Description |
|---|---|---|---|
camera_rig_path |
string | yes | /Game/... path to the UCameraRigAsset (required) |
node_type |
string | yes | A concrete UCameraNode subclass name, e.g. "FieldOfViewCameraNode", "OffsetCameraNode", "ArrayCameraNode" (required) |
Returns: { camera_rig_path, node_type, node_class, root_set, saved, save_error }