diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-18 15:55:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-04-18 16:06:41 +0300 |
commit | 1129fd1c51e59d63e2f9a9b31cd2e873fef17b37 (patch) | |
tree | 039f8879a8e4e50aa038a09dc4c02165aab51460 /source/blender/blenkernel/intern/DerivedMesh.c | |
parent | 363ea3a1ce6e6288d390a7217b736f0ddf93265f (diff) |
Use better workaround ofr getting scene layer for Derivedmesh's mask
This replaces access to the first scene layer (which was wrong) with a linear
lookup of scene layer by it's active index.
This seems to be a better temporary solution to have things working for until
we've got proper workspace, depsgraph and it's per-layer storage in place.
Diffstat (limited to 'source/blender/blenkernel/intern/DerivedMesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 40c16f5fbff..454c1586ef3 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -54,6 +54,7 @@ #include "BKE_cdderivedmesh.h" #include "BKE_editmesh.h" #include "BKE_key.h" +#include "BKE_layer.h" #include "BKE_library.h" #include "BKE_material.h" #include "BKE_modifier.h" @@ -2677,7 +2678,8 @@ static void editbmesh_build_data(Scene *scene, Object *obedit, BMEditMesh *em, C static CustomDataMask object_get_datamask(const Scene *scene, Object *ob, bool *r_need_mapping) { - SceneLayer *sl = scene->render_layers.first; /* XXX TODO pass SceneLayer to this function */ + /* TODO(sergey): Avoid this linear list lookup. */ + SceneLayer *sl = BKE_scene_layer_context_active(scene); Object *actob = sl->basact ? sl->basact->object : NULL; CustomDataMask mask = ob->customdata_mask; |