Fix T63542: Imported FBX doesn't show keyframes in Shape Key editor.

While shapekeys RNA path handling does support keyblocks (ShapeKeys)
with an `id_data` wrongly set to the geometry instead of the shapkey,
this is really not something to promote. ideally it should be removed at
some point. At least, let's not generate such RNA pointer if we can
avoid it.

Here it was breaking proper showing of animated shapekeys in the UI,
since this expects animated datablocks to have their own animation data
(and 'rooting' keyblocks to their mesh instead of their shapekey ended
up defining their animation in the mesh, not in the shapekey).
This commit is contained in:
Bastien Montagne 2019-05-14 12:23:31 +02:00
parent b50cf33d91
commit b4909632b0
Notes: blender-bot 2023-06-12 00:52:52 +02:00
Referenced by issue #63542, Imported FBX doesn't show keyframes in Shape Key editor
1 changed files with 1 additions and 1 deletions

View File

@ -398,7 +398,7 @@ static PointerRNA rna_Object_shape_key_add(
if ((kb = BKE_object_shapekey_insert(bmain, ob, name, from_mix))) {
PointerRNA keyptr;
RNA_pointer_create((ID *)ob->data, &RNA_ShapeKey, kb, &keyptr);
RNA_pointer_create((ID *)BKE_key_from_object(ob), &RNA_ShapeKey, kb, &keyptr);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
return keyptr;