View list_edit.py
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): |
View read_proto_desc.py
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 |
View flash_text.py
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) |
View enc_dec_test.py
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': """ |
View qlistwidgetitem_click.py
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): |
View modelPanelPyQt4.py
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): |
View file_model_filters.py
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
""" | |
Example of using a proxy model to apply custom | |
filtering to a QFileSystemModel | |
RE: https://groups.google.com/d/topic/python_inside_maya/a2QM_KvgfeI/discussion | |
Justin Israel | |
justinisrael@gmail.com | |
""" | |
from PySide import QtCore, QtGui |
View repeat.py
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
""" | |
Original example reformatted from: | |
http://blog.3dkris.com/2011/08/python-in-maya-how-to-make-commands.html | |
python_inside_maya discussion: | |
https://groups.google.com/d/topic/python_inside_maya/xfuCYBO6aLg/discussion | |
""" | |
import maya.cmds as cmds |
View cache_generics.py
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
''' | |
Cache the generic relation field of all the objects | |
in the queryset, using larger bulk queries ahead of time. | |
Improved from original by Daniel Roseman: | |
http://blog.roseman.org.uk/2010/02/22/django-patterns-part-4-forwards-generic-relations/ | |
''' | |
def cache_generics(queryset): |
View docking_dockables.py
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: |
NewerOlder