# Two Point Zero — Blender Shot Export Workflow

Version 1.0 — tested with Blender 5.2.3 LTS on macOS.

This guide is standalone. No conversation history, Zed configuration, Python packages, app credentials, or access to the original development machine is required for the normal workflow.

## 1. What the workflow does

Blender supplies camera composition, simple geometry, depth, semantic object information, and original visual references. The Blender add-on packages one camera into one ZIP. Two Point Zero imports that ZIP and turns it into an image-generation setup.

```text
Blender scene + original reference photos
                  ↓
       Two Point Zero Shot Exporter
                  ↓
            one shot ZIP
                  ↓
       Two Point Zero ZIP importer
                  ↓
      Prompt review and model generation
```

This is a **file-based workflow**, not a live connection. After changing the scene, export and import the shot again. The `.blend` file itself is never uploaded or required by the app.

## 2. Do you need Blender?

| User | What is needed |
|---|---|
| Someone importing an existing shot ZIP | Only Two Point Zero; Blender is not needed |
| Someone exporting cameras from an existing `.blend` | Blender and the supplied exporter add-on |
| Someone building a new location | Blender, the add-on, reference images, and semantic metadata |
| A developer controlling Blender through the Zed agent | The separate optional Agent Bridge described in section 14 |

The exporter uses Blender's bundled Python and standard library. No `pip`, `uv`, internet connection, fal.ai key, or external render service is needed in Blender.

## 3. Files in this kit

- `two_point_zero_shot_exporter.py` — the add-on to install.
- `templates/LOCATION_BRIEF.template.json` — empty structure for a new location.
- `templates/LOCATION_BRIEF.example.json` — a filled structural example; edit it before use.
- This guide.

The exporter's current add-on version is 1.0.0. Blender 5.2.3 is the tested version. Other Blender versions and operating systems have not been verified, even though the add-on declares Blender 4.2 or newer.

## 4. Install the exporter on a new computer

1. Install and open Blender.
2. Open **Preferences**:
   - macOS: **Blender → Preferences**.
   - Windows/Linux: **Edit → Preferences**.
3. Open **Add-ons**.
4. Open the add-on menu and choose **Install from Disk**.
5. Select `two_point_zero_shot_exporter.py`.
6. Search for **Two Point Zero Shot Exporter** and enable its checkbox.
7. If your Blender preferences are not set to save automatically, click **Save Preferences**.
8. Return to the 3D View. Hover over it and press **N** to open the sidebar.
9. Open the **Shot Export** tab.

You should see a **Two Point Zero** panel with a camera selector and export fields. The add-on is installed per Blender user/version on that computer; installing it on one computer does not install it elsewhere.

### Updating or removing it

For an update, disable the old version, install the replacement file, enable it, and restart Blender if the panel behaves as though old code is still loaded. To remove it, use the add-on's Remove/Disable controls in Preferences. Your `.blend` files and already-exported ZIPs remain usable.

## 5. Prepare a location folder

Save the `.blend` before exporting. The exporter finds references relative to that saved file.

Recommended structure:

```text
MyLocation/
├── MyLocation.blend
├── references/
│   ├── REF_01.jpg
│   └── REF_02.jpg
└── exports/                 ← created automatically when needed
    ├── LOCATION_001.zip
    └── LOCATION_002.zip
```

Rules:

- Use real original image files, not text files with image extensions.
- Supported reference formats: PNG, JPEG, WebP, and TIFF.
- Filename stems must match reference IDs: `REF_01.jpg` corresponds to `REF_01`.
- An explicit valid image path in `LOCATION_BRIEF.json` can be used instead.
- macOS `._filename` AppleDouble files are ignored.
- Keep each completed ZIP below 50 MB. Convert excessively large source photos to high-quality JPEG copies if necessary.
- The package contains the actual references, so share it only with people allowed to receive those images. Check source-photo metadata such as EXIF if privacy matters.

## 6. Minimum viable scene versus recommended scene

A minimal scene needs only:

- At least one camera.
- Renderable geometry.
- At least one real image in `references/`.

It can be exported, but objects without semantic metadata will have raw Blender names, importance 0, and no generated prose description. The app will therefore have less useful prompt information.

For the intended workflow, add semantic metadata as described below.

## 7. Add semantic object information

The app builds its initial scene prompt from objects marked `in_frustum`, using each object's description, numeric importance, generation note, and references.

