def picked(s, mesh, ID): """ clicked on a mesh """ try: s.drag_joint = None # Clear last joint colour.paint(s.cache_all) # Clear canvas if mesh: # Did we select anything? joint = s.cache_weights[mesh][ID] # Selected joint canvas = s.cache_influence[joint] s.canvas.paint(canvas, YELLOW) s.make_selection(joint) # Select the joint except KeyError: print "Joint missing from cache."
def drag_highlight(s, obj, face_id): """ highlight meshes """ if obj: string_name = om.MFnDagNode(obj).fullPathName() node = pmc.PyNode(string_name) # Convert to pymel again, boo! try: joint = s.cache_pref[node][face_id] influence = s.cache_inf[joint] colour.paint(influence, YELLOW) pmc.refresh() except KeyError as e: print "Missing node", e
def activate_rig(s): """ turn on our rig """ if s.making_selection: return colour.paint(s.cache_all) # Paint everything grey
def rig_build(s): """ build up rig """ running = True for w in s.whitelist: colour.paint(w)