Kit Compatibility#

omni.physxclashdetectioncore is a Kit-free Python package with the import paths of Kit’s package of the same name. ovclash is the clash detection library for USD scenes that runs without Kit.

  • Where it ships. It ships beside ovclash and ovclash_suite, in the wheel and in the SDK archive’s python/ directory. ovclash_suite, the Python package of the Suite API, backs it.

  • What resolves. Every public class, function and class member that Kit defines in a module that both packages provide resolves here, except the gaps under What does not. Code that uses only those names needs no import changes.

  • What to check. A few parameters and behaviors differ; see Behavioral differences to check.

Use the package only to port existing Kit code. New code imports ovclash_suite directly; see Choosing an API Layer and Suite Workflows.

Every name the package forwards is the Suite API’s own object, not a wrapper. omni.physxclashdetectioncore.ClashDetection and ovclash_suite.ClashDetection are one class. A partially ported module can therefore mix the two spellings without isinstance surprises. Three functions wrap a Suite function of the same name instead: clash_detect_export.export_to_json, clash_detect_export.export_to_html and utils.file_exists.

# Kit code: keeps working, no edit needed.
from omni.physxclashdetectioncore.clash_detect import ClashDetection
from omni.physxclashdetectioncore.clash_detect_settings import SettingId

# The same two objects, spelled the way new code should spell them.
from ovclash_suite import ClashDetection as SuiteClashDetection, SettingId as SuiteSettingId

assert ClashDetection is SuiteClashDetection
assert SettingId is SuiteSettingId

Importing the package imports ovclash_suite, which loads the native library:

  • The wheel finds the library it bundles.

  • With the SDK archive, put its python/ directory on PYTHONPATH, and set OVCLASH_LIB or OVCLASH_SUITE_LIB to the absolute path of the native library. See Native library lookup.

This page covers the Python package. Two other pages cover the rest of the Kit surface:

  • Limitations lists the C entry points kept only for compatibility with Kit’s clash interface.

  • Legacy Containers covers Kit’s .clashDetection result files.

What resolves#

The package root re-exports these ovclash_suite names. Kit’s package root does not provide them, so Kit code imports them from the submodules that keep Kit’s import paths, which the Module | Exports table of this section lists.

Name

Kind

AbstractClashDataSerializer

serializer base class

ArrayView

array container of copied values, convertible to a list, a NumPy array or a Warp array

ClashData

data-store facade

ClashDataSerializerDirectory

directory serializer that stores readable JSON files; ovclash only

ClashDataSerializerSqlite

SQLite serializer for .ovclashdb and .clashDetection files

ClashDetection

runtime: stage, settings, scopes, pipeline, reports

ClashFrameInfo

per-frame clash record

ClashInfo

clash record

ClashQuery

query model

ClashState

enum

OverlapType

enum

PointCloudSettings

point-cloud settings record

SettingId

settings-key enum

These submodules keep Kit’s import paths. Each one exposes the Suite API names in its row and lists exactly those names in __all__. Only the two export functions are wrappers.

Module

Exports

clash_data

ClashData, Serializer_data_operations, serializer_data_op

clash_data_serializer

AbstractClashDataSerializer

clash_data_serializer_sqlite

ClashDataSerializerSqlite

clash_detect

ClashDetection, DEFAULT_SETTINGS, OverlapReportFlag

clash_detect_export

ExportColumnDef, export_to_json, export_to_html

clash_detect_settings

SettingId

clash_info

ClashFrameInfo, ClashInfo, ClashState, OverlapType

clash_query

ClashQuery

point_cloud_settings

PointCloudSettings

clash_data_serializer_directory exports ClashDataSerializerDirectory in the same way. Kit has no such module.

These modules are implemented in the package rather than forwarded:

  • config.ExtensionConfig keeps Kit’s class attributes and defaults:

    Field

    Type

    Required

    Default or values

    Description

    debug_logging, debug_logging_detailed

    bool

    No

    False

    Kit’s logging switches. Nothing here reads them.

    extension_path

    str or None

    No

    None

    Kit sets it at extension startup; nothing sets it here.

    update_clash_states_after_detection

    bool

    No

    True

    Whether fetch-and-save updates the stored clash states. A class-level property that reads and writes ovclash_suite._runtime.update_clash_states_after_detection, so both spellings share one flag; assignment stores bool(value). Read and set it on the class. Unlike Kit’s attribute, it is not visible on an instance.

  • logger.Logger has no Kit counterpart. Its log_error, log_warn and log_info class methods write to the standard-library logger named ovclash_suite, which ovclash_suite also uses. The utils and usd_utils helpers log there where Kit’s code calls carb.log_*, the logging functions of Kit’s Carbonite framework.

  • utils provides every Kit helper.

    • make_int128 and html_escape are the Suite API’s own functions.

    • get_available_system_memory() reads the operating system instead of Kit’s omni.gpu_foundation_factory extension. Like Kit, it returns 0 when it cannot tell.

    • measure_execution_time returns the function’s result but prints nothing. Kit prints each call’s duration.

  • usd_utils keeps Kit’s four matrix helpers, which need no OpenUSD: matrix_to_list, list_to_matrix, serialize_matrix_to_json and deserialize_matrix_from_json. list_to_matrix and deserialize_matrix_from_json return a tuple of four float tuples where Kit returns Gf.Matrix4d, the 4x4 matrix type of OpenUSD in Python. The OpenUSD-dependent helpers are stubs; see What does not.

