Controlling MXW through Python

From MXWendler Wiki
Revision as of 14:17, 8 August 2026 by Admin (talk | contribs) (de-duplicate: turn into overview/hub linking the command, imgui and plugin reference pages)
Jump to navigation Jump to search


MXWendler StageDesigner embeds Python 3.12. Python is used in two ways:

  • Command interface / scripting – the module mxw controls the running software (playlist, layers, clips, media, I/O, widgets by their address, ...) from the script console or from within a plugin.
  • Plugins – self-contained folders that add a media source or a playlist item and are called back by the host through a defined set of functions (hooks).

The presented Python interface is supported in version 7.2. and up

Where to go

The detailed documentation lives on three dedicated pages; this page only points to them so nothing is documented twice.

Topic Page
The mxw command interface – software info, playlist, io, widget(address), media(name), preload(n), grabber(name) Python command reference
Drawing plugin settings panels with mxw_imgui (MXWendler's Dear ImGui binding) Python ImGui reference
Writing plugins – media and playlist – the manifest (mxw_plugin.ini), the hooks, per-instance state, examples Python plugin reference

Quick start

A minimal look at each entry point; follow the links above for the full reference.

Scripting. From the script console (or any hook), the mxw module reaches the software:

import mxw
mxw.print_console("frame " + str(mxw.framecounter))
mxw.playlist.play()
mxw.widget("/mxw/track/active/layer/active/opacity").setValue(0.5)

Plugins. A plugin is a folder holding a manifest and a Python module:

plugins/playlist/python/plugin_my_item/
    mxw_plugin.ini      the manifest: identity, menu entries
    mxw_main.py         the Python module with the hook functions

The host discovers it at startup, shows it in the user interface and calls its hooks at the right moments. See the Python plugin reference for the manifest fields, the full hook list for media and playlist plugins, plugin locations, installing extra packages with mxw-pip, and complete examples.

See also