Kamera

jrFrancesco in Presets


# Kamera Technical Documentation

---

## 📑 Table of Contents

- [Overview](#overview)
- [Features](#features)
- [Architecture](#architecture)
- [UI Reference](#ui-reference)
- [Parameter Reference](#parameter-reference)
- [Exposure System](#exposure-system)
- [Color Management](#color-management)
- [Sync Handler](#sync-handler)
- [API Reference](#api-reference)
- [Examples](#examples)
- [Troubleshooting](#troubleshooting)
- [Changelog](#changelog)
- [FAQ](#faq)
- [Credits](#credits)
- [🇧🇷 Documentação em Português](#-documentação-em-português)

---

## 🏁 Overview

**Kamera** is a Blender add-on that brings real-world camera controls and color science to the 3D viewport, designed for artists, filmmakers, and technical directors. It provides a physically-based workflow with real-time synchronization between UI and camera data.

---

## 🌟 Features

- Realistic sensor and lens presets
- Physically-based exposure controls (ISO, f-stop, shutter)
- White balance with Kelvin presets
- Modern color management (AgX, Filmic, Log, Standard, Raw)
- Video resolution and FPS presets
- Camera creation, alignment, focus, and transformation tools
- Real-time UI ↔ Camera synchronization

---

## 🏗️ Architecture

[UI Panel] <-> [kamera_properties.py]
| |
v v
[kamera_operators.py] <-> [sync_handler.py]
|
v
[Blender Camera API]

- **kamera_properties.py**: Stores and manages all user-facing parameters.
- **kamera_operators.py**: Handles camera creation, alignment, focus, etc.
- **kamera_ui.py**: Builds the sidebar UI.
- **sync_handler.py**: Keeps UI and camera values in sync at all times.

---

## 🖥️ UI Reference

### Technical Settings

| Parameter   | Options                                               | Description                                                        |
|-------------|-------------------------------------------------------|--------------------------------------------------------------------|
| **Sensor**  | Cinema 8K (40.96mm), Full Frame (36mm), APS-C (23.6mm)| Sets sensor size, affecting field of view and depth of field.      |
| **Lens**    | 8mm, 16mm, 24mm, 35mm, 50mm, 70mm, 135mm             | Sets focal length. Controls perspective and compression.            |

### Professional Exposure

| Parameter         | Range/Options | Description                                            |
|-------------------|--------------|--------------------------------------------------------|
| **ISO**           | 50–6400      | Sensor sensitivity. Higher = brighter, more noise.     |
| **Aperture (f/)** | 1.4–22       | Controls depth of field and exposure. Lower = more blur, more light. |
| **Shutter**       | 1/8000s–1s   | Controls motion blur and exposure time.                |

### White Balance

| Parameter         | Options      | Description                                           |
|-------------------|-------------|-------------------------------------------------------|
| **Kelvin Presets**| 2500K–9000K | Simulates color temperature of various lighting.      |

### Color Management

| Parameter         | Options                                   | Description                                   |
|-------------------|-------------------------------------------|-----------------------------------------------|
| **View Transform**| AgX, Filmic, Filmic Log, Standard, Raw    | Sets Blender's color management pipeline.     |
| **CM Exposure**   | -10 to +10                                | Post-process exposure compensation.           |

### Video Settings

| Parameter         | Options                                   | Description                                   |
|-------------------|-------------------------------------------|-----------------------------------------------|
| **Resolution**    | 4K, HD 16:9, HD 9:16, HD 1:1, Cinema 4K, 8K | Output format presets.                      |
| **FPS**           | 23.98, 24, 25, 29.97, 30, 48, 50, 59.94, 60, 120, 240 | Output frame rate presets. |

### Camera Controls

| Tool                  | Description                                    |
|-----------------------|------------------------------------------------|
| **Create Kamera**     | Adds a new camera with all presets.            |
| **Align Camera to View** | Matches camera to current viewport.         |
| **Aim at Object**     | Rotates camera to face selected object.        |
| **Set Focus**         | Creates and sets a focus target for DOF.       |

### Focus & Transform

| Parameter         | Description                                       |
|-------------------|---------------------------------------------------|
| **Focus Object**  | Select object for focus tracking.                 |
| **DOF Aperture**  | Set f-stop for depth of field.                    |
| **Camera Location** | Move camera directly.                           |

---

## 📊 Parameter Tables

### Sensor Presets

| Preset         | Size (mm) | Use Case                |
|----------------|-----------|-------------------------|
| Cinema 8K      | 40.96     | VFX, high-end film      |
| Full Frame     | 36.0      | Photography, pro video  |
| APS-C          | 23.6      | Streaming, compact rigs |

### Lens Presets

| Preset | Focal Length (mm) | Angle of View | Typical Use        |
|--------|-------------------|--------------|--------------------|
| 8mm    | 8                 | 180°         | Fisheye, effects   |
| 16mm   | 16                | 107°         | Ultra wide, action |
| 24mm   | 24                | 84°          | Landscape, archviz |
| 35mm   | 35                | 63°          | Documentary        |
| 50mm   | 50                | 46°          | Portrait, classic  |
| 70mm   | 70                | 34°          | Close-up           |
| 135mm  | 135               | 18°          | Telephoto, detail  |

### Exposure Presets

| ISO  | Typical Use          |
|------|----------------------|
| 50   | Studio, bright light |
| 400  | Indoor, cloudy       |
| 3200 | Night, low light     |

| f/stop | Effect               |
|--------|---------------------|
| 1.4    | Shallow DOF, bright |
| 8      | Sharp, landscape    |
| 22     | Max DOF, sun        |

| Shutter | Effect                |
|---------|----------------------|
| 1/8000  | Freeze fast motion   |
| 1/60    | Handheld, normal     |
| 1       | Long exposure, blur  |

### Kelvin Presets

| Kelvin | Lighting Condition    |
|--------|----------------------|
| 2500K  | Candle light         |
| 3200K  | Tungsten             |
| 5600K  | Daylight             |
| 9000K  | Blue sky             |

---

## 🧮 Exposure System

### Exposure Formula

\[
EV = \log_2\left(\frac{N^2}{t}\right) + \log_2\left(\frac{S}{100}\right) - 12.5
\]

Where:
- \(N\) = Aperture (f/)
- \(t\) = Shutter speed (seconds)
- \(S\) = ISO

**Implementation:**  
See `update_exposure` in `kamera_properties.py`

### Kelvin/White Balance

- Converts Kelvin to Blender's white balance scale:
  - `inverted_kelvin = 11500 - kelvin`
- Sets `scene.view_settings.white_balance_temperature = inverted_kelvin`

---

## 🎨 Color Management

- **View Transform**: Sets Blender's `scene.view_settings.view_transform`
- **CM Exposure**: Sets `scene.view_settings.exposure`
- **Sync**: All changes reflected in both UI and camera in real time via `sync_handler.py`

---

## 🔄 Sync Handler

- Runs every 0.1s
- Updates UI presets if camera values are changed manually
- Ensures bidirectional sync between camera and UI

---

## 🛠️ API Reference

### Accessing Properties

props = bpy.context.scene.kamera_props
current_iso = props.iso
props.aperture = '2.8'


### Creating a Kamera
bpy.ops.kamera.create_camera()


### Setting Focus
bpy.ops.kamera.set_focus()


---

## 🧑‍💻 Examples

**Portrait Setup:**
props.sensor_presets = 'FULL_FRAME'
props.lens_presets = '85mm'
props.aperture = '2.8'
props.iso = '100'
props.shutter = '125'


**Animation:**
props.aperture = '1.4'
bpy.context.scene.camera.keyframe_insert('data.dof.aperture_fstop')


---

## 🛟 Troubleshooting

- **Panel not visible:** Ensure you are in Object Mode and the add-on is enabled.
- **Sync not working:** Try clicking "Create Kamera" to reset. If still not working, reload the add-on.
- **Camera not updating:** Check for Blender errors in the system console.

---

## 📝 Changelog

- **v1.0**: Initial release - full camera simulation, real-time sync, robust UI.

---

## ❓ FAQ

**Q: Can I use this add-on commercially?**  
A: Yes, as long as you comply with the GPLv3 license.

**Q: How do I add a new lens preset?**  
A: Edit the `lens_presets` EnumProperty in `kamera_properties.py` and add your value to the dictionary in `update_lens()`.

**Q: Is it compatible with Blender 4.4+?**  
A: Yes, tested and stable on Blender 4.4.3 and above.

---

## 👥 Credits

- Development: Francesco Jr & Perplexity Bro
- License: GPLv3
- Special thanks: Blender Community

---

## 🇧🇷 Documentação em Português

### Visão Geral

Kamera é um add-on para o Blender que traz controles de câmera realistas e gerenciamento de cor físico para a viewport 3D, com sincronização em tempo real entre a interface e os dados da câmera.

### Tabelas de Parâmetros

#### Sensores

| Preset      | Tamanho (mm) | Uso |
|-------------|--------------|-----|
| Cinema 8K   | 40.96        | VFX, cinema |
| Full Frame  | 36.0         | Foto, vídeo |
| APS-C       | 23.6         | Streaming  |

#### Lentes

| Preset | Foco (mm) | Ângulo | Uso |
|--------|-----------|--------|-----|
| 8mm    | 8         | 180°   | Fisheye |
| 50mm   | 50        | 46°    | Retrato |

#### Exposição

| ISO | Situação        |
|-----|-----------------|
| 50  | Estúdio         |
| 3200| Noite           |

| f/  | Efeito          |
|-----|-----------------|
| 1.4 | Fundo desfocado |
| 8   | Paisagem        |

| Obturador | Efeito          |
|-----------|-----------------|
| 1/8000    | Movimento rápido|
| 1         | Longa exposição |

#### Balanço de Branco

| Kelvin | Luz             |
|--------|-----------------|
| 2500K  | Vela            |
| 5600K  | Luz do dia      |

---

Para mais exemplos, dicas e suporte, veja o README.md e o Manual do Blender.

---



$19

Have questions about this product?
Login to message

Details
Blender Extension Compatible Yes
Dev Fund Contributor
Published over 1 year ago
Blender Version 4.4
Extension Type Add-on
Render Engine Used Cycles
License GPL