Overview
MeshInspector includes a built-in Python scripting environment that gives users complete control over the application’s interface and geometry operations.
This means you can automate most manual actions — loading meshes, applying tools, adjusting parameters, and exporting results — without leaving MeshInspector.
The scripting interface uses the same logic as the visual UI. Everything you see on the Ribbon is exposed to Python through a programmatic API tree.
With it, you can replicate or automate any sequence of clicks and tool operations.
The MeshInspector Python API is best suited for:
-
Automation. Running multi-step workflows automatically (for example, batch mesh repair or export).
-
Integration. Linking MeshInspector with other software in a 3D or inspection pipeline.
-
Reproducibility. Ensuring consistent processing across datasets.
Running Python Inside MeshInspector
You do not need to install Python separately — MeshInspector already includes an embedded interpreter and all required libraries.
How to Open the Console
-
Launch MeshInspector Desktop App.
-
Go to the Home tab.
-
Click Python.

A console panel will appear at the bottom of the interface.
From there, you can type commands, run scripts, and see output immediately.
In the console, you can:
-
Enter short commands interactively.
-
Load and execute saved
.pyscripts. -
Save the current session for reuse.
-
Clear the console output.
Example: Testing the Console
print("Hello from MeshInspector!")
This confirms that the embedded Python runtime is active.
Prerequisites and API Environment
All necessary scripting components come prepackaged with MeshInspector Desktop.
You do not need to download or install any external libraries.
Two Main Modules
-
mrviewerpy— Controls the MeshInspector interface.
It allows you to open tabs, run tools, change parameters, and interact with the Ribbon programmatically. -
mrmeshpy— Handles geometry data operations such as loading, saving, and processing mesh objects.
Example imports:
from meshlib import mrviewerpy as mv
from meshlib import mrmeshpy as mm
Core Concept: The Ribbon as a Tree
MeshInspector’s Ribbon interface — with its tabs, groups, and tools — has a tree-like structure that the API mirrors exactly.
Each tab and tool corresponds to a “node” that can be reached by a path (a list of names).
For example:
-
['RibbonTabs']lists all top-level tabs such as Home, View, Mesh Edit, and Mesh Repair. -
['Ribbon']lists all tools available in the currently active tab. -
A tool’s own panel (once opened) has its own parameters, also listed by name.
You can think of scripting as walking through this tree:
Tab → Group → Tool → Parameter
Understanding this hierarchy is the foundation for automating MeshInspector.
In later articles, you’ll learn to:
-
Navigate this structure (
uiListEntries()anduiPressButton()) -
Inspect and change parameters
-
Work with meshes directly
-
Combine MeshInspector’s UI control with MeshLib’s geometry processing
Summary
MeshInspector includes a self-contained scripting environment that exposes its entire UI through Python.
You can use it to automate workflows, perform batch operations, and integrate MeshInspector into larger pipelines — all without installing external dependencies.
You now know:
-
The API is built into the desktop version of MeshInspector.
-
The scripting console is accessed via Home → Python.
-
Two key modules are available by default:
-
mrviewerpy— controls the UI. -
mrmeshpy— handles geometry.
-
-
The API mirrors the structure of the Ribbon interface as a navigable tree.
In the next article — Navigating the API Tree — you will learn how to explore the Ribbon hierarchy programmatically, open tabs and tools, and understand how MeshInspector’s UI is represented inside the API.