Skip to content

Instantly share code, notes, and snippets.

@minimalefforttech
minimalefforttech / pause_maya_pipeline.py
Created November 18, 2024 09:05
using Qt to pause a running pipeline for visual debugging
from PySide2 import QtWidgets, QtCore # or PySide6 for Maya 2025+
import maya.cmds as mc
import maya.mel as mm
def my_super_long_function():
print("Running a long function here")
# Do some initial prep
cube, _ = mc.polyCube()
sphere, _ = mc.polySphere()
cone, _ = mc.polyCone()
@minimalefforttech
minimalefforttech / async_callable.py
Last active March 28, 2024 21:46
A simple example of running code on separate threads
# Copyright (C) 2024 Alex Telford
# http://minimaleffort.tech
# This work is licensed under the Creative Commons Attribution 4.0 International License.
# To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons,
# PO Box 1866, Mountain View, CA 94042, USA.
# Distributed without any warranty or liability, use at your own risk
# This is an example of deffering code using Qt event loops
try:
from PySide6 import QtCore, QtWidgets
@minimalefforttech
minimalefforttech / qt_inspect_under_cursor.py
Created January 18, 2024 10:19
A simple example of using the Qt metaobject data to find more info out about a Qt component
# Copyright (C) 2024 Alex Telford
# http://minimaleffort.tech
# This work is licensed under the Creative Commons Attribution 4.0 International License.
# To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons,
# PO Box 1866, Mountain View, CA 94042, USA.
# Distributed without any warranty or liability, use at your own risk
# This script allows you to click a widget to get information about it's internals in Qt.
# There is so much more you can do with the metaobject system in Qt, but hopefully this gets you started