User Manual

Running the Scene Optimizer App

Note

Since the app is a command line tool, it must be started from a command shell.

  • Linux

    ~/.local/share/ov/pkg/scene_optimizer-105.1.0/omni.app.scene.optimizer.batch.kit.sh
    
  • Windows

    C:\Users\<name>\AppData\Local\ov\pkg\scene_optimizer-105.1.0\omni.app.scene.optimizer.batch.kit.bat
    

Caution

If your installation of Omniverse and related content is not using default settings, please use appropriate paths.

Running the tool using just the command line above will print output indicating the arguments needed for the command. There are three arguments required:

  • Input USD file name
    • --/app/sceneOptimizer/input

  • Output USD file name
    • --/app/sceneOptimizer/output

  • JSON config file
    • --/app/sceneOptimizer/config

The config file specifies the optimizations to be performed on the input file. The result of the optimization will be written to the output file.

It is also possible to define all the above arguments in a single file that can be loaded when the app starts.

Config File Description

The config file is a JSON file that describes one or more optimizations to apply to the data.

Below is an example config file that first optimizes scene materials by replacing identical materials with a single material, then deduplicates geometry by replacing identical versions with geometry instances.

[
{
    "operation": "optimizeMaterials",
    "materialPrimPaths": [],
    "optimizeMaterialsMode": 0
},
{
    "operation": "deduplicateGeometry",
    "meshPrimPaths": [],
    "considerDeepTransforms": true,
    "duplicateMethod": 2
}
]

Generating Config Files

The file can be written by hand, but the easier way is to use the Scene Optimizer Kit extension to generate the file. The optimization steps can be defined in the Scene Optimizer UI, then saved to a JSON file.

See details on how to generate the JSON file from the Scene Optimizer Kit extension

Example of App Run

  • Linux

    ~/.local/share/ov/pkg/scene_optimizer-105.1.0/omni.app.scene.optimizer.batch.kit.sh  --/app/sceneOptimizer/input=/tmp/testScene.usd --/app/sceneOptimizer/output=/tmp/merged.usd --/app/sceneOptimizer/config=/tmp/merge_all.json
    
  • Windows

    C:\Users\<name>\AppData\Local\ov\pkg\scene_optimizer-105.1.0\omni.app.scene.optimizer.batch.kit.bat  --/app/sceneOptimizer/input=testScene.usd --/app/sceneOptimizer/output=merged.usd --/app/sceneOptimizer/config=merge_all.json
    

Caution

If your installation of Omniverse and related content is not using default settings, please use appropriate paths.

Sample Output

The application will load several Kit extensions, then load and run the Scene Optimizer extension. Output will look similar to the following (several extensions are loaded and unloaded during the run, that output is not shown below).

Information about the scene before and after optimization is printed to the shell, to give a quick overview of the impact that the changes made to the scene.

[omni.scene.optimizer.batch.plugin] Scene Optimizer batch application starting...
Input file twoBluePlanes.usd
Output file merged.usd
Config merge_all.json
Open stage twoBluePlanes.usd (0.258s)
+----------------------------------------------+
| UJITSO Stage Stats:                          |
|                                              |
| Prim Type  Count         Inactive  Invisible |
|==============================================|
| Material   1 (1 unique)  0         --        |
| Mesh       2             0         0         |
| Scope      1             0         0         |
| Shader     2             0         --        |
| Xform      1             0         0         |
|                                              |
| Total      7             0         0         |
+----------------------------------------------+
Stats before (0.026s)
Ran merge (0.005s)
Run commands (0.007s)
+----------------------------------------------+
| UJITSO Stage Stats:                          |
|                                              |
| Prim Type  Count         Inactive  Invisible |
|==============================================|
| Material   1 (1 unique)  0         --        |
| Mesh       1             0         0         |
| Scope      1             0         0         |
| Shader     2             0         --        |
| Xform      1             0         0         |
|                                              |
| Total      6             0         0         |
+----------------------------------------------+
Stats after (0s)
Wrote output merged.usd (0.005s)
Scene Optimizer finished (0.303s)