Skip to content

Instantly share code, notes, and snippets.

View RedForty's full-sized avatar
😸
Ship it

Daniel Klug RedForty

😸
Ship it
  • California
View GitHub Profile
@chris-lesage
chris-lesage / calculate_pole_vector.py
Last active April 20, 2024 14:07
Autodesk Maya script to calculate pole vector position based on 3 input objects
import pymel.core as pm
'''
An Autodesk Maya PyMEL script that calculates a pole vector position
based on 3 input PyNode objects. example: leg, knee, ankle bones.
Chris Lesage chris@rigmarolestudio.com
'''
def calculate_pole_vector(p1, p2, p3, poleDistance=1):
"""
"""
A simple utility module for moving skinned joints.
"""
import math
import pymel.core as pmc
def reset_bind_matrix(joint):
"""
@Meatplowz
Meatplowz / performFileDropAction.mel
Last active June 28, 2023 14:21
Override the Maya Drag and Drop Behavior for File Open/Import
// Randall Hess randall.hess@gmail.com
// Instructions: Copy this file over your local maya version to override the default behavior
// Maya 2022 and Higher
// Additional: You can also build and load this as a module and not overwrite the local maya file.
// Location: C:\Program Files\Autodesk\MayaXX\scripts\others\performFileDropAction.mel
global proc int
performFileDropAction (string $theFile)
@Nixellion
Nixellion / bro_windows.py
Last active September 10, 2021 09:35
Maya - Creating PySide windows in Maya 2014-2018+, with docking
'''
------------------------------------------------------------------------------------------------------------------------
# Maya 2017 PySide2 Docking Qt QMainWindow by Michael Davydov | https://github.com/Nixellion/
## https://www.michaeldavydov.com | https://www.nixes.ru
------------------------------------------------------------------------------------------------------------------------
This module aims to have functions and classes that you can use to create your own Maya UI, with support of Maya with
PySide and PySide2 (2014-2018+). Primary focus on dockable windows.
Major changes have been made in Maya version 2017, when it moved from Qt4\PySide to Qt5\PySide2.
@liorbenhorin
liorbenhorin / Simple_MayaDockingClass.py
Created December 1, 2017 15:04
Simple way to Docking Qt widgets to Maya 2017+
'''
Template class for docking a Qt widget to maya 2017+.
Author: Lior ben horin
12-1-2017
'''
import weakref
import maya.cmds as cmds
import maya.OpenMayaUI as omui
@vshotarov
vshotarov / shelfBase.py
Last active February 23, 2023 23:49
Maya base class for building custom shelves.
import maya.cmds as mc
def _null(*args):
pass
class _shelf():
'''A simple class to build shelves in maya. Since the build method is empty,
it should be extended by the derived class to build the necessary shelf elements.
@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
@oglops
oglops / test_event_filter.py
Last active October 15, 2017 21:29
install an event filter to main maya window, and only intercept the ctrl+/ key when mouse pointer is on top of script editor
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import maya.cmds as mc
import maya.mel as mel
class CustomFilter(QObject):
def eventFilter(self, obj, event):
# python api2.0 setWeights(),setWeight()
# http://ueta.hateblo.jp/entry/2015/08/24/102937
import time
import maya.api.OpenMaya as OpenMaya2
import maya.api.OpenMayaAnim as OpenMayaAnim2
#_time = time.time
_time = time.clock
@evitolins
evitolins / RRM_utils.py
Last active December 21, 2023 18:45
Maya Python Snippets
'''
This fixes a RRM bug (v1.4.7) where saved RRM setups do not preserve a
module's 'pinned' status.
'''
import maya.cmds as cmds
import maya.mel
def RRM_fixPinBug(objs):
for obj in objs:
trans = cmds.xform(obj,q=True, r=True, translation=True)
maya.mel.eval("RRM_PinProxies(1, 0);")