Skip to content

Surgical Toolbox

Preflight’s “Surgery Engine” uses Session Layers to apply non-destructive edits on top of your USD files. No changes are written to disk until you explicitly export.

While many of these actions can be applied automatically via the Diagnostic engine, you can also perform manual adjustments using the Inspector.

This is the complete registry of all available FixAction operations in the Preflight validation engine.

Action IDDescriptionImpact
fix:setUpAxisRotates the stage root -90° X to match RealityKit’s Y-Up coordinate system.Updates stage metadata.
fix:setDefaultPrimDesignates a prim as the root anchor. Essential for QuickLook and RealityKit auto-loading.Metadata only. Safe.
fix:setMetersPerUnitUpdates the scaling metadata (e.g., 0.01 for cm to 1.0 for meters).Metadata only. Does not resize geometry.
fix:setDoubleSidedFlags specific meshes (doubleSided = true) to disable backface culling.Renders both sides of the mesh.
fix:setSubdivisionSchemeSets subdivision mode (e.g., to none or catmullClark).Affects tessellation.
fix:addUVsGenerates Planar (XZ) texture coordinates for meshes missing UVs.Destructive. Modifies geometry. Emergency use only.
Action IDDescriptionImpact
fix:remapSkeletonRebases animation joint paths to match a skeleton hierarchy (e.g., strips /Armature/ prefixes).Essential for fixing Mixamo/Blender exports.
fix:mergeSkeletonsCombines fragmented root joints into a single SkelRoot.Fixes FBX imports with multiple skeleton roots.
Action IDDescriptionImpact
fix:assignMaterialBinds a material path (e.g., /Materials/Steel) to a specific mesh prim.Fixes “Pink Mesh” missing bindings.
fix:setTextureSwaps a texture file path (e.g., .png.ktx2) for a specific shader input.Used for optimization.
fix:flattenNestedShaderMoves shaders defined inside mesh scopes to a global /Materials scope.Enables instancing and reduces draw calls.
fix:fixShaderPropertyTypeCasts a shader input value to the correct type (e.g., float to color3f, token to string for primvar names).Prevents renderer/toolchain type coercion differences and improves round-trip stability across DCCs and runtimes.
Action IDDescriptionImpact
fix:makeRCPReadyAdds Reality Composer Pro metadata (Timeline, Behaviors, Components).Prepares file for RCP editing.
fix:cleanupMissingReferenceRemoves USD references pointing to missing files.Prevents load errors.
fix:applyMissingSchemaAdds a specific USD API schema (e.g., PhysicsRigidBodyAPI, MaterialBindingAPI) to a prim.Makes authored relationships/schema usage explicit and portable across stricter validators, tools, and runtime parsers.
fix:applyAllAutomatically executes all safe, deterministic fixes found in validation.Batch repair.

All surgery tools can be invoked via the preflighttool binary for CI/CD pipelines.

Terminal window
preflighttool surgery <command> <input_file> [args...]
Internal ActionCLI CommandExample Arguments
remapSkeletonremap-skeleton--from "/Armature" --to "/root"
mergeSkeletonsmerge-skeletons(no args)
setUpAxisfix-axisY
setMetersPerUnitset-scale0.01
makeRCPReadymake-rcp-ready(no args)
setDefaultPrimset-default-prim"/root"
addUVsadd-uvs"/root/Mesh"
assignMaterialbind-material"/root/Mesh" "/Materials/Mat1"
applyAllapply-all(no args)
cleanupMissingReferencecleanup-ref"/path/to/missing/file.png"
applyMissingSchemaapply-schema"/root" "PhysicsRigidBodyAPI"
setDoubleSidedset-double-sided"/root/Mesh" true
setSubdivisionSchemeset-subdivision-scheme"/root/Mesh" "none"
flattenNestedShaderflatten-nested-shader"/root" "/root/Mesh/Shader"
setTextureset-texture"/root/Mesh" "diffuseColor" "new.png"
fixShaderPropertyTypefix-shader-type"/root/Shader" "input" "color3f"