diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-19 16:11:40 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-19 17:51:20 +0300 |
commit | 0af11a1742030c1cf2e24304a94fbb96c5138571 (patch) | |
tree | a45621e6b404d4e2e221cab3a50fe33e8265d9f0 /source/blender/blenkernel/intern/data_transfer.c | |
parent | 694806a9cfbfef8a8f4cfa0ab7d37a448d0f1bb3 (diff) |
Make use/computation of lnors consistant.
Issue was, when requesting (building) lnors for a mesh that has
autosmooth disabled, one would expect to simply get vnors as lnors.
Until now, it wasn't the case, which was bad e.g. for normal projections
of loops in recent remap code (projecting along split loop normals
when you would expect projection along vertex normals...).
Also, removed the 'angle' parameter from RNA's `mesh.calc_normals_split`.
This should *always* use mesh settings (both autosmooth and smoothresh),
otherwise once again we'd get inconsistencies in some cases.
Will update fbx and obj addons too.
Diffstat (limited to 'source/blender/blenkernel/intern/data_transfer.c')
-rw-r--r-- | source/blender/blenkernel/intern/data_transfer.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/data_transfer.c b/source/blender/blenkernel/intern/data_transfer.c index c8a5da930d0..8c42aa7c940 100644 --- a/source/blender/blenkernel/intern/data_transfer.c +++ b/source/blender/blenkernel/intern/data_transfer.c @@ -963,7 +963,7 @@ bool BKE_object_data_transfer_dm( #define DATAMAX 4 DerivedMesh *dm_src; - Mesh *me_dst; + Mesh *me_dst, *me_src; bool dirty_nors_dst = true; /* Assumed always true if not using a dm as destination. */ int i; @@ -983,6 +983,7 @@ bool BKE_object_data_transfer_dm( BLI_assert((ob_src != ob_dst) && (ob_src->type == OB_MESH) && (ob_dst->type == OB_MESH)); me_dst = ob_dst->data; + me_src = ob_src->data; if (dm_dst) { dirty_nors_dst = (dm_dst->dirty & DM_DIRTY_NORMALS) != 0; use_create = false; /* Never create needed custom layers on DM (modifier case). */ @@ -1139,8 +1140,10 @@ bool BKE_object_data_transfer_dm( map_loop_mode, space_transform, max_distance, ray_radius, verts_dst, num_verts_dst, edges_dst, num_edges_dst, loops_dst, num_loops_dst, polys_dst, num_polys_dst, - ldata_dst, pdata_dst, me_dst->smoothresh, dirty_nors_dst, - dm_src, island_callback, islands_handling_precision, &geom_map[LDATA]); + ldata_dst, pdata_dst, + (me_dst->flag & ME_AUTOSMOOTH) != 0, me_dst->smoothresh, dirty_nors_dst, + dm_src, (me_src->flag & ME_AUTOSMOOTH) != 0, me_src->smoothresh, + island_callback, islands_handling_precision, &geom_map[LDATA]); geom_map_init[LDATA] = true; } |