### Option A — central location brief, recommended for substantial scenes

1. In Blender, change an editor to **Text Editor**.
2. Create a text datablock and paste the contents of `LOCATION_BRIEF.template.json`.
3. Name the datablock exactly `LOCATION_BRIEF.json`.
4. Add reference and entity entries. The supplied example shows the structure.
5. Give each relevant renderable object an `entity_id` custom property matching an entity entry.

Example structure:

```json
{
  "references": {
    "REF_01": {
      "file": null,
      "description": "the original photograph describing BUILDING_01 and the adjacent street"
    }
  },
  "entities": {
    "BUILDING_01": {
      "label": "Main building",
      "reference_ids": ["REF_01"],
      "description": "a low rectangular building with a flat roof and a broad entrance",
      "importance": 3,
      "generation_notes": "keep the roofline and entrance placement unchanged",
      "geometry_confidence": "visible faces reference-led; hidden faces inferred"
    }
  }
}
```

Use `file: null` when the image is in the adjacent `references/` folder. A path beginning `//` is relative to the `.blend`.

Multiple meshes can share one `entity_id`; they become one semantic object in the manifest, while their individual transforms remain under `component_objects`.

### Option B — object custom properties, convenient for small scenes

Select an object and open **Object Properties → Custom Properties**. Add:

| Property | Example | Meaning |
|---|---|---|
| `entity_id` | `BUILDING_01` | Groups component meshes into one semantic entity |
| `reference_ids` | `REF_01,REF_02` | Comma-separated reference associations |
| `ai_description` | `a low rectangular building with a broad entrance` | Prompt prose, not a database label |
| `ai_importance` | `3`, `2`, `1`, or `high`, `medium`, `low` | Higher values are more important |
| `generation_notes` | `keep the roofline unchanged` | Optional constraint the director cares about |
| `geometry_confidence` | `hidden sides inferred` | Optional reconstruction note |

Repeat shared metadata on component objects when practical. Without a central brief, the exporter gathers this information from the objects.

**Important:** when `LOCATION_BRIEF.json` exists, it takes precedence. Do not reuse an old location's brief in a new scene. Update it or remove it; otherwise irrelevant descriptions can appear in the app.

### Writing good metadata

- Describe visible identity and spatial role concisely.
- Use prompt-ready prose: `a weathered two-storey brick shop across the road`.
- Use numeric importance to prioritize the main structures; 3/2/1 is a useful convention, not a required range.
- Include only constraints that matter. Avoid repeating generic notes on every object.
- Unknown descriptions or notes should be omitted, not invented.
- `generation_brief.instruction` is separate director intent and is never derived from these descriptions.

## 8. Prepare cameras

1. Create or select a camera.
2. Set the desired scene frame; the exporter uses the current scene state.
3. Check the camera view and framing. Numpad 0 normally toggles camera view.
4. In **Shot Export**, select the camera in the panel's **Camera** field.
5. Assign a short, stable **Shot ID**, such as `LOCATION_001`.

A blank Shot ID is derived from the camera name. Reusing the same ID across re-exports labels the result as the same shot. Use another ID for another camera.

The exporter respects `hide_render`. Hidden-reference guides should have rendering disabled. `in_frustum` is a conservative bounding-box test; it does not mean the object is unoccluded or visible in the final image.

## 9. Optional director fields

Each camera has independent fields in the panel:

- **Title** — optional shot title.
- **Creative instruction** — the director's intent, exported verbatim.
- **Avoid** — one constraint per line.
- **Director's notes** — private notes, also written to `extra/user_notes.txt`.
- **Style preset** — optional human-entered preset name.

Leave them empty if the director will write the instruction in Two Point Zero. Empty creative fields are omitted. The add-on never generates creative intent.

## 10. Export and import a shot

### In Blender

1. Click **Export Shot ZIP**.
2. Choose a destination and filename.
3. Wait while the normal render, entity-ID map, depth map, preview, and ZIP are produced.
4. Read any completion or error message.

The exporter temporarily changes render settings for technical passes and restores them afterward. It does not require saving the `.blend` again.

Each ZIP contains:

```text
shot_manifest.json
greybox.png
preview.jpg
depth.png
object_ids.png
references/…
extra/user_notes.txt       ← only when notes exist
```

