Skip to content

Instantly share code, notes, and snippets.

View BigRoy's full-sized avatar

Roy Nieterau BigRoy

View GitHub Profile
BigRoy /
Created November 19, 2023 22:59
Get all registered prim types to create by a nice plug-in grouping
from pxr import Usd, Plug, Tf
from collections import defaultdict
"usdGeom": "Geometry",
"usdLux": "Lighting",
"mayaUsd_Schemas": "Maya Reference",
"usdMedia": "Media",
"usdRender": "Render",
"usdRi": "RenderMan",
BigRoy /
Last active November 16, 2023 11:52
USD API move prim spec including repathing relationships and connections to it and its children in a single Sdf Layer
from pxr import Sdf, Usd
LIST_ATTRS = ['addedItems', 'appendedItems', 'deletedItems', 'explicitItems',
'orderedItems', 'prependedItems']
def repath_properties(layer, old_path, new_path):
"""Re-path property relationship targets and attribute connections.
This will replace any relationship or connections from old path
mcoliver /
Created January 18, 2023 01:33
migrate cinesync v4 to v5
import uuid
import time
from selenium import webdriver
from import By
# Download cinesync v4 list by saving the html at
# cat cineSync.html | grep c-callout__heading | grep -o -P '(?<=\>).*(?=\<)' | sort | uniq | grep '@' > useraccounts.txt
# Run this script once and sign in to set your cinesync login credentials
# send an email to the list to have them reset their password @
BigRoy /
Last active October 18, 2022 18:19
Pyblish debug stepper - pauses between each plug-in process and shows the Context + Instances with their data at that point in time
import pprint
import inspect
import html
import copy
import pyblish.api
from Qt import QtWidgets, QtCore, QtGui
TAB = 4* "&nbsp;"
zachlewis /
Last active February 14, 2022 03:25
alternate python rez package
name = "python"
version = "3.8.6"
authors = [
"Guido van Rossum"
description = \
BigRoy /
Last active June 20, 2021 13:04
Example API for linking CG-Wire with Avalon with Qtazu
Muream /
Last active December 4, 2023 23:25
This script bakes the transformation of a node to its offset parent matrix which then acts as its rest matrix. Only works with maya 2020 and up.
import maya.api.OpenMaya as om
import maya.cmds as cmds
TRANSFORM_NODETYPES = ["transform", "joint"]
def has_non_default_locked_attributes(node):
locked_attributes = []
for attribute in ["translate", "rotate", "scale", "jointOrient"]:
default_value = 1 if attribute == "scale" else 0
for axis in "XYZ":
tokejepsen /
Last active November 24, 2020 08:48
import subprocess
import sys
import os
import json
import shutil
import requests
import opentimelineio as otio
davidlatwe /
Created September 1, 2019 10:17
Maya scene modification aware via Pyblish
"""Implement scene modification awareness
By tracking Maya's undo queue, if there are any undo command that is not
a simple select after collecting completed, consider this scene has been
modified and require to reset Pyblish.
import collections
tbttfox /
Last active September 15, 2023 09:00
Blazing fast maya api types to Numpy conversion
from maya import OpenMaya as om
import numpy as np
from ctypes import c_float, c_double, c_int, c_uint
om.MPointArray: (float, 4, c_double, om.MScriptUtil.asDouble4Ptr),
om.MFloatPointArray: (float, 4, c_float , om.MScriptUtil.asFloat4Ptr),
om.MVectorArray: (float, 3, c_double, om.MScriptUtil.asDouble3Ptr),
om.MFloatVectorArray: (float, 3, c_float , om.MScriptUtil.asFloat3Ptr),
om.MDoubleArray: (float, 1, c_double, om.MScriptUtil.asDoublePtr),