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>2019-05-24 15:37:47 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-05-27 12:00:42 +0300
commit5dbda33462349a4ac78f08e8ed4ec7922ca7394f (patch)
treeb73b67873cd42dc1a9a927227fd85e9bfb52285e /source/blender/blenkernel/BKE_object.h
parent07d3d8c2fd75d633a7d6ba6aab47308860af676c (diff)
Depsgraph API: Allow preserving custom data layers
This commit extends dependency graph API with an argument which denotes that all custom data layers are to be preserved. This forces modifier stack re-evaluation with more inclusive mask. Far from ideal, since this might fail in certain configurations with indirectly used objects which might be missing layers needed for the current object evaluation. But this is how it worked for a long time, so should be good enough for until more sophisticated solution is found. In order to use this new behavior two things are to be passed: - Pass keep_all_data_layers=True - Pass a valid dependency graph. The dependency graph is only needed if keep_all_data_layers=True and is NOT to be passed if keep_all_data_layers=False. If keep_all_data_layers=True the dependency graph MUST be passed. Reviewers: mont29, brecht Reviewed By: mont29 Maniphest Tasks: T64994, T64794 Differential Revision: https://developer.blender.org/D4940
Diffstat (limited to 'source/blender/blenkernel/BKE_object.h')
-rw-r--r--source/blender/blenkernel/BKE_object.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index aa4d9696527..df1ac0e4081 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -400,8 +400,16 @@ bool BKE_object_empty_image_data_is_visible_in_view3d(const struct Object *ob,
* The result is owned by the object.
*
* The mesh will be freed when object is re-evaluated or is destroyed. It is possible to force to
- * clear memory sued by this mesh by calling BKE_object_to_mesh_clear(). */
-struct Mesh *BKE_object_to_mesh(struct Object *object);
+ * clear memory sued by this mesh by calling BKE_object_to_mesh_clear().
+ *
+ * If preserve_all_data_layers is truth then the modifier stack is re-evaluated to ensure it
+ * preserves all possible custom data layers.
+ *
+ * NOTE: Dependency graph argument is required when preserve_all_data_layers is truth, and is
+ * ignored otherwise. */
+struct Mesh *BKE_object_to_mesh(struct Depsgraph *depsgraph,
+ struct Object *object,
+ bool preserve_all_data_layers);
void BKE_object_to_mesh_clear(struct Object *object);