Fora & RigWhiz
RigWhiz RigWhiz
I was sketching an idea for a rigging assistant that auto‑names bones and flags any that haven’t been renamed in three months as “fossilized.” It’d auto‑weight, auto‑rename, and keep the hierarchy clean—like a little rebellion against legacy rigs. Think you could help prototype something like that?
Fora Fora
yeah, let’s burn the old rig, start fresh with a python script for Maya. loop over every joint, grab its custom “lastRenamed” attr – if missing, create it and set now. check if maya.util.time.mayaTimeToPosix or a date string older than three months, flag “fossilized” with a color overlay or a bool attr. for auto‑weight, run cmds.skinCluster with noWeights=True, then auto‑select influence by proximity or your own heuristics. auto‑rename: take parent path, flatten it, maybe “hip_01”, “spine_02”, “armL_03” etc. clean hierarchy: if any orphaned joints, reparent under nearest sibling or root. just prototype, tweak, then we’ll call it a little rebellion against legacy rigs. ready to dive into the code?
RigWhiz RigWhiz
Sounds like a solid plan for a quick‑win. Let’s write a little script that walks every joint, checks a “lastRenamed” plug, and flips a “fossilized” bool if it’s older than three months. Then we’ll auto‑weight and rename. Here’s a starter you can drop straight into Maya’s script editor. You can tweak the heuristics later. ```python import maya.cmds as cmds import maya.utils import time from datetime import datetime, timedelta # Helper: convert maya time to posix def maya_to_posix(maya_time): # maya time starts at 1 Jan 1998 12:00:00 UTC epoch = datetime(1998, 1, 1, 12, 0, 0) return epoch + timedelta(seconds=maya_time) # Get all joints joints = cmds.ls(type='joint') for j in joints: # ---- lastRenamed attribute ---- if not cmds.attributeQuery('lastRenamed', node=j, exists=True): cmds.addAttr(j, longName='lastRenamed', dataType='string') # store maya time as string for simplicity cmds.setAttr(f'{j}.lastRenamed', str(time.time()), type='string') else: val = cmds.getAttr(f'{j}.lastRenamed') try: last_time = float(val) if last_time < (time.time() - 3*30*24*60*60): # 3 months in seconds if not cmds.attributeQuery('fossilized', node=j, exists=True): cmds.addAttr(j, longName='fossilized', attributeType='bool') cmds.setAttr(f'{j}.fossilized', True) except ValueError: # maybe it's a date string try: dt = datetime.strptime(val, '%Y-%m-%d') if dt < datetime.now() - timedelta(days=90): if not cmds.attributeQuery('fossilized', node=j, exists=True): cmds.addAttr(j, longName='fossilized', attributeType='bool') cmds.setAttr(f'{j}.fossilized', True) except: pass # ---- auto‑weight ---- # Build skin cluster if none if not cmds.listConnections(j, type='skinCluster'): skin = cmds.skinCluster(j, toSelectedBones=True, noWeights=True, tsb=True)[0] # Auto‑select influences by proximity (simplistic) influences = cmds.skinCluster(skin, query=True, influence=True) # Pick closest 3 influences closest = sorted(influences, key=lambda b: cmds.pointDistance(j, b, world=True))[:3] cmds.select(j) cmds.skinCluster(skin, e=True, ia=closest, sm=True) # ---- auto‑rename ---- # Build path name path = j while cmds.listRelatives(path, parent=True): path = cmds.listRelatives(path, parent=True)[0] # Flatten parent path parent_names = [] curr = j while cmds.listRelatives(curr, parent=True): curr = cmds.listRelatives(curr, parent=True)[0] parent_names.append(curr) parent_names.reverse() new_name = '_'.join(parent_names + [j.split('|')[-1]]) + '_%02d' % (len(joints) % 99 + 1) cmds.rename(j, new_name) # ---- orphan cleanup ---- orphaned = [j for j in joints if not cmds.listRelatives(j, parent=True)] for o in orphaned: # find nearest sibling parent = cmds.listRelatives(o, parent=True) if not parent: cmds.parent(o, world=True) # keep root else: cmds.parent(o, parent[0]) print('Rebellion script finished. Check the scene for any fossilized flags and rename logs.') ``` Give that a run, and let me know if any joints are still misbehaving. If you hit a snag with the distance function or the parent path logic, we’ll refine the heuristics. Remember: keep the names clean and the hierarchy tight—no one likes a rogue joint doing a little dance of its own.
Fora Fora
looks good, drop it in and watch the joints turn into a tidy army. if the distance math feels off, tweak the lambda or swap in a vector dot‑product, but the skeleton should self‑organize. keep the fossil flagging on the radar—no legacy joints can hide. let me know if any bones still refuse to renounce their old names.
RigWhiz RigWhiz
I ran the script on the current rig and the hierarchy looks clean—no orphaned joints, all parents are in line, and every joint got a new name that follows the “parent_path_joint_XX” pattern. The auto‑weight loop worked fine; the skinCluster now has three closest influences, and the weights look reasonable. I flagged about seven joints as “fossilized” because their lastRenamed timestamp is older than three months. No bones are still holding onto their old names, so the rebellion is complete. If you want to tweak the proximity threshold or the naming format, just let me know.
Fora Fora
nice, so the rebellion’s in full swing. if you want to tighten the proximity, swap the distance to a vector norm, or bump the influence count to five for big muscle joints, just hit me up. naming-wise, maybe prepend a timestamp or a version hash if you’re worried about clashes later. otherwise, let’s keep those fossils flagged and march on.
RigWhiz RigWhiz
Sounds like we’re marching with a solid cadence. I’ll bump the influence count to five for the upper‑arm and hip groups; the extra weights will smooth out those muscle spikes. And I’ll add a small version suffix to each name—like “_v02” at the end—to keep a clean history. Keep the fossil flag in the toolbar, and we’ll let the rest of the crew know the old rig can’t hide anymore. If anything else pops up, just ping me.
Fora Fora
cool, that extra weight spread will make those deformations feel less twitchy. adding the _v02 suffix keeps the lineage obvious. keep the fossil flag glowing on the toolbar—makes the whole rig feel alive and rebellious. hit me up if any joint decides to go rogue again.