Files
HartOMat/backend/app/domains/rendering/schemas.py
T
Hartmut b583b0d7a2 feat: per-position camera settings, material alias dialog, product delete, media browser links
- Per-render-position focal_length_mm/sensor_width_mm (DB → pipeline → Blender)
- FOV-based camera distance with min clamp fix for wide-angle lenses
- Unmapped materials blocking dialog on "Dispatch Renders" with batch alias creation
- Material check endpoint (GET /orders/{id}/check-materials)
- Batch alias endpoint (POST /materials/batch-aliases)
- Quick-map "No alias" badges on Materials page
- Full product hard-delete with storage cleanup (MinIO + disk files + orphaned CadFile)
- Delete button on ProductDetail page with confirmation
- Clickable product names in Media Browser (links to product page)
- Single-line render dispatch/retry (POST /orders/{id}/lines/{id}/dispatch-render)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-14 12:16:37 +01:00

187 lines
4.7 KiB
Python

import uuid
from datetime import datetime
from pydantic import BaseModel
class OutputTypeCreate(BaseModel):
name: str
description: str | None = None
renderer: str = "threejs"
render_settings: dict = {}
output_format: str = "png"
sort_order: int = 0
is_active: bool = True
compatible_categories: list[str] = []
render_backend: str = "auto"
is_animation: bool = False
transparent_bg: bool = False
pricing_tier_id: int | None = None
cycles_device: str | None = None
class OutputTypePatch(BaseModel):
name: str | None = None
description: str | None = None
renderer: str | None = None
render_settings: dict | None = None
output_format: str | None = None
sort_order: int | None = None
is_active: bool | None = None
compatible_categories: list[str] | None = None
render_backend: str | None = None
is_animation: bool | None = None
transparent_bg: bool | None = None
pricing_tier_id: int | None = None
cycles_device: str | None = None
workflow_definition_id: uuid.UUID | None = None
class OutputTypeOut(BaseModel):
id: uuid.UUID
name: str
description: str | None
renderer: str
render_settings: dict
output_format: str
sort_order: int
compatible_categories: list[str]
render_backend: str
is_animation: bool
transparent_bg: bool
cycles_device: str | None = None
pricing_tier_id: int | None = None
pricing_tier_name: str | None = None
price_per_item: float | None = None
workflow_definition_id: uuid.UUID | None = None
workflow_name: str | None = None
is_active: bool
created_at: datetime
updated_at: datetime
model_config = {"from_attributes": True}
class RenderPositionCreate(BaseModel):
name: str
rotation_x: float = 0.0
rotation_y: float = 0.0
rotation_z: float = 0.0
is_default: bool = False
sort_order: int = 0
focal_length_mm: float | None = None
sensor_width_mm: float | None = None
class RenderPositionPatch(BaseModel):
name: str | None = None
rotation_x: float | None = None
rotation_y: float | None = None
rotation_z: float | None = None
is_default: bool | None = None
sort_order: int | None = None
focal_length_mm: float | None = None
sensor_width_mm: float | None = None
class RenderPositionOut(BaseModel):
id: uuid.UUID
product_id: uuid.UUID
name: str
rotation_x: float
rotation_y: float
rotation_z: float
is_default: bool
sort_order: int
focal_length_mm: float | None = None
sensor_width_mm: float | None = None
created_at: datetime
updated_at: datetime
model_config = {"from_attributes": True}
class GlobalRenderPositionCreate(BaseModel):
name: str
rotation_x: float = 0.0
rotation_y: float = 0.0
rotation_z: float = 0.0
is_default: bool = False
sort_order: int = 0
focal_length_mm: float | None = None
sensor_width_mm: float | None = None
class GlobalRenderPositionPatch(BaseModel):
name: str | None = None
rotation_x: float | None = None
rotation_y: float | None = None
rotation_z: float | None = None
is_default: bool | None = None
sort_order: int | None = None
focal_length_mm: float | None = None
sensor_width_mm: float | None = None
class GlobalRenderPositionOut(BaseModel):
id: uuid.UUID
name: str
rotation_x: float
rotation_y: float
rotation_z: float
is_default: bool
sort_order: int
focal_length_mm: float | None = None
sensor_width_mm: float | None = None
created_at: datetime
updated_at: datetime
model_config = {"from_attributes": True}
class WorkflowDefinitionCreate(BaseModel):
name: str
output_type_id: uuid.UUID | None = None
config: dict
is_active: bool = True
class WorkflowDefinitionUpdate(BaseModel):
name: str | None = None
config: dict | None = None
is_active: bool | None = None
class WorkflowDefinitionOut(BaseModel):
id: uuid.UUID
name: str
output_type_id: uuid.UUID | None
config: dict
is_active: bool
created_at: datetime
model_config = {"from_attributes": True}
class WorkflowNodeResultOut(BaseModel):
id: uuid.UUID
node_name: str
status: str
output: dict | None
log: str | None
duration_s: float | None
created_at: datetime
model_config = {"from_attributes": True}
class WorkflowRunOut(BaseModel):
id: uuid.UUID
workflow_def_id: uuid.UUID | None
order_line_id: uuid.UUID | None
celery_task_id: str | None
status: str
started_at: datetime | None
completed_at: datetime | None
error_message: str | None
created_at: datetime
node_results: list[WorkflowNodeResultOut] = []
model_config = {"from_attributes": True}