Skip to content

Instantly share code, notes, and snippets.

View chris-lesage's full-sized avatar

Chris Lesage chris-lesage

View GitHub Profile
@chris-lesage
chris-lesage / build_slerp_ramp.py
Last active September 19, 2023 03:26
Fake a multi-output lerp/slerp ramp in Autodesk Maya using remapValue nodes. Useful for twisting or interpolating objects and attributes.
import pymel.core as pm
"""
Take a collection of attributes and interpolate them along a curve.
It uses a master remapValue that drives multiple remapValues
to simulate the effect of a multi-out curve node.
References to "twist", because it was originally written for twisting ribbon IK
But it can interpolate any custom attributes you wish
Written by Chris Lesage, June 2019
@chris-lesage
chris-lesage / removeUnusedInfluences.py
Last active December 19, 2023 18:55
Snippet to removeUnusedInfluences in Autodesk Maya using Python.
import maya.cmds as cmds
'''
# EXAMPLE USAGES:
# Removes all unused influences from skinCluster1
remove_unused_influences('skinCluster1')
# Removes the two specified joints from Body_SkinCluster,
but only if they are not currently weighted to anything.
remove_unused_influences('Body_SkinCluster', ['leg_L0_5_jnt', 'leg_R0_5_jnt'])