project
Project lifecycle, versioned objects, and transactions.
7 functions / 5 types
Modules
Index
| Function | Description |
|---|---|
| enter_versioned_mode | Enter versioned mode with empty versioned state. Fails if already in versioned mode. |
| exit_versioned_mode | Exit versioned mode and return to a scene the engine manages directly. Fails if not already in versioned mode. |
| redo | Redo the most recently undone change. Fails when not in versioned mode. |
| reenter_versioned_mode | Clear the versioned state and all existing objects. Fails if not already in versioned mode. |
| set_timestamp | Execute the set_timestamp statement. |
| undo | Undo the most recent change. Also discards any changes still in progress that have not yet taken effect. Fails when not in versioned mode. |
| wait_for_scene_sync | Wait until the scene has caught up with everything committed so far. |
| Type | Description |
|---|---|
| LocalPath | A path on the machine running the engine, carried as UTF-8 text. |
| LocalProjectList | Every local project found in a directory, as returned by GetLocalProjectList. |
| LocalProjectMeta | What a .spatial file records about the project it holds. |
| RemoteProjectList | Every remote project visible to the signed-in user, as returned by GetRemoteProjectList. |
| RemoteProjectMeta | What the server records about one project it hosts. |
enter_versioned_mode
def enter_versioned_mode(*, _transaction_id: str | None = None) -> NoneEnter versioned mode with empty versioned state. Fails if already in versioned mode.
Awaiting this task waits until the scene is quiescent.
Returns None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
exit_versioned_mode
def exit_versioned_mode(*, _transaction_id: str | None = None) -> NoneExit versioned mode and return to a scene the engine manages directly. Fails if not already in versioned mode.
Awaiting this task waits until the scene is quiescent (queued despawns applied, autosync idle). Drop the handle to fire and forget.
Returns None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
redo
def redo(*, _transaction_id: str | None = None) -> NoneRedo the most recently undone change. Fails when not in versioned mode.
Returns None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
reenter_versioned_mode
def reenter_versioned_mode(*, _transaction_id: str | None = None) -> NoneClear the versioned state and all existing objects. Fails if not already in versioned mode.
Awaiting this task waits until the scene is quiescent.
Returns None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
set_timestamp
def set_timestamp(*, timestamp_nanos: int, _transaction_id: str | None = None) -> NoneExecute the set_timestamp statement.
Returns None.
timestamp_nanos : int
Timestamp to show in the active project, as Unix nanoseconds.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
undo
def undo(*, _transaction_id: str | None = None) -> NoneUndo the most recent change. Also discards any changes still in progress that have not yet taken effect. Fails when not in versioned mode.
Returns None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
wait_for_scene_sync
def wait_for_scene_sync(*, _transaction_id: str | None = None) -> NoneWait until the scene has caught up with everything committed so far.
After an Operation commits, the scene finishes updating asynchronously. Submit this Task before reading scene state an Operation should have produced. Other in-flight scene work (from concurrent Operations, undo/redo, or project loading) delays the return.
Returns None.
_transaction_id optional : str | None
Transaction to join. Omit to submit without an explicit transaction. Defaults to None.
LocalPath
LocalPath(*, path: str)A path on the machine running the engine, carried as UTF-8 text.
A host path that is not valid UTF-8 loses the offending bytes on the way out, and does not come back as the path it started as.
path : str
LocalProjectList
LocalProjectList(*, projects: tuple[types.project.LocalProjectMeta, ...] = ())Every local project found in a directory, as returned by
GetLocalProjectList.
projects optional : tuple[LocalProjectMeta, ...]
The projects, in directory-traversal order. Defaults to ().
LocalProjectMeta
LocalProjectMeta(
*,
uuid: str,
dir: types.project.LocalPath | None = None,
name: str,
author: str,
point_count: int | None = None,
modified_date: types.datetime.Timestamp | None = None,
created_date: types.datetime.Timestamp | None = None
)What a .spatial file records about the project it holds.
uuid : str
The project’s identifier as a hyphenated UUID string.
dir optional : LocalPath | None
Directory holding the project’s .spatial file. Defaults to None.
name : str
Human-facing project name.
author : str
Who the project is attributed to.
point_count optional : int | None
Total points across the project’s models, when known. Defaults to None.
modified_date optional : Timestamp | None
When the project was last written. Defaults to None.
created_date optional : Timestamp | None
When the project was first created. Defaults to None.
RemoteProjectList
RemoteProjectList(*, projects: tuple[types.project.RemoteProjectMeta, ...] = ())Every remote project visible to the signed-in user, as returned by
GetRemoteProjectList.
projects optional : tuple[RemoteProjectMeta, ...]
The projects, in the order the server listed them. Defaults to ().
RemoteProjectMeta
RemoteProjectMeta(
*,
dt_uuid: str,
project_name: str,
author: str | None = None,
created_at: types.datetime.Timestamp | None = None,
updated_at: types.datetime.Timestamp | None = None,
point_count: int | None = None,
total_aabb: types.math.Aabb | None = None,
public: bool
)What the server records about one project it hosts.
dt_uuid : str
The project’s digital-twin identifier as a hyphenated UUID string.
project_name : str
Human-facing project name.
author optional : str | None
Who the project is attributed to, when the server reports it. Defaults to None.
created_at optional : Timestamp | None
When the project was created. Defaults to None.
updated_at optional : Timestamp | None
When the project was last updated. Defaults to None.
point_count optional : int | None
Total points across the project’s models, when known. Defaults to None.
total_aabb optional : Aabb | None
Bounding box covering every model in the project, when known. Defaults to None.
public : bool
Whether the project is publicly visible.