The MeshMatch plugin is composed of several key components, including Python scripts for the user interface and core C++ commands for backend operations and licensing.
Plugin Python Scripts
The plugin’s user interface and supporting Python logic are organized into the following modules:
mesh_match_ui.py
Houses the main UI components that form the plugin window.mesh_match_main_widget.py
The main widget displayed for each MeshMatch node selected in the scene, providing the primary interface for node interaction.mesh_match_pins_widgets.py
Contains widgets dedicated to managing pin pairs and the selection view for these pin pairs.mesh_match_custom_widgets.py
Implements subclasses of Qt widgets, providing custom behavior, styling, and enhanced functionality tailored for the plugin.mesh_match_matrix_widgets.py
Includes widgets specifically designed for managing and interpolating transformation matrices within the plugin.mesh_match_constants.py
Defines a set of string constants and other fixed values used consistently across the various Python modules, aiding in maintainability and consistency.mesh_match_utils.py
Offers various utility functions and helper classes that support the operations of other Python modules within the plugin.qt_import.py
Manages the Qt bindings import to ensure compatibility across different Maya versions, supporting both PySide2 (e.g., Maya 2023 and earlier compatible versions) and PySide6 (e.g., Maya 2024 and newer).mesh_match_commands.py
Provides a Python API with functions that wrap the core functionalities of MeshMatch nodes. This module allows for scripting interactions such as node creation, deletion, querying data, managing landmarks, and matrix operations, independently of the main plugin UI. It is distinct from the C++ based Core Plugin Commands described below.
Core Plugin Commands (Accessible via MEL/Python)
These are C++ based commands registered by the plugin that can be executed directly in Maya using MEL or Python (maya.cmds
). They handle core functionalities, including data retrieval and licensing.
General:
meshMatchGetSymDict <nodeName>
- Purpose: Retrieves symmetry data for a specified MeshMatch node. This includes vertex IDs categorized as positive, negative, center, or unsymmetrical for both the reference and target meshes associated with the node.
- Arguments:
<nodeName>
(string): The name of the MeshMatch node you want to query.
- Returns (MEL/Python): A string formatted as a Python dictionary.
- Example Structure:
"{'ref': {'pos': [id1, id2,...], 'neg': [...], 'center': [...], 'unsym': [...]}, 'tgt': {'pos': [...], 'neg': [...], 'center': [...], 'unsym': [...]}}"
- Example Structure:
- License Behavior: Requires a valid MeshMatch license to execute successfully. If the license is not valid, the command will fail and display an error.
meshMatchDetectLandmarks
-mn <meshName> -pn <panelName> [-mt <modelType>] [-li <landmarkIndices>] [-sd <saveDebugImage>]
- Purpose: Performs automatic landmarks detection from viewport using AI models on faces (bodies and hands soon integrated).
- Arguments:
<meshName>
(string): The name of the mesh transform to be captured.<panelName>
(string): The name of the modelPanel used for capturing the mesh.<landmarksIndices>
(string): A list of indices (separated with comma) to fetch from the selected model. If empty, all indices will be used<modelType>
(string): The type of model used for detection (ie ‘face’).<saveDebugImage>
(bool): When set to True, the image captured from the model with the detected points will be saved in the user tmp directory.
- Returns (MEL/Python): A JSON formatted dict containing comprehensive capture results.
The dictionnary main keys are the indices provided as argument. For each index a result dict contains :vtxId
: The closest vertex of the mesh found next to the captured pointworldPos
: The world position of the captured point.viewPos
: The 2d coordinate of the captured point in the model panel.
- License Behavior: Requires a valid MeshMatch license to execute successfully. If the license is not valid, the command will fail and display an error.
Licensing:
meshMatchGetLicenseInfo
- Purpose: Retrieves the current license state as a JSON string.
- Syntax:
meshMatchGetLicenseInfo [checkOnline]
- Arguments:
checkOnline
(Optionalboolean
): Determines if an online validation is performed. Iftrue
or omitted, the app will contact the server to validate the license. Iffalse
, it performs a faster, offline-only check of local data.
- Returns (MEL/Python):
- A JSON string with the following keys (based on the
LicenseInfo
struct and itstoJsonString
method):isValid
:true
orfalse
.status
: A string describing the license state (e.g., “Active”, “Expired”, “Unlicensed”).licenseKeyMasked
: The masked license key.instanceId
: The unique ID for the current activation.expirationAt
: The expiration date in YYYY-MM-DD format, or “Perpetual”.renewalAt
: The renewal date in YYYY-MM-DD format.osName
: The name of the operating system (e.g., “Windows”).computerName
: The unique name of the computer instance.customerName
: The name of the license holder.customerEmail
: The email of the license holder.activationLimit
: The total number of seats on the license.activationUsage
: The number of seats currently in use.dialogTitle
: A title for any UI dialog that might need to be shown.statusMessage
: A user-facing message describing the license status.logMessage
: An array of strings containing detailed log messages from the license check.
- A JSON string with the following keys (based on the