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>2018-02-07 16:15:24 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-02-07 16:15:24 +0300
commit56f6938b5e8bad59fa422341b830555ddec466e9 (patch)
treeca5e7c319950ef7f43d9eecf5353291f62b8194f /source/blender/depsgraph/intern/depsgraph_tag.cc
parent84155ab21a53f51b55b395e16301388f47094805 (diff)
Depsgraph: More fixes for shape keys
Made shape keys to work for meshes. Also added missing code for curves. Curves and lattices will not have shape keys visible, since modifiers support is still to be done for them.
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph_tag.cc')
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc55
1 files changed, 49 insertions, 6 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index 851b666a00a..0dc1391d3a6 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -40,12 +40,15 @@
#include "BLI_task.h"
extern "C" {
+#include "DNA_curve_types.h"
+#include "DNA_key_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_mesh_types.h"
#include "DNA_object_types.h"
#include "DNA_particle_types.h"
#include "DNA_screen_types.h"
#include "DNA_windowmanager_types.h"
-
#include "BKE_idcode.h"
#include "BKE_library.h"
#include "BKE_main.h"
@@ -295,11 +298,50 @@ void deg_graph_id_tag_legacy_compat(Main *bmain,
ID *id,
eDepsgraph_Tag tag)
{
- if (tag == DEG_TAG_GEOMETRY && GS(id->name) == ID_OB) {
- Object *object = (Object *)id;
- ID *data_id = (ID *)object->data;
- if (data_id != NULL) {
- DEG_id_tag_update_ex(bmain, data_id, 0);
+ if (tag == DEG_TAG_GEOMETRY || tag == 0) {
+ switch (GS(id->name)) {
+ case ID_OB:
+ {
+ Object *object = (Object *)id;
+ ID *data_id = (ID *)object->data;
+ if (data_id != NULL) {
+ DEG_id_tag_update_ex(bmain, data_id, 0);
+ }
+ break;
+ }
+ /* TODO(sergey): Shape keys are annoying, maybe we should find a
+ * way to chain geometry evaluation to them, so we don't need extra
+ * tagging here.
+ */
+ case ID_ME:
+ {
+ Mesh *mesh = (Mesh *)id;
+ ID *key_id = &mesh->key->id;
+ if (key_id != NULL) {
+ DEG_id_tag_update_ex(bmain, key_id, 0);
+ }
+ break;
+ }
+ case ID_LT:
+ {
+ Lattice *lattice = (Lattice *)id;
+ ID *key_id = &lattice->key->id;
+ if (key_id != NULL) {
+ DEG_id_tag_update_ex(bmain, key_id, 0);
+ }
+ break;
+ }
+ case ID_CU:
+ {
+ Curve *curve = (Curve *)id;
+ ID *key_id = &curve->key->id;
+ if (key_id != NULL) {
+ DEG_id_tag_update_ex(bmain, key_id, 0);
+ }
+ break;
+ }
+ default:
+ break;
}
}
}
@@ -365,6 +407,7 @@ void deg_graph_id_tag_update(Main *bmain, Depsgraph *graph, ID *id, int flag)
if (id_node != NULL) {
id_node->tag_update(graph);
}
+ deg_graph_id_tag_legacy_compat(bmain, id, (eDepsgraph_Tag)0);
}
int current_flag = flag;
while (current_flag != 0) {