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:
authorSergey Sharybin <sergey.vfx@gmail.com>2020-01-13 14:03:01 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2020-01-13 14:03:01 +0300
commit3c1115ef7fe7cd5b26e457b6c676f845ec63544f (patch)
tree0fbcc60089347359302de263f2513c0764b3136c /source/blender/depsgraph
parent9d254fa17aca7f45a297e8fa289c5423030144d6 (diff)
Depsgraph: Fix wrong access to animated properties
Copy-on-write backuyp was trying to read float from an array property, which is wrong. This is part of T73029.
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc22
-rw-r--r--source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h3
2 files changed, 11 insertions, 14 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc
index 0a6f0641fcf..ec3ab6edc17 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc
@@ -59,11 +59,8 @@ void animated_property_store_cb(ID *id, FCurve *fcurve, void *data_v)
/* Resolve path to the property. */
PathResolvedRNA resolved_rna;
- if (!RNA_path_resolve_property_full(&data->id_pointer_rna,
- fcurve->rna_path,
- &resolved_rna.ptr,
- &resolved_rna.prop,
- &resolved_rna.prop_index)) {
+ if (!BKE_animsys_store_rna_setting(
+ &data->id_pointer_rna, fcurve->rna_path, fcurve->array_index, &resolved_rna)) {
return;
}
@@ -73,7 +70,7 @@ void animated_property_store_cb(ID *id, FCurve *fcurve, void *data_v)
return;
}
- data->backup->values_backup.emplace_back(fcurve->rna_path, value);
+ data->backup->values_backup.emplace_back(fcurve->rna_path, fcurve->array_index, value);
}
} // namespace
@@ -82,8 +79,8 @@ AnimationValueBackup::AnimationValueBackup()
{
}
-AnimationValueBackup::AnimationValueBackup(const string &rna_path, float value)
- : rna_path(rna_path), value(value)
+AnimationValueBackup::AnimationValueBackup(const string &rna_path, int array_index, float value)
+ : rna_path(rna_path), array_index(array_index), value(value)
{
}
@@ -121,11 +118,10 @@ void AnimationBackup::restore_to_id(ID *id)
* changed after copy-on-write.
*/
PathResolvedRNA resolved_rna;
- if (!RNA_path_resolve_property_full(&id_pointer_rna,
- value_backup.rna_path.c_str(),
- &resolved_rna.ptr,
- &resolved_rna.prop,
- &resolved_rna.prop_index)) {
+ if (!BKE_animsys_store_rna_setting(&id_pointer_rna,
+ value_backup.rna_path.c_str(),
+ value_backup.array_index,
+ &resolved_rna)) {
return;
}
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h
index 8c111107f36..d97ee2b0556 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h
+++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.h
@@ -34,7 +34,7 @@ struct Depsgraph;
class AnimationValueBackup {
public:
AnimationValueBackup();
- AnimationValueBackup(const string &rna_path, float value);
+ AnimationValueBackup(const string &rna_path, int array_index, float value);
~AnimationValueBackup();
AnimationValueBackup(const AnimationValueBackup &other) = default;
@@ -44,6 +44,7 @@ class AnimationValueBackup {
AnimationValueBackup &operator=(AnimationValueBackup &&other) = default;
string rna_path;
+ int array_index;
float value;
};