Limitations#
This page lists what standalone ovclash does not do, and how to work around each limit. The
released wheel and SDK archive read
USD through the ovstage
backend, so every row applies to them. An unpublished reference build
that reads USD through OpenUSD differs in places; the comments in the
public headers, such as <ovclash/ovclash.h>, name each difference.
Related pages:
Kit Compatibility lists the Kit Python names that the
omni.physxclashdetectioncorepackage does not provide.Troubleshooting lists error messages with their causes and fixes.
Settings gives every setting’s default and effect.
Kept only for Kit compatibility#
These entry points and settings exist so that code written for the Kit clash interface still builds and runs. None of them changes clash results.
Feature |
Behavior in ovclash |
Use instead |
|---|---|---|
|
Always returns |
|
|
Does nothing. It returns success unless the context is null or an async run is active. |
Nothing. There are never debug meshes to release. |
|
Does nothing. It returns success unless the context is null or an async run is active. Stage editing is Kit-only, so the duplicates stay reported. |
Remove duplicates in your own pipeline. Read the pairs with |
|
Returns fixed values: every time is |
|
|
Stored, read back and written into persisted query settings. Nothing reads it: USDRT, Kit’s runtime scene representation, is not part of ovclash. This covers |
Nothing needed. |
ROI include and exclude paths |
The ROI paths (region of interest) |
An A/B scope, the two search sets of prim paths: |
|
A persisted record only. The serializers store it and read it back. ovclash does not generate or process point clouds from it. |
Author point clouds in your own pipeline. ovclash collides existing |
|
Stored but never read. |
Nothing needed. |
Result and run limits#
Feature |
Limitation |
Workaround |
|---|---|---|
Overlap index order |
The index passed to |
Key on |
Meshes that cannot be cooked |
PhysX cannot cook some meshes, for example one whose triangles are all degenerate. ovclash drops such a mesh from the run. The run still succeeds, and the pairs of that mesh are missing. |
Compare |
Duplicate search in dynamic runs |
Duplicate-mesh search is off for a dynamic query. |
Search for duplicates with a static query, where the start time equals the end time. See Dynamic runs. |
Point-cloud depth |
Depth is mesh-only. A point-vs-mesh overlap reports a maximum local depth ( |
Check the overlap type before you request depth. Canonical API: compare |
Point-cloud widths in reports |
|
Read the widths from USD by the indices in |
Settings changed between steps |
A run fixes |
Change settings only between runs. |
Thread-count setting |
|
Turn the new task manager off: |
There is no timeout. |
Poll |
Scene limits#
Feature |
Limitation |
Workaround |
|---|---|---|
Stage location |
The stage you open must be an existing local file. |
Copy the root layer to a local path. References, payloads and assets inside the stage may still use |
Instanced point clouds |
ovclash drops a |
Keep point clouds out of instanceable prims. ovclash collides a non-instanced cloud normally. |
Unresolved transform animation |
|
Author an initial value for every active transform operation on the mesh and its ancestors. For an attached stage, supply its composition (Python: |
Workaround examples#
Before you begin: the Python examples are standalone scripts that need the ovclash package
installed, as Python Quickstart shows. Replace scene.usda with the path
of your stage file and run each script with that Python. The C example is a function for your
own program, which builds against the SDK archive as C/C++ Quickstart
shows.
Take the sampled range from the stage#
ovclash_get_timeline_data does not describe the stage. Read the stage’s own timeline and
convert its time codes to seconds. Reject a rate that is not positive and finite before you
divide by it. get_stage_timeline_data() returns an ovclash.StageTimelineData, which reads the
root layer of the open stage. It raises RuntimeError when no stage is open or attached.
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
|
Yes |
|
The stage’s |
|
|
Yes |
|
The stage’s |
|
|
Yes |
The authored |
The effective rate. Divide a time code by it to get seconds. |
|
|
Yes |
|
The stage’s |
A stage attached with attach_ovstage() reports the timeline fields of its attachment, as
supplied. Reading results gives the C form,
ovclash_stage_timeline_data_t, and ovclash Python gives the type
and default of each RunSettings field that the script sets.
import math
from ovclash import ClashRuntime
runtime = ClashRuntime()
try:
runtime.open_stage("scene.usda")
timeline = runtime.get_stage_timeline_data()
rate = timeline.time_codes_per_second
if not (math.isfinite(rate) and rate > 0.0):
raise ValueError(f"unusable timeCodesPerSecond: {rate}")
runtime.set_run_settings(
runtime.get_run_settings(), # keep the other settings
set_times=True,
start_time=timeline.start_time_code / rate, # seconds, not time codes
end_time=timeline.end_time_code / rate,
time_codes_per_second=rate,
)
runtime.run_pipeline()
print("overlaps:", runtime.get_overlap_count())
finally:
runtime.destroy()
The script prints overlaps: <count>, where <count> is the number of overlapping prim pairs
over the sampled range. A stage with an unusable rate raises ValueError instead.
In C, the same values come from ovclash_get_stage_timeline_data, and
ovclash_set_times(context, start_seconds, end_seconds, timeCodesPerSecond) applies them.
Detect dropped meshes#
A mesh that PhysX cannot cook leaves a message in the last error, although every step
succeeds. Read it right after the run, then compare the counters. get_query_stats() returns an
ovclash.QueryStats, the query statistics of the last run. Every count is
0 before the pipeline has run.
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 are shared instances and reuse the cooked data of another selected mesh. |
|
|
Yes |
0 or more |
The unique meshes that the run cooked. A value below |
|
|
Yes |
0 or more |
The point clouds that the run selected. |
Reading results gives the C form, ovclash_stats_t.
from ovclash import ClashRuntime
runtime = ClashRuntime()
try:
runtime.open_stage("scene.usda")
runtime.run_pipeline()
message = runtime.last_error() # read first: a later call can replace it
stats = runtime.get_query_stats()
expected = stats.nb_meshes - stats.nb_shared_meshes
if stats.nb_cooked_meshes < expected:
print(f"{expected - stats.nb_cooked_meshes} mesh(es) dropped. {message}")
finally:
runtime.destroy()
On a stage with one mesh that cannot be cooked, the output looks like this:
1 mesh(es) dropped. ovstage: 1 mesh(es) failed to cook and were dropped from this run, starting with '/World/Degenerate'. Their overlaps are missing from the results. Compare nbCookedMeshes with nbMeshes minus nbSharedMeshes, and enable logging to name every dropped mesh.
Key overlaps by prim pair#
Do not store an overlap index between runs. Key each overlap on its prim paths, and sort the
keys when you need a stable order. get_overlap_details(index, record_index=0) returns an
ovclash.OverlapDetails for one record of the overlap at index. get_overlap_record() returns
an ovclash.OverlapRecord, which has only the name0, name1, nb_records, nb_elements,
type and time fields.
Field |
Type |
Required |
Default or values |
Description |
|---|---|---|---|---|
|
|
Yes |
A prim path, or |
The first prim: the point cloud of a point-vs-mesh pair, else a mesh. |
|
|
Yes |
A prim path, or |
The second prim, a mesh. |
|
|
Yes |
Two 64-bit words |
The clash hash, a hash of the two prim paths. |
|
|
Yes |
Two 64-bit words |
The mesh hash of each prim’s data. |
|
|
Yes |
1 or more |
The frames in which the pair overlaps. Always 1 for a static query. |
|
|
Yes |
0 or more |
The overlapping triangles or points in this frame. |
|
|
Yes |
|
The pair type. |
|
|
Yes |
Seconds |
The frame’s time, in seconds, not USD time codes. |
|
|
Yes |
|
The minimum distance between the pair’s triangles, in stage units. |
|
|
Yes |
|
The maximum local depth, in stage units. |
Overlap records gives the C form, ovclash_overlap_data_t.
from ovclash import ClashRuntime
runtime = ClashRuntime()
try:
runtime.open_stage("scene.usda")
runtime.run_pipeline()
overlaps = {}
for index in range(runtime.get_overlap_count()):
details = runtime.get_overlap_details(index)
overlaps[(details.name0, details.name1)] = details
for name0, name1 in sorted(overlaps):
print(name0, name1, overlaps[(name0, name1)].nb_elements)
finally:
runtime.destroy()
The script prints one line per overlapping prim pair, sorted by path: the two prim paths and the number of overlapping elements, triangles or points, in the pair’s first frame.
OverlapDetails.clash_hash is an alternative key. It hashes the two prim paths.
Cancel a run after a deadline#
Before you begin: your program builds against the SDK archive, and the context has an open stage
and a pipeline created with ovclash_create_pipeline().
ovclash_finish_pipeline has no timeout. Poll against your own deadline, cancel when it
passes, and finish exactly once. Add these two functions to your C source, and call
run_with_deadline() instead of running the steps with ovclash_run_pipeline_step().
#include <stdbool.h>
#include <time.h>
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
#include <ovclash/ovclash.h>
static void sleep_briefly(void)
{
#ifdef _WIN32
Sleep(50); /* milliseconds */
#else
usleep(50 * 1000); /* microseconds */
#endif
}
/* Runs the created pipeline and cancels it after timeout_s seconds. */
ovclash_result_t run_with_deadline(ovclash_context_t* ctx, double timeout_s)
{
ovclash_async_t* async = NULL;
ovclash_result_t result = ovclash_run_pipeline_async(ctx, &async);
if (result.status != OVCLASH_STATUS_SUCCESS)
return result;
const time_t start = time(NULL);
bool running = true;
while (ovclash_is_pipeline_running(async, &running).status == OVCLASH_STATUS_SUCCESS && running)
{
if (difftime(time(NULL), start) > timeout_s)
{
ovclash_cancel_pipeline(async); /* requests a stop; does not join */
break;
}
sleep_briefly();
}
result = ovclash_finish_pipeline(async); /* joins the worker and frees the handle */
async = NULL; /* the handle is gone */
return result;
}
After a cancel, ovclash_finish_pipeline returns OVCLASH_STATUS_ERROR. That status reports
the cancelled run, not a failed join: the context is usable again. In Python,
AsyncPipeline.cancel() requests the stop and finishes the run in one call; see
Asynchronous Pipelines.