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
"""Selects geometry transforms under a current selection""" | |
import maya.cmds as mc | |
# Get all mesh shapes under parent group | |
sel_shapes = mc.ls(selection=True, dagObjects=1, type='mesh') | |
# Get parent transforms from shapes (supports duplicate names, remove "path" if you want to raise an error on dup names) | |
geo_transforms = mc.listRelatives(sel_shapes, parent=True, path=True) |
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 Qt import QtWidgets | |
from Qt import QtCore | |
class FoldersWidget(QtWidgets.QWidget): | |
def __init__(self): | |
super(FoldersWidget, self).__init__() |
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 os | |
import sys | |
from Qt import QtWidgets | |
from Qt import QtCore | |
from Qt import QtGui | |
class FoldersWidget(QtWidgets.QWidget): |
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 | |
from shiboken import wrapInstance | |
import maya.OpenMayaUI as mui | |
def maya_main_window(): | |
ptr = mui.MQtUtil.mainWindow() | |
return wrapInstance( long( ptr ), QtGui.QWidget ) | |
#################################################################### | |
class MyWindow(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
from PySide import QtCore, QtGui | |
from shiboken import wrapInstance | |
import maya.OpenMayaUI as mui | |
mainWin = wrapInstance(long(mui.MQtUtil.mainWindow()), QtGui.QWidget) | |
action = QtGui.QAction(mainWin) | |
action.setShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Tab)) | |
action.setShortcutContext(QtCore.Qt.ApplicationShortcut) |
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 formatted by Mike Bourbeau for Maya PySide from here: http://www.blog.pythonlibrary.org/2013/04/10/pyside-connecting-multiple-widgets-to-the-same-slot/ | |
from PySide import QtCore, QtGui | |
from shiboken import wrapInstance | |
import maya.OpenMayaUI as mui | |
def maya_main_window(): | |
ptr = mui.MQtUtil.mainWindow() | |
return wrapInstance( long( ptr ), QtGui.QWidget ) | |