Language: Python (PySide2) API: Maya Python API (OpenMaya)
This tool was developed to help environment artists quickly identify and resolve duplicate meshes in their scenes. Accidental duplicates often lead to z-fighting artifacts, lighting bake errors, and inflated file sizes.
The Challenge: Performance
The initial prototype used standard Maya commands (cmds), which proved too slow for production scenes containing thousands of objects.
- Initial Benchmark: A scene with ~6000 objects took 11.2 seconds to process.
To address this, I rewrote the core logic using OpenMaya, Maya's low-level C++ API wrapper. By accessing the mesh data directly and optimizing the comparison algorithm (using bounding box pre-checks and vertex array comparison), I achieved a drastic performance increase.
- Optimized Benchmark: The same scene was processed in 0.17 seconds.
Features
- Tolerance Check: Finds meshes that are not perfectly overlapping but are within a specified distance threshold.
- UI/UX: Built with PySide2, featuring a dockable interface and a tree view that groups duplicates for easy selection and inspection.
- Filtering: Options to ignore hidden objects or freeze transformations.
Results grouped by overlap clusters for easy inspection.
Interface Guide
- Only Perfect Overlaps: Checks for overlapping meshes vertex by vertex with 0 tolerance. (Faster)
- Fast (less accurate): Disables the final triangulation check. Faster but may return false positives.
- Tolerance: Sets the distance threshold (in Maya units) for finding matches.
- Helper Label: Displays usage suggestions.
- Results: Displays processing results. Selecting an item selects it in the viewport.
- Resulting Group: A cluster of overlapping meshes, showing the count.
- Overlapping Meshes: List of individual meshes that overlap.
- Find Overlapping Meshes: The "GO" button to start processing.
- Status Bar: Displays the tool's current status and progress.