[omniperf-agent] Add sample code#12
Closed
soowanpNV wants to merge 7 commits into
Closed
Conversation
Add stage stats export sample under dev/samples/.
Add six read-only Kit Script-Editor analyzers under dev/samples/:
- 01_largest_meshes.py : top-N largest meshes by vertex/triangle count
- 02_instancing.py : current PointInstancer / instance-proxy usage
- 03_animation.py : redundant time-samples via SO optimizeTimeSamples
- 04_small_objects.py : sub-threshold meshes via SO removeSmallGeometry
- 05_slab.py : flat/slab-like meshes by bbox aspect ratio
- 06_instancing_opportunities : dedup candidates via SO deduplicateGeometry +
USD signature grouping
All scripts:
- analysisMode=1 (read-only, no stage mutation)
- async with periodic next_update_async yield (keeps Script Editor responsive)
- introspect SceneOptimizerCore.getOperations() and gracefully fall back to
pure-USD computation when an SO op is not registered in the running Kit
- op names / args / analysis output shapes verified against C++ source in
omniverse-scene-optimizer and scene-optimizer-core
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ndly) Changes to all sample scripts under dev/samples/: - Output files (CSV / JSON) now write to ./<name>.csv instead of /tmp/<name>.csv so they work on Windows without modification. New scripts: - 07_so_printstats.py : invoke SO printStats op in analysis mode - 08_validators.py : Find Coinciding / Occluded / Overlapping Meshes - 09_hierarchy_depth.py : prim tree depth + branch factor distribution - 10_pipe_density.py : cylinder-like mesh heuristic + axis-alignment All scripts: - analysisMode=1 (read-only, no stage mutation) - async + periodic next_update_async yield - SceneOptimizerCore.getOperations() introspection — un-registered ops skipped - Op names, args, and analysis output shapes verified directly from C++ source in omniverse-scene-optimizer (findCoincidingGeometry, findOccludedMeshes, findOverlappingMeshes, printStats, optimizeTimeSamples, removeSmallGeometry, deduplicateGeometry). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds OUTPUT_JSON='./stage_stats.json' and writes the returned stats dict to a JSON file in addition to printing to console. Path is CWD-relative for Windows compatibility, consistent with the other dev/samples scripts.
…tions Adds three Kit Script Editor scripts (numbered 11-13) and one standalone CLI to cover follow-up questions raised after PR review: - 11_usd_files_inventory.py - count and size loaded USD layers - 12_pipe_geometry_detail.py - triangle count, instancing, naming check on pipe-like meshes - 13_triangle_aspect_ratio.py - longest/shortest-edge ratio per triangle, with pipe subset - standalone_usd_disk_scan.py - runs OUTSIDE Kit, scans a folder for USD files + sizes The standalone script is intentionally unnumbered to mark it as the only script in the folder that does not run inside Kit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…gory_pipes.py) Counts prims in the stage whose omni:hoops:metadata:Other:Category attribute equals 'Pipe' or 'Pipes' (the HOOPS Exchange CAD-category tag). Reports exact-case + case-insensitive matches, full Category distribution, mesh vs non-mesh breakdown, and fan-triangulation triangle totals for matching mesh prims. Writes hoops_category_pipes.csv and hoops_category_distribution.csv.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two sample scripts under
dev/samples/:export_stage_stats.py— collects USD / RTX Scene / Scene Optimizer statistics inside a Kit-based app by opening the Statistics window and querying the stats interface. Also writesstage_stats.json.export_carb_settings.py— dumps the current Carbonite (carb) settings, enabled extensions, and selected env vars tocarb_settings.jsonfor diffing / debugging.Adds ten read-only Kit Script-Editor analyzers under
dev/samples/:01_largest_meshes.py— top-N largest meshes by vertex / triangle count and bbox volume.02_instancing.py— currentPointInstancerand instance-proxy usage with prototype reuse counts.03_animation.py— redundant time samples reported by the SOoptimizeTimeSamplesop.04_small_objects.py— sub-threshold meshes flagged by the SOremoveSmallGeometryop.05_slab.py— flat / slab-like meshes detected by bbox aspect ratio.06_instancing_opportunities.py— deduplication candidates via SOdeduplicateGeometryplus USD signature grouping.07_so_printstats.py— invokes the SOprintStatsop directly in analysis mode and writes the payload toso_printstats.json.08_validators.py— runs SOfindCoincidingGeometry,findOverlappingMeshes, and (optional)findOccludedMeshesin analysis mode.09_hierarchy_depth.py— prim tree depth and branch-factor distribution fromstage.TraverseAll().10_pipe_density.py— cylinder-like mesh heuristic and axis-alignment ratio per stage volume.Adds three more Kit Script-Editor analyzers plus one standalone CLI for follow-up vendor questions:
11_usd_files_inventory.py— enumeratesSdf.Layer.GetLoadedLayers()for the open stage, resolves each layer to a real path, and reports per-file size on disk plus extension breakdown.12_pipe_geometry_detail.py— builds on10_pipe_density.py: per pipe-like mesh, counts triangles (fan-triangulated face-vertex-counts), flagsIsInstance/IsInstanceable/IsInstanceProxy, and checks prim-name / ancestor-name against a token list (pipe,tube,conduit, ...) for naming identifiability.13_triangle_aspect_ratio.py— fan-triangulates every face and reports the longest-edge / shortest-edge aspect ratio distribution across the stage, with a separate subset for pipe-like meshes (sliver vs equilateral).standalone_usd_disk_scan.py— the only script in the folder that runs outside Kit. Pure Python 3.8+, walks a directory tree, counts.usd/.usda/.usdc/.usdzfiles and their sizes. Intended for pre-Kit triage of customer data drops.Adds a HOOPS metadata category counter:
14_hoops_category_pipes.py— walksUsd.PrimRange.Stage(stage, Usd.TraverseInstanceProxies())and inspects theomni:hoops:metadata:Other:Categoryattribute on each prim (the tag attached by HOOPS Exchange when importing CAD data). Reports exact-case counts for"Pipe"and"Pipes", a case-insensitive sum, the full Category distribution (top-N), mesh vs non-mesh breakdown for matching prims, and fan-triangulation triangle totals for matching mesh prims. Writeshoops_category_pipes.csvandhoops_category_distribution.csv.All analyzers are read-only (
analysisMode=1), async (Script Editor stays responsive), introspectSceneOptimizerCore.getOperations()to skip ops that are not registered, and write CSV / JSON outputs to the current working directory for Windows compatibility.🤖 Generated by OmniPerf Agent — AI-assisted merge request