Skip to content

World - Camera Module

anvil.api.world.camera

CameraPreset

Bases: AddonObject

A class representing a CameraPreset.

identifier property

Returns the identifier of the addon object in the format 'namespace:name'.

Returns:

Name Type Description
str Identifier

The identifier of the addon object.

name property

Returns the name of the addon object.

Returns:

Name Type Description
str str

The name of the addon object.

__init__(name, inherit_from)

Initializes a CameraPreset instance.

Parameters:

Name Type Description Default
name str

The name of the camera preset.

required
is_vanilla bool

Whether the camera preset is a vanilla camera preset. Defaults to False.

required

content(content)

Sets the content of the addon object and returns the object.

Parameters:

Name Type Description Default
content any

The content to be set for the addon object.

required

Returns:

Name Type Description
self AddonObject

The instance of the current AddonObject.

do_not_shorten()

Setter property that disables shortening of dict when exporting.

extend_player_rendering(value=True)

Sets whether the player rendering is extended.

Parameters:

Name Type Description Default
value bool

Whether the player rendering is extended.

True

listener(value)

Sets whether the listener is enabled.

Parameters:

Name Type Description Default
value bool

Whether the listener is enabled.

required

player_effects(value)

Sets whether the player effects are enabled.

Parameters:

Name Type Description Default
value bool

Whether the player effects are enabled.

required

position(x=0, y=0, z=0)

Sets the position of the camera preset.

Parameters:

Name Type Description Default
x float

The x position of the camera preset.

0
y float

The y position of the camera preset.

0
z float

The z position of the camera preset.

0

queue()

Queues the camera preset to be exported.

rotation(x=0, y=0)

Sets the rotation of the camera preset.

Parameters:

Name Type Description Default
x float

The x rotation of the camera preset.

0
y float

The y rotation of the camera preset.

0

starting_rotation(x=0, y=0)

Sets the starting rotation of the camera preset.

Parameters:

Name Type Description Default
x float

The x rotation of the camera preset.

0
y float

The y rotation of the camera preset.

0