[Bf-blender-cvs] [09c7bfe42b4] master: Spin Tool: hide options unrelated to duplication

Campbell Barton noreply at git.blender.org
Thu Sep 27 03:38:36 CEST 2018


Commit: 09c7bfe42b4da7db26888999fda5eb1f53f8ce3c
Author: Campbell Barton
Date:   Thu Sep 27 11:52:21 2018 +1000
Branches: master
https://developer.blender.org/rB09c7bfe42b4da7db26888999fda5eb1f53f8ce3c

Spin Tool: hide options unrelated to duplication

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

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

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

diff --git a/source/blender/editors/mesh/editmesh_extrude_spin.c b/source/blender/editors/mesh/editmesh_extrude_spin.c
index 88407576ec0..a9e78f74012 100644
--- a/source/blender/editors/mesh/editmesh_extrude_spin.c
+++ b/source/blender/editors/mesh/editmesh_extrude_spin.c
@@ -125,6 +125,21 @@ static int edbm_spin_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e
 	return edbm_spin_exec(C, op);
 }
 
+static bool edbm_spin_poll_property(const bContext *UNUSED(C), wmOperator *op, const PropertyRNA *prop)
+{
+	const char *prop_id = RNA_property_identifier(prop);
+	const bool dupli = RNA_boolean_get(op->ptr, "dupli");
+
+	if (dupli) {
+		if (STREQ(prop_id, "use_auto_merge") ||
+		    STREQ(prop_id, "use_normal_flip"))
+		{
+			return false;
+		}
+	}
+	return true;
+}
+
 void MESH_OT_spin(wmOperatorType *ot)
 {
 	PropertyRNA *prop;
@@ -138,6 +153,7 @@ void MESH_OT_spin(wmOperatorType *ot)
 	ot->invoke = edbm_spin_invoke;
 	ot->exec = edbm_spin_exec;
 	ot->poll = ED_operator_editmesh;
+	ot->poll_property = edbm_spin_poll_property;
 
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;



More information about the Bf-blender-cvs mailing list