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 |
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 |
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): |
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
Show hidden characters
// Preferences.sublime-settings | |
{ | |
// ... | |
"auto_complete_triggers": [{"selector": "source.python", "characters": "."}], | |
"auto_complete_selector": "-" | |
} |
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 | |
''' | |
A small script to convert a .cix (codeintel schema) file into | |
a python stub module, for use in auto-completion. | |
https://community.activestate.com/faq/codeintel-cix-schema | |
Requires jinja2 for the output template format | |
''' |
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
def getShellFaces(poly, asString=False): | |
shells = set() | |
faces = set() | |
total = cmds.polyEvaluate(poly, s=True) | |
for f in xrange(cmds.polyEvaluate(poly, f=True)): | |
if len(shells) >= total: | |
break | |
if f in faces: |
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
""" | |
A decorator to wrap Qt slots, in Maya, so that exceptions are reported to Script Editor | |
Ref: https://groups.google.com/d/topic/python_inside_maya/xv7DCiocDZA/discussion | |
justinisrael@gmail.com | |
""" | |
#... | |
import sys |
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/msg/python_inside_maya/1EzNG_i9Xes/Au-18UaXAwAJ | |
Capturing the start and end item/index information in a | |
PySide2 QTreeWidget internal drag and drop | |
""" | |
from __future__ import print_function | |
from PySide2 import QtCore, QtGui, QtWidgets |
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
import asyncore | |
import socket | |
import threading | |
class ChatServer(asyncore.dispatcher): | |
def __init__(self, host, port): | |
asyncore.dispatcher.__init__(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
from functools import partial | |
from subprocess import Popen, PIPE | |
from PyQt4 import QtCore, QtGui | |
## testProgram.sh | |
""" | |
#!/bin/bash |