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:
authorBastien Montagne <montagne29@wanadoo.fr>2019-03-08 13:45:00 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-03-08 19:53:31 +0300
commitcdba2bc0fce86e814aaa5a969a018b5c1c9f8b3b (patch)
tree9c14874fd4e5b208bd80a269cf9a5c413cb1ff08 /source/blender/blenkernel/intern/mesh_remap.c
parent2a40c6ee2bba46b4e4475c45c2d2332cb417a541 (diff)
BKE mesh remap: add utils to add needed cddata mask for source mesh.
In some cases (currently, only when using avanced mapping of loops), code needs access to some cddata of the source mesh (CD_NORMAL...). We need a way to inform calling code about that (actual issue requiring this change is fixed in next commit).
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_remap.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_remap.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh_remap.c b/source/blender/blenkernel/intern/mesh_remap.c
index ccb6265b17a..55e8a96fa16 100644
--- a/source/blender/blenkernel/intern/mesh_remap.c
+++ b/source/blender/blenkernel/intern/mesh_remap.c
@@ -303,6 +303,22 @@ void BKE_mesh_remap_find_best_match_from_mesh(
/** \name Mesh to mesh mapping
* \{ */
+void BKE_mesh_remap_calc_source_cddata_masks_from_map_modes(
+ const int UNUSED(vert_mode), const int UNUSED(edge_mode), const int loop_mode, const int UNUSED(poly_mode),
+ CustomData_MeshMasks *cddata_mask)
+{
+ /* vert, edge and poly mapping modes never need extra cddata from source object. */
+ const bool need_lnors_src = (loop_mode & MREMAP_USE_LOOP) && (loop_mode & MREMAP_USE_NORMAL);
+ const bool need_pnors_src = need_lnors_src || ((loop_mode & MREMAP_USE_POLY) && (loop_mode & MREMAP_USE_NORMAL));
+
+ if (need_lnors_src) {
+ cddata_mask->lmask |= CD_MASK_NORMAL;
+ }
+ if (need_pnors_src) {
+ cddata_mask->pmask |= CD_MASK_NORMAL;
+ }
+}
+
void BKE_mesh_remap_init(MeshPairRemap *map, const int items_num)
{
MemArena *mem = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);