Controlling MXW through Python: Difference between revisions
No edit summary |
m Admin moved page 1. Controlling MXW through Python to Controlling MXW through Python: Remove leading index prefix from title |
||
| (20 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Python | <!-- MXWendler wiki page: Controlling MXW through Python (overview / hub) --> | ||
<!-- Intended location: https://wiki.mxwendler.net/index.php?title=1._Controlling_MXW_through_Python --> | |||
<!-- See also: https://wiki.mxwendler.net/index.php?title=Python_command_reference --> | |||
<!-- See also: https://wiki.mxwendler.net/index.php?title=Python_imgui_reference --> | |||
<!-- See also: https://wiki.mxwendler.net/index.php?title=Python_plugin_reference --> | |||
MXWendler StageDesigner embeds '''Python 3.12'''. Python is used in two ways: | |||
* ''' | * '''Command interface / scripting''' – the module <code>mxw</code> 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 | The detailed documentation lives on three dedicated pages; this page only points to them so nothing is documented twice. | ||
{| class="wikitable" | |||
{| class="wikitable" | |||
|- | |- | ||
! Topic !! Page | |||
|- | |- | ||
| | | The <code>mxw</code> command interface – software info, <code>playlist</code>, <code>io</code>, <code>widget(address)</code>, <code>media(name)</code>, <code>preload(n)</code>, <code>grabber(name)</code> || [[Python command reference|Python command reference]] | ||
|- | |- | ||
| | | Drawing plugin settings panels with <code>mxw_imgui</code> (MXWendler's Dear ImGui binding) || [[Python imgui reference|Python ImGui reference]] | ||
|- | |- | ||
| | | Writing '''plugins''' – media and playlist – the manifest (<code>mxw_plugin.ini</code>), the hooks, per-instance state, examples || [[Python plugin reference|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 <code>mxw</code> module reaches the software: | |||
<syntaxhighlight lang="Python" line> | <syntaxhighlight lang="Python" line> | ||
import | import mxw | ||
mxw.print_console("frame " + str(mxw.framecounter)) | |||
mxw.playlist.play() | |||
mxw.widget("/mxw/track/active/layer/active/opacity").setValue(0.5) | |||
</syntaxhighlight> | |||
'''Plugins.''' A plugin is a folder holding a manifest and a Python module: | |||
<pre> | |||
plugins/playlist/python/plugin_my_item/ | |||
mxw_plugin.ini the manifest: identity, menu entries | |||
mxw_main.py the Python module with the hook functions | |||
</pre> | |||
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|Python plugin reference]] for the manifest fields, the full hook list for media and playlist plugins, plugin locations, installing extra packages with <code>mxw-pip</code>, and complete examples. | |||
== See also == | |||
* [[Python command reference|Python command reference]] – the <code>mxw</code> module | |||
* [[Python imgui reference|Python ImGui reference]] – drawing plugin panels with <code>mxw_imgui</code> | |||
* [[Python plugin reference|Python plugin reference]] – writing media and playlist plugins | |||
Latest revision as of 20:58, 8 August 2026
MXWendler StageDesigner embeds Python 3.12. Python is used in two ways:
- Command interface / scripting – the module
mxwcontrols 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
- Python command reference – the
mxwmodule - Python ImGui reference – drawing plugin panels with
mxw_imgui - Python plugin reference – writing media and playlist plugins