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 ayon_core.pipeline import load, get_current_host_name | |
class TestHostSpecificLoad(load.LoaderPlugin): | |
hosts = ["bla"] | |
product_types = {"*"} | |
representations = {"*"} | |
label = "Test Host Specific Load" |
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 typing import Tuple, List | |
from pathlib import Path | |
import os | |
import platform | |
# Get plugin extensions maya can load per platform | |
PLUGIN_EXTENSIONS_BY_PLATFORM = { | |
"windows": {".mll", ".nll.dll"}, | |
"mac": {".bundle"}, | |
"linux": {".so"}, |
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 typing import List, Iterable | |
import itertools | |
import contextlib | |
@contextlib.contextmanager | |
def comp_lock_and_undo_chunk( | |
comp, | |
undo_queue_name="Script CMD", | |
keep_undo=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
"""Fix unlinked/unmanaged loaders in Fusion to get managed by AYON as intended.""" | |
from pathlib import Path | |
from typing import List | |
import time | |
import logging | |
import ayon_api | |
from ayon_core.pipeline import get_current_project_name |
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
# Maya Create rsMeshParameters per node in selection and add node name as suffix label | |
import contextlib | |
from maya import cmds, mel | |
@contextlib.contextmanager | |
def maintained_selection(): | |
previous_selection = cmds.ls(selection=True) | |
try: | |
yield |
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
"""This plug-in will do some heavy logging of all reads and changes to any | |
instance.data or context.data by pyblish plug-ins and will generate a JSON | |
This requires typing-extensions and observatory library and will in the worst | |
possible manner add those to sys.path to make it work. This is a quick hack. | |
Dependencies: | |
observatory: https://github.com/sharpencrag/observatory | |
typing_extensions: https://github.com/python/typing_extensions |
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
# Perform a 'connection' between dag nodes in Maya based on their cbId | |
from typing import Dict | |
from maya import cmds | |
from ayon_maya.api import lib | |
mapping: Dict[str, str] = { | |
# Data mapping is like: | |
"source-id": "target-id", | |
# Example: | |
"ac991b60b4cb11eeb7fc7730318c5a70:c0ce772a9052": "ac991b60b4cb11eeb7fc7730318c5a70:f328201a4e8b" |
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.OpenMayaUI as mui | |
import shiboken2 | |
from PySide2 import QtWidgets | |
# <-- get maya main window QMainWindow --> | |
ptr = mui.MQtUtil.mainWindow() | |
main_window = shiboken2.wrapInstance(int(ptr), QtWidgets.QMainWindow) | |
# <-- set wordWrap on script editor feedback field --> | |
cmdScrollFieldReporter = main_window.findChild(QtWidgets.QPlainTextEdit, "cmdScrollFieldReporter1") |
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 re | |
import logging | |
from typing import List | |
import mayaUsd.lib as mayaUsdLib | |
from pxr import Sdf | |
def log_errors(fn): | |
"""Decorator to log errors on error""" |
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 | |
import difflib | |
import ayon_api | |
amount = 10 | |
for event_ in ayon_api.get_events( | |
topics={"settings.changed"}, | |
# Set more filters if needed | |
# newer_than="isoformat-date", |
NewerOlder