View openpype_show_context_data_loader.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 openpype.pipeline import load | |
from openpype.style import load_stylesheet | |
class ShowContextData(load.LoaderPlugin): | |
"""Debug context data of representation""" | |
families = ["*"] |
View maya_spaghetti_code_set_numbered_aliases.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 math; import itertools as i; from itertools import chain as j | |
import maya.cmds as __ | |
__._ = lambda _: chr(int(math.sqrt(_)+140//3)) | |
__.__ = __.setAttr, __.listAttr, __.ls, __.aliasAttr | |
__._._ = 2601, 4900, 4900, 4624, 3481, 2704, 5041, 4900, 3025, 361, 3844, 3481, 2601, 4761 | |
___ = __.__[2](dag=1) | |
____ = list({k: 0 for k in (__.__[1](___))}) | |
____ = tuple(j.from_iterable(zip(i.count(), ____))) | |
_ = lambda _______: __.__[0](f"{_______}.aal", ____, type=''.join(map(__._, __._._))) | |
_.__ = lambda ______________: __.__[-1]("eispoo", f"{______________}.{__.__[1](______________, scalar=1)[0]}") |
View hou_set_node_thumbnail.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 hou | |
import contextlib | |
@contextlib.contextmanager | |
def editor_at_node(node, pane_tab_type=hou.paneTabType.NetworkEditor): | |
editor = hou.ui.paneTabOfType(pane_tab_type) | |
original_pwd = editor.pwd() | |
try: |
View usd_list_layer_edits_editor.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, QtGui | |
from pxr import Usd, Tf, Sdf | |
# See: https://github.com/PixarAnimationStudios/OpenUSD/blob/release/pxr/usd/sdf/fileIO_Common.cpp#L879-L892 | |
SPECIFIER_LABEL = { | |
Sdf.SpecifierDef: "def", | |
Sdf.SpecifierOver: "over", | |
Sdf.SpecifierClass: "abstract" | |
} |
View maya_query_holes_mesh.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 has_boundaries(mesh): | |
sel = om.MSelectionList() | |
sel.add(mesh) | |
dag = sel.getDagPath(0) | |
it = om.MItMeshEdge(dag) | |
while not it.isDone(): |
View fusion_save_active_view_image.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 itertools | |
def iter_viewers(comp): | |
"""Iterate GLPreview views for Composition. | |
It prefers the active view first, then yields views | |
from the current frame (active window), then from the comp, | |
then from floating views last. | |
View openpype_list_workfiles_published_from.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
# Return all source workfile paths in a workfile folder that were involved in a publish | |
import re | |
from openpype.pipeline import legacy_io, Anatomy | |
from openpype.pipeline.context_tools import get_current_project_name | |
project_name = get_current_project_name() | |
anatomy = Anatomy(project_name) | |
folder = r"path/to/workfiles/folder | |
success, folder = anatomy.find_root_template_from_path(folder) | |
files_in_folder_query = re.escape(folder) + "/[^/]+" |
View maya_optimize_passthrough_connections.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 | |
from collections import defaultdict | |
import contextlib | |
@contextlib.contextmanager | |
def unlocked(plug): | |
"""Unlock attribute during the context""" | |
locked = cmds.getAttr(plug, lock=True) | |
if locked: |
View delete_list_of_components_on_selection.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
# Delete all components in the `components` list from the selected nodes | |
from maya import cmds | |
components = [ | |
".f[4096]", | |
".f[3005:3055"], | |
# etc. | |
] |
View openpype_query_representation_from_filepath.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 openpype.pipeline import legacy_io, Anatomy | |
path = r"/path/to/representation/file.abc" | |
anatomy = Anatomy() | |
success, rootless_path = anatomy.find_root_template_from_path(path) | |
assert success | |
for result in legacy_io.find({"files.path": rootless_path, "type": "representation"}): | |
print(result) |
NewerOlder