Skip to main content

camera.set_fov_preference

Overview

  • Sets the user's camera field-of-view PREFERENCE, in degrees. Separate command from camera.set_fov because the argument means something else: this one takes the angle, that one takes the option system's 0-1 value. The value is the VERTICAL angle (AspectRatioAxisConstraint=AspectRatio_MaintainYFOV) and is rejected outside the range the option accepts, reported as fov_min/fov_max by camera.get_fov_preference and currently 30-75; it is not silently clamped, which is what camera.set_fov does. This does NOT change what any gameplay camera renders with. UB1CameraMode_Free::ComputeFOV and the follow family prefer UB1CameraJsonDataAsset.GameOptionPresetSetting.DefaultPresetMap for their mode and only fall back to this preference when there is no entry; ShoulderView and Free both have one, so in practice only the world map camera is affected. For a capture that has to render at a known field of view, use camera.observe_from_character fov_horizontal, which locks the camera manager instead. The value is written to GameUserSettings.ini and survives the process, so a caller that changes it owns putting it back.

Metadata

FieldValue
DisplaySet FOV Preference (degrees)
Categorycamera
AccessScriptCheat
ScopeB1Standalone
Tags—
Aliases—

Parameters

NameTypeRequiredDefaultDescription
valuestringyes—Vertical FOV in degrees (e.g. 66). Rejected outside fov_min..fov_max

Returns

Returns a JSON object with the following fields:

FieldTypeRequiredDescription
fov_degfloatyesVertical FOV in degrees actually stored, read back after the write
requested_fov_degfloatyesVertical FOV in degrees that was asked for
fov_minfloatyesSmallest accepted FOV in degrees
fov_maxfloatyesLargest accepted FOV in degrees
fov_axisstringyesWhich axis the value constrains; always vertical for this setting

Usage

await inzoi.cli.execute('camera.set_fov_preference', {
value: '',
});