diff --git a/picker.py b/picker.py index f6168e4..02cd75d 100644 --- a/picker.py +++ b/picker.py @@ -372,12 +372,16 @@ class Picker: ) elif s['type'] == 'BONE': + bone = rig.pose.bones.get(s['bone']) + if not bone: + print(f'Bone {s["bone"]} not exist') + continue shape = BoneShape( self, points=s['points'], polygons=s['polygons'], edges=s['edges'], - bone=rig.pose.bones.get(s['bone']), + bone=bone, color=s['color'] ) @@ -527,7 +531,8 @@ def draw_callback_view(): return if ob not in PICKERS: - picker_path = Path(bpy.path.abspath(ob.data.rig_picker.source)) + picker_path = Path(bpy.path.abspath(ob.data.rig_picker.source, library=ob.data.library)) + print('Load picker from', picker_path.resolve()) picker_datas = json.loads(picker_path.read_text()) #shapes = [s.to_dict() for s in ob.data.rig_picker['shapes']] PICKERS[ob] = Picker(ob, shapes=picker_datas)