The manifest uses schema version 1 and includes camera data, semantic objects, file paths, and SHA-256 checksums. No model names, API parameters, URLs, credentials, or `.blend` are included.

### In Two Point Zero

1. Open the app's Blender/shot-package import feature.
2. Select the exported ZIP, not the `.blend`.
3. Wait for the importer to validate and process the package.
4. Review the detected references and the initial scene description.
5. Add or edit the director's creative instruction as desired.
6. Choose the generation workflow and settings in the app.

Blender does not choose an AI model. The package is deliberately model-agnostic.

For video, a typical workflow is to approve a generated still first and then use the app's image-to-video workflow. This exporter currently creates **single-camera still-shot packages**, not animated frame sequences.

To update a shot, re-export the same camera and Shot ID, then import the new ZIP. Export each additional camera as its own ZIP.

## 11. New-computer acceptance test

Before relying on the setup:

- [ ] Blender opens and the **Shot Export** sidebar panel is visible.
- [ ] A test `.blend` is saved in its own location folder.
- [ ] At least one real reference image is in `references/`.
- [ ] A camera is selected and has a stable Shot ID.
- [ ] The exporter produces one ZIP without a missing-reference error.
- [ ] The ZIP is below 50 MB and opens correctly.
- [ ] Two Point Zero imports it successfully.
- [ ] The app prompt contains the intended objects and no stale text from another location.

Keep one known-good test location and shot ZIP for support. Do not include confidential references in a shared support package unless permitted.

## 12. Troubleshooting

| Problem | What to check |
|---|---|
| **Shot Export tab is missing** | Confirm the add-on is enabled, save preferences, restart Blender, and check the installed add-on version |
| **Reference photographs are required** | Save the `.blend`; put real images beside it in `references/`; match filename stems to reference IDs |
| **A reference file is rejected** | Verify it is an actual supported image, not an alias, placeholder, text file, or `._` AppleDouble file |
| **Prompt contains an old location's text** | Remove or update the stale `LOCATION_BRIEF.json`; it overrides object-only metadata |
| **Prompt is sparse or generic** | Add `entity_id`, prose descriptions, importance, and reference associations to major objects |
| **An expected object is absent** | Check its geometry type, `hide_render`, entity grouping, and camera-frustum bounds |
| **ZIP exceeds 50 MB** | Use smaller high-quality JPEG reference copies; do not remove required references |
| **Re-export appears under another shot** | Reuse the same camera Shot ID; a changed camera name changes an automatically derived ID |
| **Technical render passes fail** | Confirm Eevee rendering works on that Blender installation and test with a simple camera/scene |
| **App rejects the package** | Confirm it is the exported ZIP and record the exact importer error; do not upload the `.blend` |

For support, record the operating system, Blender version, add-on version, exact error, and whether the acceptance test failed in Blender or during app import. Never share app credentials.

## 13. Optional command-line export

For technical users, the source file also supports Blender's command-line Python runner:

```sh
blender "MyLocation.blend" --python "two_point_zero_shot_exporter.py" -- --camera "Camera" --output "exports/LOCATION_001.zip"
```

Optional arguments after `--` include `--width`, `--height`, and `--far-metres`. The normal sidebar workflow is recommended for most users.

## 14. Optional Zed Agent Bridge — not part of app import

A separate developer tool exists in the original workspace at `Blender/blender_agent/`. It lets a Zed agent control a running Blender session:

```text
Zed agent → MCP server → localhost Blender bridge → bpy
```

It is **not** used by the Two Point Zero importer and is not included in this kit. Install it only on development machines where agent-controlled Blender is wanted, following `Blender/blender_agent/README.md`. Its supplied installation notes are macOS-specific.

Security: the bridge can execute Python in Blender and listens on loopback without authentication. Stop it when not needed and do not expose it to a network. Ordinary shot creators should install only `two_point_zero_shot_exporter.py`.

## 15. Responsibility checklist

### Shot creator

- Install the exporter.
- Save and organize the location.
- Supply real references and meaningful metadata.
- Export one ZIP per camera.

### Director

- Review composition and references.
- Write creative instructions in Blender or the app.
- Approve generated results.

### App administrator

- Provide the ZIP importer and compatible generation workflows.
- Keep model selection and credentials in the app/backend.
- Do not ask users to install the development Agent Bridge for ordinary imports.
