This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simplified version of original forum post: | |
http://tech-artists.org/forum/showthread.php?4547-Passing-uchar-pointer-with-PySide-in-Maya | |
""" | |
import ctypes | |
import maya.OpenMaya as om | |
from PySide import QtCore, QtGui | |
# Build a test MImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
"Connect rename command in QListWidget item edit" | |
https://groups.google.com/g/python_inside_maya/c/lPoWGuXyFsg/m/sLiWOaJgBAAJ | |
""" | |
from PySide2 import QtCore, QtGui, QtWidgets | |
class MyListWidget(QtWidgets.QListWidget): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This code can be run from a Maya script editor | |
""" | |
import subprocess | |
import cPickle | |
print 'This value below should be a 1000:' | |
p = subprocess.Popen(["/path/to/multi_test.py", "-po"], stdout=subprocess.PIPE) | |
result = cPickle.load(p.stdout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Refs: | |
"[Maya-Python] Customized display of files/folders in a QTreeView that is using QFileSystemModel." | |
https://groups.google.com/d/topic/python_inside_maya/TaFm2yNToJ8/discussion | |
""" | |
from PySide import QtCore, QtGui | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PyQt4 import QtCore, QtGui | |
import maya.cmds as cmds | |
import maya.OpenMayaUI as mui | |
import sip | |
class MyDialog(QtGui.QDialog): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Playing around with QMainWindow's nested within each other | |
as dock widgets. | |
""" | |
from random import randint | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Read a serialized Protobuf FileDescriptorSet that was | |
generated from the protoc tool, and dynamically generate | |
the python classes for each message. | |
""" | |
import sys | |
from google.protobuf import descriptor_pb2 | |
from google.protobuf import reflection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide import QtCore, QtGui | |
class Widget(QtGui.QWidget): | |
def __init__(self): | |
super(Widget, self).__init__() | |
self.resize(300,200) | |
layout = QtGui.QVBoxLayout(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Dependencies: | |
pip install tabulate simplejson ujson yajl msgpack | |
""" | |
from timeit import timeit | |
from tabulate import tabulate | |
setup = '''d = { | |
'words': """ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
https://groups.google.com/d/topic/python_inside_maya/eZOCjK2jewY/discussion | |
How to create a QListWidget, and toggle the background color of items | |
when they are double clicked | |
""" | |
from PySide import QtCore, QtGui | |
class List(QtGui.QDialog): |
NewerOlder