The data adapter is a Kit extension that performs scene optimization. This allows complex scenes to be converted into more lightweight representations which can be displayed and evaluated more quickly.
The adapter provides a number of optimization tools which can be used individually or in combination to optimize a scene. Examples are merging meshes, deleting specific objects from the scene, and converting identical meshes into instances.
NOTE: This is a preview release of an extension which is in early development. There are known limitations, and functionality may change considerably between now and the next release.
Enabling the extension¶
The extension can be enabled via the Window -> Extensions window. Search for Data Adapter
The following is a list of optimization modules currently supported by the data adapter, with a brief description of the functionality provided.
delete primitives with the given names. Names can include wildcards
merge individual meshes. There are many options to control merge behavior, for example whether to merge all meshes or merge only meshes with the same material.
Runs the merge operation on all files in a directory. Useful for batch processing scenes.
Merge all meshes for meshes attached to a skeleton. This can greatly improve character playback speed by optimizing scenes for GPU skinning computation.
Merge a file without having to load it into Create.
Merge meshes at leaf level of a scene. This means all meshes under a parent transform will be combined into a single name. The output mesh will take the name of the parent transform
Merge meshes and parent under a transform on the scene.
Merge meshes and parent under a transform defined by the given matrix
Center and reorient transformation matrices
Convert normals and STs to faceVarying layout.
Exported selected hierarchy from scene
Export multiple selected hierarchies from scene. A separate scene is generated for each path. Optionally attribute connections and relationships can be preserved.
Find meshes with identical topologies within the paths defined by argument primPaths. primPaths can contain absolute USD stage paths or regular expressions. Optionally compare vertex positions for identity checks, and consider leaf prims only.
Convert identical meshes into instances
Run the partitionScene algorithm on all files in a directory. Useful for batch processing.
Using the adapter¶
Once the extension is installed, the UI is available via the Edit -> Data Adapter menu option.
When the adapter is enabled, the following UI is displayed:
The add menu enables creation of optimization modules.
The clear menu removes the current configuration from the UI.
The execute menu runs the current configuration.
The save menu allows a configuration generated by the add menu to be saved to a json file.
The load menu allows a previously saved configuration to be loaded into the UI for execution.
Example: Configuring a merge operation¶
This section describes an example walkthrough of one of the adapter optimization options. This option is a merge, which combines meshes in the original scene in various ways. Reducing the number of meshes in a scene can improve performance.
Select the add -> merge option. The following UI is displayed:
meshPrimPaths defines the meshes to operate on. Meshes can be selected in Create and added here using the + option, or names can be typed in directly. Wildcards can be used. If left blank, all meshes in the scene will be merged.
considerMaterials defines how meshes with different materials are handled. If this option is selected, meshes with the same material will be merged. If not selected, all meshes will be merged regardless of original material. Materials will be preserved on the output mesh and assigned to individual faces using geomSubsets.
considerNormalsVariability. If selected meshes with the same normals variability will be merged (eg constant, uniform, faceVarying). If not selected, all normals will be converted to faceVarying normals. This can result in more data if most meshes do not originally have faceVarying normals.
considerStVariability. If selected meshes with the same ST variability will be merged (eg constant, uniform, faceVarying). If not selected, all STs will be converted to faceVarying STs. This can result in more data if most meshes do not originally have faceVarying STs.
considerSubdivisionSchema. If selected meshes with the same subdivision variability will be merged (eg catmullClark, loop). If not selected, all meshes will be merged regardless of subdivision schema. This can change mesh appearance if subdivision is enabled on the generated scene.
parentXform Define a parent transform under which to place the merged meshes.
considerHierarchy Consider all meshes under the given meshPrimPaths. If not selected, only meshPrimPaths objects are merged.
deleteOriginalGeom Delete any meshes in the original scene that have been merged.
For best results explore the various options given above, but a reasonable starting point would be to choose the following options:
This will merge all meshes with the same material into a single mesh, and remove all the original meshes that were merged from the scene.