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
@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
# 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 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);")
@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

@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()