← Project Library

Maya Duplicate Object Finder

Maya Duplicate Object Finder

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.

Result Grouping Results grouped by overlap clusters for easy inspection.

Interface Guide

  1. Only Perfect Overlaps: Checks for overlapping meshes vertex by vertex with 0 tolerance. (Faster)
  2. Fast (less accurate): Disables the final triangulation check. Faster but may return false positives.
  3. Tolerance: Sets the distance threshold (in Maya units) for finding matches.
  4. Helper Label: Displays usage suggestions.
  5. Results: Displays processing results. Selecting an item selects it in the viewport.
  6. Resulting Group: A cluster of overlapping meshes, showing the count.
  7. Overlapping Meshes: List of individual meshes that overlap.
  8. Find Overlapping Meshes: The "GO" button to start processing.
  9. Status Bar: Displays the tool's current status and progress.