Developer Guide#
This guide states the runtime rules that both API layers and both languages share: how the Suite API wraps the canonical API, when settings apply, how stages and scopes load, which parts of a result are contractual, how failures surface and which environment variables the runtime reads. The Python Quickstart and the C/C++ Quickstart get a first query running. Come back here to check the rules.
Each rule applies to both API layers unless its section names one. To pick a layer, read Choosing an API Layer first. Settings is the reference for every setting.
The released packages use the ovstage backend,
and this guide describes it. The unpublished OpenUSD reference build
differs in places; the comments in <ovclash/ovclash.h> and the Suite headers document each
difference, and References in the package lists those
headers.
The examples use scene.usda, a USD file, as the stage. A fragment that
does not create its own handle assumes one with that stage open:
a canonical C fragment, a context
ctxfromovclash_create_context;a Suite C fragment, a
runtimefromovclash_suite_create_runtime;a Python fragment, a
runtimefromClashRuntime().
On this page#
Ownership, threading and async runs#
These rules have their own pages:
Rule |
Details |
|---|---|
A handle has no internal lock. Drive one context or runtime from one thread at a time, or serialize the calls. Independent runtime handles may run concurrently. |
|
Returned names, strings and report buffers are borrowed. Copy them before the next call that changes their owner. Release every overlap report. |
|
A context runs one asynchronous operation at a time. While it runs, the context rejects almost every other call, and only finishing the run lifts that guard. |
|
Releasing a context or destroying a Suite runtime waits for a live run. It does not cancel it. |
|
A live Suite fetch operation or cursor reserves its runtime and store. |
The C status results, string views and input rules are in C API Conventions.
Suite runtime wrapper#
include/ovclash_suite/ovclash_suite.h (SDK archive) declares the Suite
C ABI, which wraps the
canonical clash C ABI. Both are compiled into the same shared library; there is no separate Suite
library to link. The ovclash_suite Python package binds it. The Suite API adds:
status results (
ovclash_suite_result_t);counted UTF-8 strings (
ovclash_suite_string_t);stricter input validation;
the native models
ClashQuery,ClashInfo,ClashFrameInfoandPointCloudSettings;persistence to a SQLite or JSON-directory store, incremental fetch-and-save, and JSON and HTML export;
thread-local last-error text for handle-free and generic errors.
ovclash_suite_create_clash_info converts one runtime overlap record into three objects:
an
ovclash_suite_clash_info_view_t;an
ovclash_suite_clash_frame_info_view_t;an owned
ovclash_suite_overlap_report_tover the runtime’s report buffers. It requestsOVCLASH_SUITE_OVERLAP_REPORT_POINTS0for a point-vs-mesh pair andFACES0 | FACES1 | OUTLINEfor a mesh pair.
The report follows the rules in Suite reports. The
clash-info strings belong to the runtime. They stay valid until the next
ovclash_suite_create_clash_info, ovclash_suite_runtime_save_overlap_to_data or fetch-and-save
capture on that runtime.
Note
Test a pair type with
==against the member you mean,OVCLASH_SUITE_OVERLAP_POINT_CLOUD_MESHorOVCLASH_OVERLAP_PAIR_TYPE_POINT_VS_MESH. Never test it with!=against the mesh value: both undefined values are0x7fffffff, not zero.
ovclash_suite_runtime_save_overlap_to_data converts one runtime overlap and saves it straight
into an open data handle. This avoids a Python round trip for every frame and report buffer. A
record that the engine cannot report is dropped instead of failing the call;
Persistence shows how to detect that.
The depth entry points are mesh-only#
ovclash_suite_compute_overlap_max_local_depthrejects a point-cloud overlap.ovclash_suite_compute_max_local_depthandovclash_suite_compute_penetration_depthfail for the path of aUsdGeomPointspoint cloud, because a points prim is never loaded as a mesh.ovclash_suite_compute_max_local_depthalso fails unless the settings in effect enablecompute_max_local_depth. The engine defaults do not.
In Python, ClashDetection.is_depth_computation_supported(overlap_type) is the pre-check for
ovclash_suite_compute_max_local_depth and ovclash_suite_compute_penetration_depth. Their
Python methods raise instead of returning a depth.
Settings#
Settings lists every setting with its name in each API, its default, its unit and its effect. This section says when a changed setting takes effect.
A setter stores its value when you call it. Nothing waits for pipeline creation. A rejected call stores nothing and keeps the previous value.
The pipeline plans the steps from the times.
ovclash_create_pipeline(ovclash_suite_create_pipeline) derives the step plan from the start time, the end time and the sampling rate. The pipeline keeps that plan, so a later change of the times applies to the next pipeline.The phases read the other settings when they run. The selection settings, such as the scope, full-scene traversal, invisible-prim filtering and point clouds, apply when a run selects meshes. The cooking settings, such as triangles per leaf, quantized trees and the area epsilon, apply to meshes cooked by the next run.
Configure settings before you create the pipeline, and keep them while its steps run. A run keeps the subcomponent filtering it selected meshes with (the filter that skips a pair whose two meshes share a subcomponent root; see Scope and selection), while a new point size applies from the run’s next sample. Change settings between runs, not between steps.
Settings never recompute or discard completed results. The threading settings also govern report extraction and fetch-and-save frame preparation after detection. You can therefore detect in parallel and fetch single-threaded: change the threading settings after detection and before the fetch begins.
Settings calls are rejected while an async pipeline is live, and on the Suite API while a fetch operation is alive.
Each surface applies settings in its own way:
ovclash_set_settingsandovclash_set_full_sceneclear the canonical scope paths, so set the scope after them. The PythonClashRuntimeand the Suite API apply their cached scope again, so there the order does not matter; see Setting a scope.ClashRuntime.set_run_settings()resets every setting thatRunSettingsdoes not model. It closes open overlap reports and discards the pipeline; completed results stay.ClashDetection.set_settings()sets the whole table: a key you do not pass takes its default.
Time units#
Query bounds and result times are in seconds on both layers. To get USD time codes, multiply
seconds by the stage’s effective rate. The effective rate is the authored timeCodesPerSecond,
else the authored framesPerSecond, else 24.
To read the stage rate |
Call |
|---|---|
Canonical C |
|
Suite C |
|
Python |
|
All of them read the rate from the open stage. The timeCodesPerSecond and
time_codes_per_second settings set the query sampling rate independently of that stage rate.
Functions that take USD time codes, such as ovclash_get_prim_matrix, say so.
Scope and stage loading#
Opening a stage#
ovclash_open_stage(context, path) takes a UTF-8 ovclash_string_t that names an existing local
file. Asset URIs that are not plain files are rejected before any USD or ovstage resolution. The
Python open_stage() methods follow the same rules and raise RuntimeError on failure.
A successful open replaces the context’s stage and clears its scope.
Opening the same path again is still a replacement and reads the file again.
An open attempt that gets past argument validation retires the previous results, whether or not it succeeds:
Detail getters fail with a “result details are stale” message until a pipeline runs again. Aggregate counts are kept, but name views that the getters already returned are invalid.
A started pipeline must restart at step 0.
A failed open drops the previous stage, so the context has no source until the next successful open.
Opening a stage does not restore OVCLASH_SETTINGS_FLAG_FULL_SCENE after
ovclash_set_scope_paths cleared it; see Setting a scope.
Setting a scope#
ovclash_set_scope_paths(context, paths1, paths1_count, paths2, paths2_count) takes UTF-8 path
arrays. Standalone callers should use it. Validation is all-or-nothing: the context scope changes
only after every entry passes. A scope entry also covers its descendants.
|
|
Meaning |
|---|---|---|
Non-empty |
Empty |
|
Non-empty |
Non-empty |
|
Empty |
Empty |
No scope |
The scope is read when a run selects meshes, so a call between the steps of a run does not change that run.
No scope is not the same as full-scene traversal. Selection reads two independent pieces of state:
Scope |
|
Selected |
|---|---|---|
Non-empty |
Either |
The scope |
Empty |
Set |
The whole stage |
Empty |
Cleared |
Nothing at all |
The flag starts set on a fresh context.
Note
Applying a non-empty scope clears
FULL_SCENE.ovclash_set_scope_pathsclears it; the legacyovclash_set_scopedoes not. Clearing the scope does not restore the flag. Neither does opening a stage or attaching one withovclash_ovstage_attach_stage. Both of those also clear the scope, so set the scope after them. Restore full-scene traversal withovclash_set_full_scene(context, true)or with settings that enableOVCLASH_SETTINGS_FLAG_FULL_SCENE. Both of those calls clear the scope paths, so call them before you set a non-empty scope.
#include <ovclash/ovclash.h>
ovclash_string_t a[] = { { "/World/Objects/meshA", 20 } };
ovclash_string_t b[] = { { "/World/Objects/meshB", 20 } };
ovclash_set_scope_paths(ctx, a, 1, b, 1); /* also clears FULL_SCENE */
/* Later, back to full-scene traversal: */
ovclash_set_scope_paths(ctx, NULL, 0, NULL, 0); /* no scope; FULL_SCENE stays cleared */
ovclash_set_full_scene(ctx, true);
The Python ClashRuntime and the Suite API handle this order for you. They cache the explicit A/B
scope and apply it again just before the pipeline is built. The Suite API also applies it after each
successful ovclash_suite_set_run_settings. You can therefore set scope and run settings in
either order. The cache follows these rules:
A successful open (
ClashRuntime.open_stage(),ovclash_suite_open_stage) or ovstage attach clears the cached scope, as the engine clears its own. A failed open keeps it, and so does a reset.The Suite Python
ClashDetection.set_settings()andset_scope()reopen theirstageargument in two cases only: it names a different file from the open one, or a failed open dropped the stage. Another spelling of the open file, such as apathlib.Pathor a layer’s absoluterealPath, keeps the cached scope.The Suite API restores full-scene traversal after a both-empty
ovclash_suite_set_scope, a successful open or an ovstage attach, when the settings in effect enableenable_full_scene. Those are the last applied settings or, before any successful apply, the engine defaults.ClashRuntimedoes not restore full-scene traversal by itself. Clear the scope and enableenable_full_scenebefore you rebuild the pipeline:
runtime.set_scope(["/World/Objects/meshA"], ["/World/Objects/meshB"])
runtime.run_pipeline()
# Back to full-scene traversal:
runtime.set_scope([], [])
runtime.set_run_settings(runtime.get_run_settings(), enable_full_scene=True)
runtime.run_pipeline()
Point clouds are additive#
OVCLASH_SETTINGS_FLAG_ENABLE_POINT_CLOUDS does not switch a query into a point-only mode. The
mesh-vs-mesh pass runs exactly as it does without the flag, and a point-vs-mesh pass adds its
results to the same result set.
No scope is filtered by prim type, and the point-vs-mesh broad phase does not separate the two
scopes. A UsdGeomPoints prim in scope B is therefore a live point cloud. It is tested against
every selected mesh, scope B’s own included.
Three consequences follow:
A scope A that holds both meshes and point clouds yields mesh-vs-mesh and point-vs-mesh results. Narrowing scope A to point clouds is a caller convention, not something the ABI does.
With an empty scope B, both meshes and point clouds are selected from scope A. A scope A that holds only point clouds finds nothing, because no mesh is selected. A mixed scope A still produces both kinds of result.
With both scopes empty, a query covers the whole stage in the same additive way: every mesh against every mesh, plus every point cloud against every mesh, subject to
OVCLASH_SETTINGS_FLAG_FULL_SCENE.
The legacy encoded-id scope#
ovclash_set_scope(context, stageId, paths1, nbPaths1, paths2, nbPaths2) is the legacy
counterpart of ovclash_set_scope_paths. Every path value must come from
ovclash_sdf_path_to_int(). Prefer ovclash_set_scope_paths. Apart from this call, only the
immediate-mode entry points ovclash_imm_compute_max_local_depth and
ovclash_imm_depenetrate_meshes, which compute on two meshes without running a pipeline, take
encoded ids. ovstage ignores stageId and uses the
context’s open stage.
ovclash_sdf_path_to_int(prim_path, out_encoded) encodes an absolute prim path into an id. Only
the backend that produced an id accepts it, and the id stays stable for the process lifetime. Its
sharp edges:
An id is meaningful only inside the process that produced it. Never persist it, hash it for storage or share it across processes.
The registry behind the ids is never pruned, so encoding unbounded distinct paths grows memory until the process exits.
The call takes no context, so its return status is the only failure signal.
Reading a transform#
ovclash_get_prim_matrix(context, prim_path, time, out_matrix) writes a row-major 4x4 transform
into 16 caller-owned doubles. time is a USD time code, not seconds.
The matrix is pre-filled with identity. A call that fails after context validation still leaves a defined matrix.
The call fails when the prim does not exist or the read fails. It never substitutes a selected mesh’s pipeline pose.
A read or resource failure (not a missing prim) can also invalidate the selection’s result details and the installed pipeline. Recreate and run the pipeline after you address the error.
Reading results#
A successful ovclash_create_pipeline reports at least 7 steps: 11 for a static query
(startTime == endTime), otherwise 7 plus one step per sampled time. Run the steps in ascending
order with ovclash_run_pipeline_step, or run the whole pipeline with
ovclash_run_pipeline_async. Steps carry state, and running them out of order is not diagnosed.
A step fails when its phase fails, and the context’s last error names the reason.
#include <ovclash/ovclash.h>
#include <stdio.h>
uint32_t steps = 0;
if (ovclash_create_pipeline(ctx, &steps).status == OVCLASH_STATUS_SUCCESS)
{
for (uint32_t step = 0; step < steps; ++step)
ovclash_run_pipeline_step(ctx, step);
}
uint32_t count = 0;
ovclash_get_overlap_count(ctx, &count);
for (uint32_t i = 0; i < count; ++i)
{
ovclash_overlap_data_t data;
ovclash_reset_overlap_data(&data);
if (ovclash_get_overlap_data(ctx, &data, i, 0).status != OVCLASH_STATUS_SUCCESS)
continue;
printf("%.*s vs %.*s: %u record(s)\n", (int)data.name0.length, data.name0.ptr,
(int)data.name1.length, data.name1.ptr, data.nbRecords);
}
In Python, ClashRuntime.run_pipeline() runs every step, and get_overlap_count(),
get_overlap_record(index) and get_overlap_details(index) read the results.
What |
Canonical entry points |
|---|---|
Overlap count |
|
One overlap record |
|
Duplicate meshes |
|
Query statistics |
|
Host timeline |
|
Stage timeline |
|
Detailed report |
|
Derived values |
|
Memory |
|
The query statistics and the stage timeline come back in these structs:
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
|
Yes |
0 or more |
The meshes that the run selected. |
|
|
Yes |
0 or more |
The selected meshes that reuse the cooked data of another selected mesh, so a healthy run cooks |
|
|
Yes |
0 or more |
The unique source meshes that the run cooked. |
|
|
Yes |
0 or more |
The point clouds that the run selected. |
|
|
Yes |
|
The stage’s start time code. |
|
|
Yes |
|
The stage’s end time code. |
|
|
Yes |
|
The effective stage rate. |
|
|
Yes |
|
The stage’s frames per second. |
A mesh that PhysX cannot cook is dropped from
the run instead of failing it. nbCookedMeshes below nbMeshes - nbSharedMeshes means that
meshes are missing from the results. The run still succeeds, and ovclash_get_last_error names
the count and the first dropped mesh.
ovclash_create_overlap_meshes always fails, and ovclash_release_overlap_meshes does nothing.
They exist only for compatibility with the clash interface of Kit;
Limitations lists them. Use ovclash_create_overlap_report_ex for faces,
outlines and points.
Initializing output structs#
The ovclash_reset_* helpers are the initialization convention of the canonical header. Call one
before every call that fills a struct:
Helper |
Clears |
|---|---|
|
The whole settings table, to the defaults; see Settings |
|
Names, hashes, counts, |
|
Name views, hashes, |
|
The four query counters |
|
The name, |
|
The four counts, |
|
Two struct types that no other entry point in the current ABI uses |
Two traps in the reset helpers:
ovclash_reset_step_datasetsfinishedto true, sofinishedis not an initialized-or-not test.ovclash_reset_overlap_reportnever frees. Use it to initialize a report, and release a filled report withovclash_release_overlap_report.
A reset matters most before ovclash_get_overlap_data, which leaves *data untouched when it
fails. Without a reset you cannot tell a filled struct from an unwritten one.
Overlap records#
ovclash_overlap_data_t holds two kinds of data:
Constant across all records of a pair:
name0,name1,meshHash0,meshHash1,clashHash,nbRecordsandtype.Specific to one record:
nbElements,time,minDistanceandmaxLocalDepth.
ovclash_get_overlap_data writes every field:
Field |
Type |
Required |
Default or values |
Rule |
|---|---|---|---|---|
|
|
Yes |
A prim path |
The first prim: the point cloud of a point-vs-mesh pair, else a mesh. Borrowed from the context. |
|
|
Yes |
A prim path |
The second prim, a mesh. Borrowed from the context. |
|
|
Yes |
Two 64-bit words |
The mesh hash of each mesh’s data. |
|
|
Yes |
Two 64-bit words |
The clash hash, a hash of the two prim paths. |
|
|
Yes |
1 or more |
The number of frames in which the pair overlaps. Always 1 for a static query. |
|
|
Yes |
An |
The pair type. |
|
|
Yes |
0 or more |
The overlapping triangles or points in this frame. |
|
|
Yes |
Seconds |
Multiply it by the stage’s effective time-codes-per-second rate to get a USD time code. |
|
|
Yes |
|
The minimum distance between the pair’s triangles, in stage units, so the stage’s |
|
|
Yes |
|
In stage units. |
Duplicate mesh records#
ovclash_get_duplicated_meshes_data(ctx, &data, index) fills an ovclash_duplicate_mesh_data_t
for an index below the count that ovclash_get_duplicate_mesh_count reports. It writes *data
only on success, so initialize the struct with ovclash_reset_duplicate_mesh_data first.
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
|
Yes |
Prim paths |
The two meshes of the pair. Borrowed from the context: the next pipeline run, |
|
|
Yes |
Two 64-bit words, equal for a genuine duplicate pair |
The mesh hash of each mesh’s data. |
|
|
Yes |
Two 64-bit words |
The clash hash, a hash of the two prim paths. |
|
|
Yes |
0 or more |
The number of triangles in the duplicated mesh. |
|
|
Yes |
Seconds |
The time of the pair on the timeline. |
Overlap reports#
The two creators honor different OVCLASH_OVERLAP_REPORT_FLAG_* bits:
Function |
Honors |
Notes |
|---|---|---|
|
|
It ignores |
|
|
It ignores the legacy |
Both creators fill an ovclash_overlap_report_t. They fill only the fields that the flags
select, so initialize the struct with ovclash_reset_overlap_report first.
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
|
With |
Face indices of the USD mesh |
The colliding faces of the first mesh, or of the mesh that |
|
|
With |
Face indices of the USD mesh |
The colliding faces of the second mesh. |
|
|
With |
Segments of two |
The intersection outline. Only touching or interpenetrating triangle pairs add segments. |
|
|
With |
Point indices of the USD point cloud |
The clashing points of a point-vs-mesh overlap. |
|
|
With |
|
The point diameter for |
matrixData0 and matrixData1 on _ex are output buffers. When one is non-null, the callee
writes the transform captured at that record into it: exactly 16 doubles, a row-major 4x4
matrix. Each non-null pointer must therefore point at storage for 16 doubles. The identically
named const double* parameters of ovclash_imm_compute_max_local_depth and
ovclash_imm_depenetrate_meshes are inputs.
Every pointer in a report is borrowed; the caller never owns it. Release the report before the
next pipeline step or run, ovclash_release_memory, ovclash_reset_context or
ovclash_release_context. A sampled step can replace borrowed result buffers within the same
run, and a pointer you already copied out cannot be checked for staleness afterwards.
pointSize0 accompanies _POINTS0. It is the first of these that applies:
a positive explicit
ovclash_set_point_sizevalue;a single authored USD width;
per-point widths;
an automatically computed size.
It never includes the prim’s transform scale. With per-point widths, it is the common width when
every entry is equal and positive, otherwise 0.0. On 0.0, read the widths from USD by the
point indices in collidingPoints0.
Overlap index order is not contractual#
Note
The overlap-group index passed to
ovclash_get_overlap_datais an identifier, not a rank. Runs over the same stage with the same settings report the same groups with the same data, but not necessarily in the same order. Key onname0/name1orclashHash, and sort in the consumer when you need a fixed sequence.
The contract covers:
the overlap count and the duplicate-mesh count;
the set of overlapping pairs;
each pair’s
nbElements,nbRecords,type,minDistanceandmaxLocalDepth;the report payloads.
ovstage returns one canonical mesh-path order under every threading setting, but that order is not part of the contract either. The same rule holds in both Python packages.
To get a stable sequence, sort in the consumer:
from ovclash import ClashRuntime
with ClashRuntime() as runtime:
runtime.open_stage("time_sampled.usda")
runtime.run_pipeline()
records = [runtime.get_overlap_record(index) for index in range(runtime.get_overlap_count())]
# The index order is not contractual: sort by pair names for a stable sequence.
for record in sorted(records, key=lambda record: (record.name0, record.name1)):
print(record.name0, record.name1, record.nb_elements)
time_sampled.usda ships in samples/data/; run the program from there, or pass the stage’s
full path.
What results are stable#
For the same stage, settings and package version, these parts of a result repeat exactly:
The overlap set. The count, the duplicate-mesh count, the set of pairs and each pair’s data and report payloads, as Overlap index order is not contractual lists. The overlap index is an identifier, not part of that set.
Threading.
single_threaded,new_task_managerandnb_tasksnever change the overlap set. A difference in it between threading settings is a defect.Sample times. A run of a dynamic query computes its sample times with one recurrence, in binary64 arithmetic. The first sample is exactly the start time. Each next time is the previous time plus
1.0 / rate, and sampling stops when the next time exceeds the end time. There is no endpoint clamp, so rounding can exclude an end time that lies on the grid in real arithmetic. A zero rate, or an end time below the start time, gives one sample at the start time. The number of samples, and with it the step count and the largest possiblenbRecords, follows from the same recurrence.Exports. JSON and HTML exports with identical ordered columns, cell values and metadata are byte-identical.
Stored records. A database overlap cursor returns overlaps ordered by
overlap_id, the hex form of the pair’sclashHash, then by record identifier. A frame cursor returns frames by time, then by record identifier.
These parts are not stable:
The overlap index order; see Overlap index order is not contractual.
SQLite file bytes. Timestamps, user metadata, fresh row identifiers, page layout and transaction history differ between two stores with the same results. Compare stores by their records, not by their bytes.
This Python function reproduces the sample times of a dynamic run:
def sample_times(start: float, end: float, rate: float) -> list[float]:
"""Return the sample times of a dynamic query from start to end at rate samples per second."""
step = float("inf") if rate == 0.0 else 1.0 / rate
times = [start]
current = start
while current + step <= end:
current += step
times.append(current)
return times
print(sample_times(0.0, 0.3, 10.0)) # [0.0, 0.1, 0.2]
print(sample_times(0.0, 1.0, 0.0)) # [0.0]
The first call shows the missing endpoint: the third addition gives 0.30000000000000004, which
exceeds 0.3. Both Python packages reject an end time below the start time; the canonical C ABI
accepts it.
Error text#
Both C ABIs catch C++ exceptions before they cross the boundary. A failed call returns an error status and usually records its reason as last-error text. The Python packages raise with that text; see Python exceptions.
Channel |
Scope |
|---|---|
|
Per context; the only diagnostic channel of the canonical C ABI |
|
Per Suite runtime handle, falling back to the thread-local text |
|
Per Suite data handle, falling back to the thread-local text |
|
Per thread, for handle-free and generic errors |
|
Per async fetch operation |
The context error text is sticky across most successful calls. Read it immediately after a
call returns OVCLASH_STATUS_ERROR. Never treat a non-empty string as proof that the last call
failed. An empty string does not prove success either, because some rejections record nothing:
a null context;
some null arguments, for example a null struct passed to
ovclash_set_settings;any
ovclash_get_settingsfailure;a step rejected for pending cancellation.
The context-free entry points, such as ovclash_sdf_path_to_int and the ovclash_reset_*
helpers, never record anything. Check the status.
Error text lifetime lists the calls that clear
the text and how long each channel’s text stays valid.
Python exceptions#
Native failures generally become
RuntimeErrorcarrying the native error text:try: runtime.open_stage("missing.usda") except RuntimeError as error: print(error) # Failed to open stage 'missing.usda': Failed to open USD stage: missing.usda
Some legacy data-facade methods keep their old return values (
False,0,None,{}or[]) instead of raising. Failures that do not raise lists them.ClashQuery.load_settings_from_str()also returnsFalsefor empty or invalid JSON, whileovclash_suite_query_load_settings_json()reportsOVCLASH_SUITE_STATUS_ERRORfor it.Explicit cleanup methods, such as
ClashRuntime.destroy()(aliasclose()) andClashDetection.destroy(), raiseRuntimeErrorwhen the native release fails. They keep the handle for a retry.Importing either package raises
OSErrorwhen the native library cannot be loaded, andRuntimeErrorwhen the library’s version differs from the package’s.
Environment variables#
This section lists every environment variable that a consumer of the wheel or the SDK archive
can set. A flag is enabled by any value other than empty, 0, false, off or no; the
comparison ignores case and surrounding whitespace.
Loading the library#
The Python packages read these variables when they load the native library.
Variable |
Values |
Required |
Default |
Effect |
|---|---|---|---|---|
|
The absolute path of the native library |
With the SDK archive’s Python packages |
Unset: the packages load the library that the wheel bundles |
Selects the native library to load. |
|
Flag |
No |
Off |
For development only. Lets the loader fall back to a platform bare-name library lookup when neither override is set and no bundled library exists. |
|
Directories separated by |
No |
Unset |
Windows only. Extra DLL search directories. |
|
Flag |
No |
Off |
Stops the loader from adding the runtime’s OpenUSD plugin directories to |
|
The absolute path of an installed |
No |
Unset: the selected interpreter’s |
SDK archive only; the wheel and its launchers ignore it. Selects that installation instead of the interpreter’s. The Python bindings and the sample launchers read it, and |
|
A directory path |
No |
Unset: with the wheel, the loader sets it to the runtime it found |
Read by the |
Runtime behavior#
The native library reads these variables itself, so they apply to C and C++ programs as well as to the Python packages.
Variable |
Values |
Required |
Default |
Effect |
|---|---|---|---|---|
|
Milliseconds, an unsigned 32-bit decimal integer |
No |
|
How long the runtime’s omni client, the Omniverse client library inside ovstage, keeps reconnecting to an unreachable |
|
|
No |
Unset: off |
Exactly |
Sample launchers and build_samples#
The shipped sample launchers read these variables; a command-line option wins over its variable. Samples describes the launchers.
run_custom_clash is the launcher of The Clash Processor.
Outside an SDK archive, or with --wheel, it takes the published-wheel route unless
--install-root names an SDK archive: it installs the published ovclash wheel into its own
virtual environment and runs the processor there.
Variable |
Values |
Required |
Default |
Effect |
|---|---|---|---|---|
|
An interpreter name or path |
No |
|
The base interpreter of the sample launchers, |
|
An absolute directory path |
No |
|
The per-user cache root. The cached sample environments live under |
|
A backend name; the released packages hold only |
No |
Unset: the packaged |
The default backend of the |
|
A directory path |
No |
Unset: the package that holds the launcher |
The runtime or SDK archive root for the sample launchers, |
|
|
No |
|
Windows launchers only. The default |
|
A USD file path |
No |
|
The default |
|
A directory path |
No |
A directory inside the package root; see Output directories |
The default |
|
A package index URL |
No |
Unset: pip’s own configuration selects the index |
|
|
An |
No |
The latest version |
|
|
A Python script path |
No |
|
|
|
A directory path |
No |
Windows SDK archive: a per-user cache under |
SDK archive only. The parent of the C++ sample build trees, like |
|
An executable name or path |
No |
|
SDK archive only. The CMake executable of |
|
|
No |
|
SDK archive only, Linux. The default |
|
A directory path; an absolute interpreter path |
No |
Discovered; the selected interpreter |
SDK archive only. Read by |
|
A directory path |
No |
Unset |
SDK archive only. When |
When a launcher installs the ovstage pin into its cached environment, pip’s own configuration
applies, including PIP_* variables such as PIP_INDEX_URL.
Two names look like backend switches and are not:
OVCLASH_BACKENDonly presets the--backendoption of the sample launchers.ovclash_suite.ClashDetection(backend=...)accepts"ovclash","suite"and"legacy", and raisesValueErrorfor any other value. It is a compatibility name for the Suite object model. The loaded library determines the backend;backend_info()reports it.
Persistence and export#
The Suite API’s stores and exports have their own pages:
Persistence: choosing a store, opening and committing, records, saving detection results and clash states;
SQLite store and Directory store: the two built-in stores;
Legacy Containers: Kit-era
.clashDetectionfiles;Export: JSON and HTML reports.
One rule applies to every write on a built-in store. A write that fails after its storage write began rolls back every write pending on that data handle, including earlier writes that returned success. Commit before a write that may fail when the earlier writes must survive.