Skip to content

Instantly share code, notes, and snippets.

View Meatplowz's full-sized avatar

Randall Meatplowz

View GitHub Profile
@Alquimista
Alquimista / bezdraw.py
Created October 9, 2011 20:45 — forked from jl2/bezdraw.py
Draw Bezier curves using Python and PyQt
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import math
from PyQt4 import QtGui, QtCore
def binomial(i, n):
@Kif11
Kif11 / maya-dockable_window.py
Last active October 16, 2023 04:55
PyQt scaffold for creating dockable Maya window
from PySide import QtCore
from PySide import QtGui
from maya.app.general.mayaMixin import MayaQWidgetDockableMixin
class MainWindow(MayaQWidgetDockableMixin, QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent=parent)\
@liorbenhorin
liorbenhorin / MayaDockingClass.py
Last active October 3, 2023 13:01
Maya 2017 PySide2 Docking Qt QMainWindow
"""
This is what you need to do in order to get a qt window to dock next to maya channel box,
In all maya versions, including 2017 with PySide2
"""
__author__ = "liorbenhorin@gmail.com"
import sys
import os
import logging
import xml.etree.ElementTree as xml
@christophercrouzet
christophercrouzet / mayabake.py
Created December 24, 2016 14:03
Quick and dirty prototype of a naive animation bake implementation for Autodesk Maya.
#!/usr/bin/env mayapy
import itertools
import math
import random
import timeit
from maya import cmds, OpenMaya, OpenMayaAnim
@coxevan
coxevan / mobu_evaluate_decorator.py
Last active August 7, 2020 13:26
Gotcha Examples
def toggle_parallel_settings( func ):
def _wrapper( *args, **kwargs ):
# Store the initial values.
evaluate_manager = pyfbsdk.FBEvaluateManager()
p_evaluation = evaluate_manager.ParallelEvaluation
p_pipeline = evaluate_manager.ParallelPipeline
p_deformation = evaluate_manager.ParallelDeformation
# Turn them all off
evaluate_manager.ParallelEvaluation = False
@zewt
zewt / gist:7090ed6aa800109b8019e596280406ac
Created August 19, 2020 06:14
Set joints to bind position
# Public domain
import pymel.core as pm
from pymel import core as pm
from maya.api import OpenMaya as om
def getSkinClusterConnection(node):
for conn in pm.listConnections(node.attr('worldMatrix'), d=True, s=False, p=True, type='skinCluster') or []:
skinCluster = conn.node()
idx = conn.index()
@zewt
zewt / gist:73bd5f83927f3ccf20c32cf0440120a4
Created August 19, 2020 06:14
Reset bind position to joint position
# Public domain
from pymel import core as pm
import re
def resetJointOnCluster(joint, skinClusterPreMatrixPlug):
inverseMatrix = joint.attr('worldInverseMatrix').get()
curMatrix = skinClusterPreMatrixPlug.get()
if curMatrix is not None:
different = any(abs(a-b) > 0.00001 for a, b in zip(inverseMatrix, curMatrix))