[Bf-blender-cvs] [343f220] bmesh-boolean-experiment: Add double threshold option for boolean (mainly for testing/debugging)

Campbell Barton noreply at git.blender.org
Thu Nov 26 06:40:02 CET 2015


Commit: 343f2204a4d973cc14031409296fce513f48b307
Author: Campbell Barton
Date:   Thu Nov 26 12:01:26 2015 +1100
Branches: bmesh-boolean-experiment
https://developer.blender.org/rB343f2204a4d973cc14031409296fce513f48b307

Add double threshold option for boolean (mainly for testing/debugging)

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

M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_boolean.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 58896e8..57f121c 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -151,6 +151,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         col = split.column()
         col.label(text="Operation:")
         col.prop(md, "operation", text="")
+        col.prop(md, "threshold")
 
         col = split.column()
         col.label(text="Object:")
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 6f07d18..61bb384 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -640,7 +640,8 @@ typedef struct BooleanModifierData {
 	ModifierData modifier;
 
 	struct Object *object;
-	int operation, pad;
+	int operation;
+	float threshold;
 } BooleanModifierData;
 
 typedef enum {
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 4ca7493..20b1a61 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1883,6 +1883,13 @@ static void rna_def_modifier_boolean(BlenderRNA *brna)
 	RNA_def_property_enum_items(prop, prop_operation_items);
 	RNA_def_property_ui_text(prop, "Operation", "");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
+
+	prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_DISTANCE);
+	RNA_def_property_float_sdna(prop, NULL, "threshold");
+	RNA_def_property_range(prop, 0, 1.0f);
+	RNA_def_property_ui_range(prop, 0, 1, 1, 7);
+	RNA_def_property_ui_text(prop, "Threshold",  "");
+	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 }
 
 static void rna_def_modifier_array(BlenderRNA *brna)
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c
index d6376d5..4bf68f5 100644
--- a/source/blender/modifiers/intern/MOD_boolean.c
+++ b/source/blender/modifiers/intern/MOD_boolean.c
@@ -237,7 +237,7 @@ static DerivedMesh *applyModifier(
 				        bm_face_isect_pair, &user_data,
 				        false, true, false,
 				        bmd->operation,
-				        FLT_EPSILON);
+				        bmd->threshold);
 
 				MEM_freeN(looptris);
 			}




More information about the Bf-blender-cvs mailing list