diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-24 15:37:47 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-05-27 12:00:42 +0300 |
commit | 5dbda33462349a4ac78f08e8ed4ec7922ca7394f (patch) | |
tree | b73b67873cd42dc1a9a927227fd85e9bfb52285e /intern | |
parent | 07d3d8c2fd75d633a7d6ba6aab47308860af676c (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 'intern')
-rw-r--r-- | intern/cycles/blender/blender_util.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h index 972d7296727..69e55d67532 100644 --- a/intern/cycles/blender/blender_util.h +++ b/intern/cycles/blender/blender_util.h @@ -75,11 +75,13 @@ static inline BL::Mesh object_to_mesh(BL::BlendData & /*data*/, * UV are not empty. */ if (mesh.is_editmode() || (mesh.use_auto_smooth() && subdivision_type == Mesh::SUBDIVISION_NONE)) { - mesh = object.to_mesh(); + BL::Depsgraph depsgraph(PointerRNA_NULL); + mesh = object.to_mesh(false, depsgraph); } } else { - mesh = object.to_mesh(); + BL::Depsgraph depsgraph(PointerRNA_NULL); + mesh = object.to_mesh(false, depsgraph); } #if 0 |