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
#!/usr/bin/env python3 | |
def filter(listInput, **kwargs): | |
''' Searches list of dictionaries for matches to | |
all key value pairs expressed as key='value' ''' | |
sortedList = [] | |
for dictionary in listInput: | |
matches = 0 |
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
#!/usr/bin/python3 | |
import hashlib, sys | |
""" | |
Command line tool to get checksums in python. | |
Supply filepath for file to process, and which hash | |
method to use. | |
""" |
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 | |
with open(filePath, 'r') as fp: | |
j = json.load(fp) | |
print(json.dumps(j, sort_keys=True, indent=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
import maya.cmds as cmds | |
# select all joints _bn | |
cmds.select('root_bn', hierarchy=True) | |
# For each _fk constrain to _bn | |
for bn in cmds.ls(selection=True): | |
try: | |
cmds.orientConstraint( bn.replace('_bn', '_fk'), bn ) | |
cmds.pointConstraint( bn.replace('_bn', '_fk'), bn ) |
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.cmds as cmds | |
def batchUVSnapshot(fp, resolution, fileType): | |
# List all selected items | |
items = cmds.ls( selection = True, long = True ) | |
for item in items: | |
cmds.select( item, replace = True) | |
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 pymel.core as pymel | |
import maya.api.OpenMaya as om | |
def flattenAlongPlane(joints): | |
# Get worldspace position every joint but for first and last, and get their average position | |
vectors = [om.MVector(pymel.joint(x,q=True, p=True, a=True)) for x in joints[1:-1]] | |
avg = om.MPoint([sum(v)/len(vectors) for v in zip(*vectors)]) | |
p1 = om.MPoint(pymel.joint(joints[0], q=True, p=True, a=True)) | |
p2 = om.MPoint(pymel.joint(joints[-1], q=True, p=True, a=True)) |
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 pymel.core as pm | |
import maya.mel as mel | |
# Get current selection | |
selected = pm.selected() | |
mel.eval("ConvertSelectionToUVs") | |
# Unfold, straighten, unfold | |
pm.u3dUnfold(selected, ite = 1, p = 0, bi = 1, tf = 1, ms = 1024, rs = 0) |
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
{ | |
"AVI": 23, | |
"Alias PIX": 6, | |
"Cineon": 11, | |
"DDS": 35, | |
"EPS": 9, | |
"EXR(exr)": 40, | |
"GIF": 0, | |
"JPEG": 8, | |
"MacPaint": 30, |
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 pymel.core as pm | |
def find_bad_shapes(): | |
""" Find and select all shapes which has not inherited their names from their parent transform, | |
such as transformShape. """ | |
shapes = pm.ls(type="shape") | |
output = list() | |
for shape in shapes: | |
if shape.nodeName() != shape.getParent().nodeName()+'Shape': |
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 pymel.core as pm | |
from functools import partial | |
from maya import OpenMayaUI as omui | |
try: | |
from PySide2.QtCore import * | |
from PySide2.QtGui import * | |
from PySide2.QtWidgets import * | |
from shiboken2 import wrapInstance |
OlderNewer