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 re | |
from maya import cmds | |
import maya.api.OpenMaya as om | |
def nodename(n): | |
return n.rsplit("|", 1)[-1].rsplit(":", 1)[-1] | |
for joint in cmds.ls(type="joint", sl=True): | |
jointname = nodename(joint) |
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
def get_correct_position(tool): | |
"""Get position of a tool that is usable for FlowView positions""" | |
result = tool.SaveSettings() | |
for tool in result["Tools"].values(): | |
pos = tool["ViewInfo"]["Pos"] | |
return pos[1], pos[2] | |
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 maya import cmds | |
STR_VALUE_SINGLE_LINE = True | |
for var in sorted(cmds.optionVar(list=True)): | |
value = cmds.optionVar(query=var) | |
if isinstance(value, str) and STR_VALUE_SINGLE_LINE: | |
value = value.replace("\n", " ") | |
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
QWidget { font-size: 11px; background-color: #333333; color: #cccccc;} | |
QWidget:disabled { color: #666666;} | |
QFrame, QDialog, QWindow { background: #333333;} | |
QFrame { border: none;} | |
QFrame[indentBorder=true] { margin-left: 2px; border-color: transparent; border-style: solid; border-left-width: 2px; padding: 4px 0px 4px 8px;} | |
QToolTip { color: #cccccc; background-color: #333333; padding: 4px; border: 1px solid #666666;} | |
QLabel { background: transparent;} | |
QLabel[messageHovered="true"] { text-decoration: underline;} | |
QLabel[messageType="warning"] { color: #ffb91a;} | |
QLabel[messageType="error"] { color: #ef4e35;} |
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 json | |
from PySide2 import QtCore, QtWidgets | |
import substance_painter.js | |
def scrape_export_presets(): | |
app = QtWidgets.QApplication.instance() | |
# Allow app to catch up | |
app.processEvents() |
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 substance_painter.resource | |
import substance_painter.js | |
import tempfile | |
def get_export_maps(preset, folder=None, format="exr"): | |
"""Return filenames from export preset by filename template. | |
Note: This doesn't return each individual UV tile. | |
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
"""Substance Painter OCIO management | |
Adobe Substance 3D Painter supports OCIO color management using a per project | |
configuration. Output color spaces are defined at the project level | |
More information see: | |
- https://substance3d.adobe.com/documentation/spdoc/color-management-223053233.html # noqa | |
- https://substance3d.adobe.com/documentation/spdoc/color-management-with-opencolorio-225969419.html # noqa | |
""" |
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 PySide2 import QtCore, QtWidgets | |
import substance_painter.ui | |
try: | |
from openpype_modules.python_console_interpreter.window import PythonInterpreterWidget # noqa | |
except ModuleNotFoundError: | |
from openpype.modules.python_console_interpreter.window import PythonInterpreterWidget # noqa | |
WIDGET = None | |
ACTION = None |
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 maya import cmds | |
import contextlib | |
@contextlib.contextmanager | |
def offsetted_keys(offset, nodes=None): | |
if nodes is None: | |
# Apply to all time-based animation curves (excluding driven keys) | |
nodes = cmds.ls(type=("animCurveTL","animCurveTU","animCurveTA","animCurveTT")) | |
try: |
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.api.OpenMaya as om | |
from maya import cmds | |
def get_dag_path(name): | |
"""Return MDagPath from object name""" | |
sel = om.MSelectionList() | |
sel.add(name) | |
return sel.getDagPath(0) |