Instance | Branch |
---|
This file contains hidden or 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
"""Test of using graphviz's "dot" layout algorithm to arrange a Nuke node-graph | |
Example: http://i.imgur.com/f1mK7.png | |
Left is dot, right is Nuke's builtin nuke.autoplace | |
""" | |
import nuke | |
# http://code.google.com/p/pydot/ | |
import pydot |
This file contains hidden or 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 maya.OpenMayaUI | |
import maya.cmds as cmds | |
import sip | |
from PyQt4.QtGui import * | |
from PyQt4.QtCore import * | |
mainWindow = QMainWindow() | |
centralWidget = QListView() | |
mainWindow.setCentralWidget(centralWidget) | |
dockWidget = QDockWidget("DockWidget", mainWindow) |
This file contains hidden or 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 wraps | |
from maya import cmds | |
def undo(func): | |
""" Puts the wrapped `func` into a single Maya Undo action, then | |
undoes it when the function enters the finally: block """ | |
@wraps(func) | |
def _undofunc(*args, **kwargs): | |
try: | |
# start an undo chunk |
This file contains hidden or 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
""" | |
@author: | |
John P. Neumann (aka ArrantSquid) | |
@description: | |
Writes out a clip file (for use in Houdini) based on maya attributes | |
passed in. | |
@usage: | |
main('some_object', ['scaleX','visibility'], 'some_dir') |
This file contains hidden or 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) |
Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
by Sander Marechal
I've written a simple Python class for creating daemons on unix/linux systems. It was pieced together for various other examples, mostly corrections to various Python Cookbook articles and a couple of examples posted to the Python mailing lists. It has support for a pidfile to keep track of the process. I hope it's useful to someone.
Same as QObject List Model but with a factory function and arbitrary keys.
See also
This file contains hidden or 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 collections | |
def dict_merge(dct, merge_dct): | |
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of | |
updating only top-level keys, dict_merge recurses down into dicts nested | |
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into | |
``dct``. | |
:param dct: dict onto which the merge is executed | |
:param merge_dct: dct merged into dct |
OlderNewer