[Bf-blender-cvs] [db5c496b265] hair_guides_grooming: Bundle bind operator only works in object mode.

Lukas Tönne noreply at git.blender.org
Tue May 29 09:37:38 CEST 2018


Commit: db5c496b265898e6ba20b821f285584c80bdf422
Author: Lukas Tönne
Date:   Tue May 29 07:31:44 2018 +0100
Branches: hair_guides_grooming
https://developer.blender.org/rBdb5c496b265898e6ba20b821f285584c80bdf422

Bundle bind operator only works in object mode.

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

M	source/blender/editors/groom/editgroom_region.c

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

diff --git a/source/blender/editors/groom/editgroom_region.c b/source/blender/editors/groom/editgroom_region.c
index d5d6f4da0a3..3fbdf10afba 100644
--- a/source/blender/editors/groom/editgroom_region.c
+++ b/source/blender/editors/groom/editgroom_region.c
@@ -151,6 +151,23 @@ void GROOM_OT_region_add(wmOperatorType *ot)
 
 /* GROOM_OT_region_bind */
 
+static int region_bind_poll(bContext *C)
+{
+	if (!ED_operator_scene_editable(C))
+	{
+		return 0;
+	}
+	
+	Object *ob = ED_object_context(C);
+	Groom *groom = ob->data;
+	if (groom->editgroom)
+	{
+		return 0;
+	}
+	
+	return 1;
+}
+
 static int region_bind_exec(bContext *C, wmOperator *op)
 {
 	Object *ob = ED_object_context(C);
@@ -184,7 +201,7 @@ void GROOM_OT_region_bind(wmOperatorType *ot)
 
 	/* api callbacks */
 	ot->exec = region_bind_exec;
-	ot->poll = ED_operator_scene_editable;
+	ot->poll = region_bind_poll;
 
 	/* flags */
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;



More information about the Bf-blender-cvs mailing list