<aside> ⚠️ This section contains advanced Pixyz Studio scripting information. Most of the features presented here are tagged as Experimental and are highly unstable.

</aside>

Introduction

Since Studio 2020.1 Pixyz integrates PyQT Python plug-in to let users create their own advanced UI and interactions in addition to the existing plugin system.

# This script must be executed in Studio scripting panel in "Synchronous execution"
from PyQt5.QtWidgets import QWidget

root = QWidget()

root.resize(250, 0)
root.setWindowTitle("Hello world!")
root.show()

Check PyQT documentation to see the extent of all possibilities offered by this module.

Synchronous vs Asynchronous

UI functions calls must be executed on the main thread (synchronous execution). In order to force it, tick the Synchronous Execution checkbox in the Scripting panel:

If the script is executed within a Studio plugin, add the sync="true" key value to the main function declaration in plugin.xml:

...
<function name="main" scriptFile="main.py" sync="true">
...

<aside> ⚠️ Synchronous execution will perform all tasks on the main thread, preventing Pixyz from updating the viewer and the rest of the GUI. In a nutshell, Studio will freeze when executing costly algorithms synchronously (tessellation, decimation...).

</aside>

Core GUI

Some functionalities were added to bind PyQT interfaces to Studio. All the needed functions are part of the CoreGUI module (accessible in the Function List by pressing F12).

Some of them: