Skip to main content

camera.get_view

Overview

  • Returns the live state of the active game camera: world position, rotation, the forward/right/up unit vectors derived from that rotation, the field of view actually in effect this frame, aspect ratio, projection mode, viewport resolution, the current inZOI camera mode (ShoulderView, QuarterView, BuildView, PhotoMode, ...) and the actor the camera is following. This reads the camera cache the renderer used, so fov here is the value in effect right now, which can differ from the user preference reported by camera.get_settings. fov is the raw camera value; fov_axis names the aspect-axis constraint, not the unit of that value. horizontal_fov and vertical_fov are extracted from the final unjittered local-player projection when available. Use those angles for coverage, not the raw fov. aspect_ratio is the effective one used to render (the viewport aspect unless the camera constrains it), not the camera's raw reference AspectRatio, which can also affect FOV conversion. Coordinates are Unreal world space: left-handed, Z-up, centimetres, with forward = +X, right = +Y, up = +Z. The camera interpolates and does collision avoidance every frame, so treat the result as a snapshot; pause the simulation first if you need a stable reading.

Metadata

FieldValue
DisplayGet Camera View
Categorycamera
AccessPublic
ScopeB1Standalone
TagsExperimental
Aliases—

Parameters

  • This command takes no parameters.

Returns

Returns a JSON object with the following fields:

FieldTypeRequiredDescription
locationobjectyesCamera world position in centimetres
location.xfloatyesX (forward axis of the world)
location.yfloatyesY (right axis of the world)
location.zfloatyesZ (up axis of the world)
rotationobjectyesCamera orientation in degrees
rotation.pitchfloatyesPitch, positive looks up
rotation.yawfloatyesYaw, positive turns right
rotation.rollfloatyesRoll
forwardobjectyesUnit vector the camera is looking along
forward.xfloatyesX component
forward.yfloatyesY component
forward.zfloatyesZ component
rightobjectyesUnit vector pointing to the camera's right
right.xfloatyesX component
right.yfloatyesY component
right.zfloatyesZ component
upobjectyesUnit vector pointing up from the camera
up.xfloatyesX component
up.yfloatyesY component
up.zfloatyesZ component
fovfloatyesField of view in degrees actually applied this frame. Which AXIS this measures is decided by fov_axis - in inZOI it is the VERTICAL fov, because DefaultEngine.ini sets AspectRatioAxisConstraint=AspectRatio_MaintainYFOV. Use horizontal_fov for any left-right coverage maths
horizontal_fovfloatyesLeft-right field of view in degrees, derived the same way the projection matrix derives it: equal to fov under MaintainXFOV, otherwise 2*atan(tan(fov/2) * aspect_ratio). At 90 deg vertical and 16:9 this is 121.3 deg, so treating fov as horizontal under-states the covered angle by over 30 percent
vertical_fovfloatyesUp-down field of view in degrees, derived the way the projection matrix derives it: equal to fov under MaintainYFOV, which is what inZOI pins, otherwise 2*atan(tan(fov/2) / aspect_ratio)
fov_axisstringyesWhich axis fov constrains: MaintainYFOV (fov is vertical), MaintainXFOV (fov is horizontal) or MajorAxisFOV (whichever viewport axis is larger)
desired_fovfloatyesRaw DesiredFOV field of the camera cache. inZOI camera modes set the FOV directly every frame, so this normally stays at the engine default of 90 and never converges on fov — do not read it as a target the camera is moving towards
aspect_ratiofloatyesEffective width divided by height actually used to render: the viewport aspect, unless the camera constrains the aspect ratio. Use this one for screen projection maths
camera_aspect_ratiofloatyesRaw AspectRatio field of the camera cache. Only honoured when constrain_aspect_ratio is true; otherwise it is a leftover engine default (4:3) and does not describe the rendered image
constrain_aspect_ratioboolyesWhether the camera constrains its aspect ratio (letterboxing/pillarboxing). False during normal inZOI play
fov_lockedboolyesWhether fov came from the camera manager's FOV lock instead of from the camera mode. A locked FOV is exactly the number that was set and does not move while camera modes cross-fade; an unlocked one is a per-frame weighted average over the camera blend stack and changes from frame to frame, so it is only meaningful as a snapshot. camera.observe_from_character sets this lock
projection_modestringyesPerspective or Orthographic
ortho_widthfloatyesOrthographic view width; meaningless in perspective mode
viewport_sizeobjectyesRender resolution of the game viewport in pixels
viewport_size.xintyesWidth in pixels
viewport_size.yintyesHeight in pixels
camera_modestringyesActive inZOI camera mode enum name
view_targetstringyesName of the actor the camera is following, empty if none
view_target_classstringyesClass name of the view target
view_target_entity_identityIdyesEntity id of the view target, 0 if it is not a game entity

Usage

await inzoi.cli.execute('camera.get_view');