Fix (unreported) transfer mesh data operator not enabling autosmooth.
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 5 Aug 2019 16:43:03 +0000 (18:43 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 5 Aug 2019 16:44:10 +0000 (18:44 +0200)
When we transfer custom normals and allow for data creation, we should
also enable autosmooth on destination meshes.

source/blender/editors/object/object_data_transfer.c

index 79aafc6978f0122a4d9773b55ff3b650c3620d0c..0a5db782892611573087022125a54c4c3fd47b33 100644 (file)
@@ -495,12 +495,16 @@ static int data_transfer_exec(bContext *C, wmOperator *op)
                                         NULL,
                                         false,
                                         op->reports)) {
+
+        if (data_type == DT_TYPE_LNOR && use_create) {
+          ((Mesh *)ob_dst->data)->flag |= ME_AUTOSMOOTH;
+        }
+
+        DEG_id_tag_update(&ob_dst->id, ID_RECALC_GEOMETRY);
         changed = true;
       }
     }
 
-    DEG_id_tag_update(&ob_dst->id, ID_RECALC_GEOMETRY);
-
     if (reverse_transfer) {
       SWAP(Object *, ob_src, ob_dst);
     }