Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/makesrna/intern/rna_key.c')
-rw-r--r--source/blender/makesrna/intern/rna_key.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c
index fe62df57eed..b462729657c 100644
--- a/source/blender/makesrna/intern/rna_key.c
+++ b/source/blender/makesrna/intern/rna_key.c
@@ -48,10 +48,12 @@
#include <stddef.h>
+#include "DNA_cache_library_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_animsys.h"
+#include "BKE_cache_library.h"
#include "BKE_depsgraph.h"
#include "BKE_key.h"
#include "BKE_main.h"
@@ -90,7 +92,7 @@ static void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
}
/* fix all the animation data which may link to this */
- BKE_all_animdata_fix_paths_rename(NULL, "key_blocks", oldname, kb->name);
+ BKE_animdata_fix_paths_rename_all(NULL, "key_blocks", oldname, kb->name);
}
static float rna_ShapeKey_frame_get(PointerRNA *ptr)
@@ -304,7 +306,7 @@ static void rna_ShapeKey_data_begin(CollectionPropertyIterator *iter, PointerRNA
Nurb *nu;
int tot = kb->totelem, size = key->elemsize;
- if (key->from_extra.type == KEY_OWNER_CURVE) {
+ if (key->from && key->fromtype == KEY_OWNER_CURVE) {
cu = (Curve *)key->from;
nu = cu->nurb.first;
@@ -325,7 +327,7 @@ static int rna_ShapeKey_data_length(PointerRNA *ptr)
Nurb *nu;
int tot = kb->totelem;
- if (key->from_extra.type == KEY_OWNER_CURVE) {
+ if (key->from && key->fromtype == KEY_OWNER_CURVE) {
cu = (Curve *)key->from;
nu = cu->nurb.first;
@@ -343,7 +345,7 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter)
Curve *cu;
Nurb *nu;
- if (key->from_extra.type == KEY_OWNER_CURVE) {
+ if (key->from && key->fromtype == KEY_OWNER_CURVE) {
cu = (Curve *)key->from;
nu = cu->nurb.first;
@@ -376,8 +378,9 @@ static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *p
{
Key *key = ptr->id.data;
Object *ob;
+ CacheLibrary *cachelib;
- switch (key->from_extra.type) {
+ switch (key->fromtype) {
case KEY_OWNER_MESH:
case KEY_OWNER_CURVE:
case KEY_OWNER_LATTICE:
@@ -401,6 +404,13 @@ static void rna_Key_update_data(Main *bmain, Scene *UNUSED(scene), PointerRNA *p
}
break;
}
+
+ for (cachelib = bmain->cache_library.first; cachelib; cachelib = cachelib->id.next) {
+ if (BKE_cache_library_uses_key(cachelib, key)) {
+ DAG_id_tag_update(&cachelib->id, OB_RECALC_DATA);
+ WM_main_add_notifier(NC_WINDOW, NULL);
+ }
+ }
}
static KeyBlock *rna_ShapeKeyData_find_keyblock(Key *key, float *point)