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 maya import cmds | |
def is_camera(node): | |
cond = ( | |
"camera" in [cmds.nodeType(x) for x in (cmds.listRelatives(node, s=True, f=True) or [])], | |
cmds.nodeType(node) == "camera", | |
) | |
return any(cond) | |
cameras = [c for c in cmds.ls(sl=True, l=True) if is_camera(c)] |
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 sys | |
from PySide import QtGui, QtCore | |
from shiboken import wrapInstance | |
from maya import OpenMayaUI | |
class HardReload(QtGui.QDialog): | |
def __init__(self, *args, **kwds): | |
super(HardReload, self).__init__(*args, **kwds) |
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 xml.etree.ElementTree as ET | |
from win32com.client import Dispatch | |
si = Dispatch("XSI.Application") | |
siut = Dispatch("XSI.Utils") | |
def listConnections(obj, conn_type="out"): | |
data = siut.DataRepository.GetConnectionStackInfo(obj) | |
return [c.find("object").text for c in ET.fromstring(data) | |
if c.find("object") is not None and c.find("type").text == conn_type] |
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
var oPSet = ActiveSceneRoot.AddProperty( "CustomProperty", false, "UDIMtools" ) ; | |
oPSet.AddParameter3( "incremento", siInt4, 1, 1, 100, false, false) ; | |
oPSet.AddParameter3( "rotacion", siInt4, 90, 1, 360, false, false) ; | |
var oLayout = oPSet.PPGLayout; | |
//GRUPO TRANSLATE | |
oLayout.AddGroup("Translate UVW"); | |
oLayout.AddRow(); | |
oLayout.AddGroup("", false, 30); oLayout.EndGroup(); //espaciador |
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 pymel.core as pm | |
def toogleVisibility(obj): | |
for s in obj.getShapes(): | |
s.overrideEnabled.set(True) | |
s.overrideVisibility.set(not s.overrideVisibility.get()) | |
for x in pm.ls(selection=True): | |
toogleVisibility(x) |
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 | |
# -*- coding: utf-8 -*- | |
mydict = {"root": {"dir1": {"subdir1": "foo"}, | |
"dir2": {"subdir2": "bar", | |
"subdir3": {"subdir4": {"subdir5": "baz", | |
"subdir6": "foo_again"}}}}} | |
def get_contents(directories): |
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
{ | |
"auto_complete": true, | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme", | |
"draw_white_space": "all", | |
"find_selected_text": true, | |
"fold_buttons": false, | |
"highlight_modified_tabs": true, | |
"folder_exclude_patterns": | |
[ |
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
class ImagePlayer(QWidget): | |
def __init__(self, filename, title, parent=None): | |
QWidget.__init__(self, parent) | |
# Load the file into a QMovie | |
self.movie = QMovie(filename, QByteArray(), self) | |
size = self.movie.scaledSize() | |
self.setGeometry(200, 200, size.width(), size.height()) | |
self.setWindowTitle(title) |
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
@OneUndo | |
def CreateNulls(size=100): | |
return [Application.ActiveSceneRoot.AddNull() | |
for i in range(size)] | |
CreateNulls() |
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 sys | |
def hard_reload(name): | |
for k in sys.modules.keys(): | |
if k.startswith(name): | |
del sys.modules[k] | |
if __name__ == "__main__": | |
for name in sys.argv[1:]: |