Skip to content

Instantly share code, notes, and snippets.

View LostRedRaven's full-sized avatar
💀

LostRedRaven

💀
View GitHub Profile
@Muream
Muream / bake_to_opm.py
Last active April 16, 2025 04:50
This script bakes the transformation of a node to its offset parent matrix which then acts as its rest matrix. Only works with maya 2020 and up.
import maya.api.OpenMaya as om
import maya.cmds as cmds
TRANSFORM_NODETYPES = ["transform", "joint"]
def has_non_default_locked_attributes(node):
locked_attributes = []
for attribute in ["translate", "rotate", "scale", "jointOrient"]:
default_value = 1 if attribute == "scale" else 0
for axis in "XYZ":