3D scenes, conversion, processing, IIIF¶
Accessed via client.scenes, client.conversion, client.processing and client.iiif.
scene = client.scenes.get(model_asset_id) # SVX document + version
scene.document["scenes"][0]["name"] = "Hall"
client.scenes.save(model_asset_id, scene.document, if_match=scene.version)
run = client.conversion.start(model_asset_id, source_axes="z_up") # runs in Obair
print(client.conversion.status(model_asset_id).state)
client.processing.start(video_asset_id, set_thumbnail=False) # probe, poster, web copy
manifest = client.iiif.manifest(video_asset_id)
pycomad.client.ScenesClient
¶
Authored 3D scenes (Voyager SVX documents) with version history.
get
¶
Return the current scene document and its version.
Raises:
| Type | Description |
|---|---|
ComadNotFoundError
|
If the asset does not exist or no scene was saved. |
save
¶
save(asset_id: Union[UUID, str], document: Dict[str, Any], *, if_match: Optional[int] = None) -> SavedScene
Save document (SVX 1.x or 2.x, at most 5 MiB) as the next version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
Union[UUID, str]
|
The model asset. |
required |
document
|
Dict[str, Any]
|
The scene document. |
required |
if_match
|
Optional[int]
|
The version you based your edit on; the server refuses (HTTP 409) if someone saved since. |
None
|
Raises:
| Type | Description |
|---|---|
ComadValidationError
|
If the document is not valid SVX or too large. |
ComadAuthError
|
If you are not the owner or the asset is locked. |
ComadError
|
On a version conflict (409). |
versions
¶
List the stored versions, newest first.
get_version
¶
Return an earlier version of the scene.
pycomad.client.ConversionClient
¶
Convert a 3D master to a web-ready GLB derivative (runs in Obair).
start
¶
Start a conversion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
Union[UUID, str]
|
The model asset. |
required |
source_axes
|
Optional[str]
|
|
None
|
Raises:
| Type | Description |
|---|---|
ComadValidationError
|
If the file is not convertible. |
ComadError
|
If a conversion is already queued or running (409). |
ComadServerError
|
If conversion is not configured (503) or Obair did not answer. |
status
¶
Return the state of the latest conversion.
Raises:
| Type | Description |
|---|---|
ComadNotFoundError
|
If none was ever started (or Obair has forgotten it). |
pycomad.client.ProcessingClient
¶
Process a video or audio recording: probe, poster/waveform and web-playable copy.
start
¶
start(asset_id: Union[UUID, str], *, make_web_copy: Optional[bool] = None, set_thumbnail: Optional[bool] = None) -> RunStatus
Start processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
Union[UUID, str]
|
The video or audio asset. |
required |
make_web_copy
|
Optional[bool]
|
Make a browser-playable copy when needed (server default |
None
|
set_thumbnail
|
Optional[bool]
|
Set the poster frame / waveform as the thumbnail (default |
None
|
Raises:
| Type | Description |
|---|---|
ComadValidationError
|
If the asset is not a recording or has no file. |
ComadError
|
If processing is already queued or running (409). |
status
¶
Return the state of the latest processing run.
Raises:
| Type | Description |
|---|---|
ComadNotFoundError
|
If none was started for this asset. |
pycomad.client.IiifClient
¶
IIIF 3.0 manifests and collections. Public assets need no login; a token, if you have one, also unlocks your private assets.
manifest
¶
Return the IIIF manifest of an asset (images, or Video/Sound canvases with duration, playable copy and WebVTT captions).
collection
¶
Return the IIIF collection of a category's public assets.
image_info
¶
Return the IIIF Image API info.json of a raster image.
image_url
¶
image_url(asset_id: Union[UUID, str], *, region: str = 'full', size: str = 'max', rotation: str = '0', quality: str = 'default', fmt: str = 'jpg') -> str
Build an IIIF Image API URL (fetch it with any HTTP client).