fix non existing bone
parent
2d16d82c99
commit
89941a9d30
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue