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
@robomojo
robomojo / mayaProgressBar.py
Last active June 21, 2019 20:51
maya progress bar
import maya.cmds as mc
import pymel.core as pm
class ProgressBar:
def __init__ (self,title,steps):
#self.step = 0
self.title=title
self.steps = steps
self.progressControls = []
self.progressbar = self.makeProgressBarWindow()
@nitaku
nitaku / README.md
Last active January 15, 2021 18:42
Tablet test (Wacom web plugin)

A simple test for the Wacom web plugin. Docs are here and here. See also a basic test application, a scribble example), and a more advanced demo example.

Wacom tablets are interesting input devices: they provide sub-pixel resolution input (more precise than screen pixels), information about the stylus pressure, proximity data (the pen is sensed even if it does not touch the screen) and device identification (e.g. pen tip vs. eraser tip).

Unfortunately, in order to receive such data from a Web application, a plugin needs to be installed (download from here if you feel lost in the messy Wacom website). You also need a Wacom driver for your tablet, not the one Windows installs automatically (I

@evitolins
evitolins / RRM_utils.py
Last active November 4, 2025 05:02
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);")
# 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
@mottosso
mottosso / object_under_cursor.py
Last active July 11, 2025 23:33
Get object under cursor - Autodesk Maya
"""Illustration of how to retrieve the shape under the mouse cursor
Usage:
Run `start()` to start listening for when the mouse stops and to display a tooltip
Run `stop()` to stop listening
"""
from maya import cmds
from PySide import QtGui, QtCore
@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):
@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
@vshotarov
vshotarov / shelfBase.py
Last active April 5, 2026 01:53
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 / 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
@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.