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>2017-11-23 18:03:44 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-11-24 12:19:48 +0300
commita5d763a11ee46fff12d53e8cb21b3ab45fa2c64d (patch)
tree075d6fa83432ca1e5b6c56b6773756cd7ea71301 /source/blender/blenkernel/intern
parent0f5ef668daa041514376a98e2957248626e5649d (diff)
Depsgraph: Use depsgraph to handle edit mode selection
This is crucial bit since batch cache is stored in the evaluated object, meaning we can't tag it's hatch cache dirty from the notifier system. Not easily at least. Better to leave this job to depsgraph, it knows all the copies of data.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/object_update.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index 76b72f7a308..8da3e8136b3 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -396,3 +396,25 @@ void BKE_object_eval_update_shading(const EvaluationContext *UNUSED(eval_ctx), O
BKE_mesh_batch_cache_dirty(object->data, BKE_MESH_BATCH_DIRTY_SHADING);
}
}
+
+void BKE_object_data_select_update(const EvaluationContext *UNUSED(eval_ctx),
+ struct ID *object_data)
+{
+ DEBUG_PRINT("%s on %s (%p)\n", __func__, object_data->name, object_data);
+ switch (GS(object_data->name)) {
+ case ID_ME:
+ BKE_mesh_batch_cache_dirty((Mesh *)object_data,
+ BKE_CURVE_BATCH_DIRTY_SELECT);
+ break;
+ case ID_CU:
+ BKE_curve_batch_cache_dirty((Curve *)object_data,
+ BKE_CURVE_BATCH_DIRTY_SELECT);
+ break;
+ case ID_LT:
+ BKE_lattice_batch_cache_dirty((struct Lattice *)object_data,
+ BKE_CURVE_BATCH_DIRTY_SELECT);
+ break;
+ default:
+ break;
+ }
+}