The forwarded names are the Suite API’s own objects, so the ovclash_suite docstrings document them. The docstrings of the four modules config, logger, utils and usd_utils, in the installed omni.physxclashdetectioncore package, are their reference. References in the package says how to read the docstrings.

What does not#

The Kit API in the Missing API table of this section does not resolve. Apart from ExtensionConfig at the package root, each gap is structural. It needs one of these, which this package does not have:

  • Kit itself;

  • Python OpenUSD (pxr) or Warp, which this package does not require;

  • a C ABI entry point that the native layer does not expose.

None of it is a defect to fix in place. Closing a gap means adding that dependency or that entry point.

Missing API

Why

Modules commands, extension, clash_detect_layer_utils

Absent as whole modules, so importing one raises ModuleNotFoundError. The first two hold the omni.kit.commands command classes and the omni.ext extension entry point. The third holds ClashDetectLayerHelper, which creates and manages the clash-detection Sdf.Layer (an OpenUSD layer object) on a Usd.Stage (an OpenUSD stage object).

ExtensionConfig, register_commands, unregister_commands, ClashDetectionCoreExtension at the package root

Kit’s package __init__ runs from .extension import *, which puts these names at Kit’s package root. None of them resolves at this package’s root. Import ExtensionConfig from omni.physxclashdetectioncore.config. The other three belong to the absent commands and extension modules.

ClashData.stage, .stage_id, .target_layer, .usd_file_path

Handles to the USD stage and layer that Kit binds the data to. There is no Python OpenUSD stage object here, so ClashData.open() and ClashData.save_as() take store paths; see Behavioral differences to check.

ClashDataSerializerSqlite.vacuum, .migrate_table, .get_free_list_size

SQLite maintenance. Kit runs these on a sqlite3 connection it owns in Python. Here the native layer owns the connection and exposes no equivalent entry point. Whole-file migration is available as migrate_data_structures_to_latest_version().

ClashData.data_file_damaged, AbstractClashDataSerializer.data_file_damaged, ClashDataSerializerSqlite.data_file_damaged

Kit’s flag that SQLite reported the file as corrupt or as not a database. Kit sets it from the result codes of the sqlite3 connection it owns in Python. Here the native layer owns the connection and exposes no entry point that reports the condition. open() raises RuntimeError with SQLite’s reason when the file cannot be inspected, rather than leaving the store closed quietly, and a read that reaches a damaged page raises too; see Behavioral differences to check.

ClashFrameInfo.device

Kit’s constructor argument that selects the Warp device for the frame’s default (empty) arrays. Frame arrays here are ArrayView containers of copied values, not Warp arrays, so there is no device to select. ArrayView.warp() converts one to a Warp array when warp-lang is installed.

These names are deliberately absent rather than present-and-raising. Code that feature-detects with hasattr sees that they are missing and can take its fallback path.

The OpenUSD-dependent helpers in usd_utils are the exception: get_prim_children_paths, get_list_of_prim_paths, get_prim_matrix, are_points_prim_widths_animated and get_points_prim_widths_array. They keep Kit’s signatures, log an error and raise NotImplementedError. A Kit caller therefore gets that error instead of a TypeError.

For a prim transform, call ClashDetection.open_stage() and then ClashDetection.get_prim_matrix(), which the C ABI backs. Two details differ from Kit’s helper:

  • It takes a USD time code, where Kit’s helper takes seconds.

  • It returns a NumPy array, or a tuple of four row tuples when NumPy is not installed. Kit’s helper returns Gf.Matrix4d.

Behavioral differences to check#

A stage argument names a file. ClashDetection.set_settings() and set_scope() accept a file path, a pathlib.Path or a stage object.

  • From a stage object they take the file path of its root layer, and the native layer opens that file. Unsaved edits in a Python Usd.Stage are therefore not seen.

  • A stage argument that names the file already open, in any spelling, does not reopen it. Edits saved after the first open are not seen either. To see them, call ClashDetection.open_stage() with the file path, then call set_scope() again: a successful open clears the scope.

  • set_settings() reads the timeline (start and end time codes, time codes per second) from the stage object itself. The run’s time range therefore follows unsaved timeline edits.

  • The other methods that take Kit’s stage argument, such as fetch_and_save_overlaps() and process_overlap(), ignore it.

