View maya_sample_ramp_attribute.py
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 maya.cmds as cmds | |
import maya.api.OpenMaya as om | |
import json | |
def get_ramp_attribute(attr): | |
"""Return MRampAttribute for attribute name.""" | |
sel = om.MSelectionList() | |
sel.add(parm) | |
plug = sel.getPlug(0) |
View maya_get_all_zero_normals.py
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 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) |
View maya_shift_keys_on_export.py
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 | |
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: |
View openpype_substancepainter_python_script_editor_plugin.py
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 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 |
View substance_painter_get_project_export_data.py
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
"""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 | |
""" |
View substance_painter_get_export_maps.py
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 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. | |
View substance_painter_export_dialog_scrape_formats.py
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 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() |
View substancepainter_stylesheet.css
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
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;} |
View maya_print_optionvars.py
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 | |
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", " ") | |
View fusion_python_frame_flowview_to_selected.py
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 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] | |
NewerOlder