[Bf-blender-cvs] [dae033801b8] blender-v2.82-release: Fix T72050 Subdivide method "Straight Cut" not working with N-Gons enabled

Sybren A. Stüvel noreply at git.blender.org
Mon Jan 20 16:12:50 CET 2020


Commit: dae033801b8c98bcac5a09ba3bf77868b7204540
Author: Sybren A. Stüvel
Date:   Mon Jan 20 16:11:00 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBdae033801b8c98bcac5a09ba3bf77868b7204540

Fix T72050 Subdivide method "Straight Cut" not working with N-Gons enabled

'Straight Cut' is actually documented as creating N-Gons. However, the
code was disallowing this. This is probably a mix-up as the "allow N-Gons"
option is documented as a "force quad/tri" option.

===================================================================

M	source/blender/editors/mesh/editmesh_tools.c

===================================================================

diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index b6b28624c27..0fea21710e9 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -96,13 +96,12 @@ static int edbm_subdivide_exec(bContext *C, wmOperator *op)
   const float smooth = RNA_float_get(op->ptr, "smoothness");
   const float fractal = RNA_float_get(op->ptr, "fractal") / 2.5f;
   const float along_normal = RNA_float_get(op->ptr, "fractal_along_normal");
+  const bool use_quad_tri = !RNA_boolean_get(op->ptr, "ngon");
 
-  if (RNA_boolean_get(op->ptr, "ngon") &&
-      RNA_enum_get(op->ptr, "quadcorner") == SUBD_CORNER_STRAIGHT_CUT) {
+  if (use_quad_tri && RNA_enum_get(op->ptr, "quadcorner") == SUBD_CORNER_STRAIGHT_CUT) {
     RNA_enum_set(op->ptr, "quadcorner", SUBD_CORNER_INNERVERT);
   }
   const int quad_corner_type = RNA_enum_get(op->ptr, "quadcorner");
-  const bool use_quad_tri = !RNA_boolean_get(op->ptr, "ngon");
   const int seed = RNA_int_get(op->ptr, "seed");
 
   ViewLayer *view_layer = CTX_data_view_layer(C);



More information about the Bf-blender-cvs mailing list