Scopes take literal prim paths.

  • ClashDetection.set_scope() does not expand a USD collection path to its member prims, as Kit’s does.

  • get_list_of_prims_int_paths() ignores its add_prim_children, prim_accept_fn and exclude_invisible arguments; the native run settings control visibility. It returns the prim paths as strings, not as Sdf.Path objects.

Some parameters differ. Ported calls to these methods need edits:

  • ClashData.open() takes the store’s file path, where Kit’s takes a stage id, Kit’s integer handle of an open stage. It has no force_reload_layer parameter.

  • ClashData.save_as() takes the store’s new path. Kit’s save_as() takes the stage’s new USD path, saves the store in place and saves the clash layer for that stage path. A ported save_as("scene.usd") therefore writes an SQLite store named scene.usd. It raises RuntimeError when that file already holds a USD layer.

  • ClashFrameInfo() has no device parameter, so each parameter after object_1_matrix sits one position earlier than in Kit. A Kit call that passes device by position stores it in usd_points_0 without an error. Pass the arguments after object_1_matrix by keyword.

  • Some parameters have new names, which the Kit name and Name here columns of the method table give. A Kit call that passes one by keyword raises TypeError.

Method

Kit name

Name here

ClashDataSerializerSqlite.insert_point_cloud_settings(), update_point_cloud_settings()

point_cloud_settings

settings

ClashDataSerializerSqlite.find_point_cloud_settings(), remove_point_cloud_settings_by_id()

point_cloud_settings_id

identifier

ClashFrameInfo.check_object_0_matrix_changed(), check_object_1_matrix_changed()

mtx

matrix

usd_utils.list_to_matrix()

lst

values

utils.html_escape()

t

text

ClashDataSerializerDirectory uses the new point-cloud parameter names too. ClashData and AbstractClashDataSerializer keep Kit’s names.

A ported detect-and-store flow, with the edits these rules require. It runs on time_sampled.usda, the sample stage in samples/data/ of the installed ovclash package and of the SDK archive. Run it from that directory, or pass the stage’s full path:

from contextlib import closing

from omni.physxclashdetectioncore.clash_data import ClashData
from omni.physxclashdetectioncore.clash_detect import ClashDetection
from omni.physxclashdetectioncore.clash_query import ClashQuery

query = ClashQuery(
    query_name="Cube vs Plane",
    object_a_path="/Root/Xform_Primitives/Cube",
    object_b_path="/Root/Xform_Primitives/Plane",
)
data = ClashData()  # SQLite serializer by default
data.open("results.ovclashdb")  # Kit: data.open(stage_id)
data.insert_query(query)

clash = ClashDetection()
try:
    # A `stage` argument names the file the native layer opens.
    clash.set_settings(query.clash_detect_settings, "time_sampled.usda")
    clash.set_scope("time_sampled.usda", query.object_a_path, query.object_b_path)
    clash.run_pipeline()
    # The generator reserves the runtime and the store until it is exhausted or closed.
    with closing(clash.fetch_and_save_overlaps(None, data, query)) as fetch:
        for progress in fetch:
            pass
    print("stored overlaps:", data.get_overlaps_count_by_query_id(query.identifier))
finally:
    clash.destroy()
    data.close()
stored overlaps: 1

Export rejects ragged rows and selects cells by column order.

  • export_to_json and export_to_html raise ValueError for a row whose length differs from the column count.

  • In both formats, each column renders the cell that its order selects.

  • Kit’s export_to_json writes each row as given. The cells of a JSON row therefore differ from Kit’s whenever a column’s order differs from its index.

See Export.

Native failures raise. A failed native call normally raises an exception that carries the native error text. Kit often logs the error and returns False, 0 or None instead; its SQLite serializer, for example, logs every SQLite error and carries on. The data and serializer classes keep Kit’s return values in a few cases, such as a store that is not open. Failures that do not raise lists them.

Unchanged approvals survive re-detection. ExtensionConfig.update_clash_states_after_detection defaults to True. With it set, Kit sets every re-detected clash to ACTIVE. ovclash keeps a clash APPROVED when its detected contents are exactly unchanged. Clash states gives every state rule and what the comparison covers.

To preserve all stored states, clear the flag before the fetch starts:

from omni.physxclashdetectioncore.config import ExtensionConfig

ExtensionConfig.update_clash_states_after_detection = False

The fetch generator holds its owners. fetch_and_save_overlaps() returns a generator. It reserves its runtime and store until it is exhausted or closed, even after its final progress value.

  • Until then, the runtime and a built-in store reject conflicting calls, such as closing the store.

  • A custom serializer must guard its own store.

  • Close a generator that you stop early, for example with contextlib.closing, as the ported detect-and-store flow in Behavioral differences to check does.

See fetch and cursor lifetime.

Custom serializers need fetch_transaction. A Kit-style serializer that implements only the CRUD methods cannot receive fetched results: the fetch raises NotImplementedError before it starts. Override fetch_transaction(). The contract is in Custom stores.