pohlke.operators#

Defines camera operators and scene handlers for the Parallel Cameras add-on.

Classes#

Pohlke_OT_CreateCam

Operator responsible for creating a parallel projection camera.

Pohlke_OT_switch_angles

Switch Alpha and Beta angle values

Functions#

set_pixel_ratio(→ None)

Automatically update pixel ratio when the scene updates.

register(→ None)

Register operator and handlers to Blender.

unregister(→ None)

Unregister operator and handlers from Blender.

Module Contents#

class pohlke.operators.Pohlke_OT_CreateCam[source]#

Bases: bpy.types.Operator

Operator responsible for creating a parallel projection camera.

Attributes#

projection_typeenum

Main projection category:

  • ‘AXONOMETRIC’ : Axonometric projections.

  • ‘OBLIQUE’ : Oblique projections.

axonometric_typeenum

Sub-preset for axonometric cameras.

Available values are dynamically generated from the projection definitions declared in presets.toml and loaded via data.py. They are no longer hardcoded.

Each preset follows the naming pattern:

‘AXONOMETRIC_#<n>’

where <n> is the index of the preset as defined in presets.toml.

A ‘CUSTOM’ entry is automatically added when the current projection parameters do not match any predefined preset.

oblique_typeenum

Sub-preset for oblique cameras.

Available values are dynamically generated from the projection definitions declared in presets.toml and loaded via data.py. They are no longer hardcoded.

Each preset follows the naming pattern:

‘OBLIQUE_#<n>’

where <n> is the index of the preset as defined in presets.toml.

A ‘CUSTOM’ entry is automatically added when the current projection parameters do not match any predefined preset.

betafloat

The beta angle of the plan (in radians)

alphafloat

The alpha angle of the plan (in radians)

is_updatingbool

Internal flag to prevent infinite update loops during property sync.

rotationfloat

Computed rotation around the vertical axis, derived from alpha and beta.

altitudefloat

Computed altitude angle, derived from alpha and beta.

altitude_obliquefloat

Complementary angle used specifically for oblique projections.

x_valuefloat

Scaling factor for the X axis (0.0 to 1.0).

normalized_x_valuefloat

Nomalized scaling factor for the X axis (0.0 to 1.0).

y_valuefloat

Scaling factor for the Y axis (0.0 to 1.0).

normalized_y_valuefloat

Nomalized scaling factor for the Y axis (0.0 to 1.0).

z_valuefloat

Scaling factor for the Z axis (0.0 to 1.0).

normalized_z_valuefloat

Nomalized scaling factor for the Z axis (0.0 to 1.0).

positionenum

Vertical placement of the camera relative to the scene:

  • ‘ABOVE’ : Standard view from top-down.

  • ‘BELOW’ : View from bottom-up.

orientationenum

The quadrant orientation (1 to 4) toward which the camera is facing.

ortho_scalefloat

The camera’s orthographic scale.

draw(context: bpy.types.Context) None[source]#

Draw the operator UI inside Blender popups or menus.

Parameters#

contextbpy.types.Context

Blender context

check(context: bpy.types.Context) None[source]#

Check if beta, alpha or isOblique values changed to update the camera settings

Parameters#

contextbpy.types.Context

Blender context

execute(context: bpy.types.Context) set[str][source]#

Execute the camera creation logic.

Creates a new orthographic camera configured according to the selected projection parameters.

Parameters#

contextbpy.types.Context

Blender context

Returns#

set[str]

Blender operator result status

class pohlke.operators.Pohlke_OT_switch_angles[source]#

Bases: bpy.types.Operator

Switch Alpha and Beta angle values

execute(context)[source]#

Perform alpha and beta angle swapping

Parameters#

contextbpy.types.Context

Blender context

Returns#

set[str]

Blender operator result status

pohlke.operators.set_pixel_ratio(scene: bpy.types.Scene) None[source]#

Automatically update pixel ratio when the scene updates.

Ensures that orthographic distortion remains consistent when switching cameras or updating the dependency graph.

Parameters#

scenebpy.types.Scene

Current Blender scene

pohlke.operators.register() None[source]#

Register operator and handlers to Blender.

pohlke.operators.unregister() None[source]#

Unregister operator and handlers from Blender.