Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-05-08 03:02:49 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-05-08 03:02:49 +0300
commit7f5570ceff7f74621268dba9268c603eccce435f (patch)
treee89cbb7aedb45cccb380b0ef68e329ee3df38a9a /source/blender/editors/sculpt_paint/sculpt_face_set.c
parent2a8ba9c08ec91d73a9c1f59b90aa9e9e37e492d8 (diff)
Fix T76324: face set operators not working from Python console by default
Operators should almost always implement exec() so that they can work without user event input. In this case there was no reason to have invoke() at all since no event is needed.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt_face_set.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_face_set.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.c b/source/blender/editors/sculpt_paint/sculpt_face_set.c
index de7fefb5bdd..43ff1ad3ef5 100644
--- a/source/blender/editors/sculpt_paint/sculpt_face_set.c
+++ b/source/blender/editors/sculpt_paint/sculpt_face_set.c
@@ -252,7 +252,7 @@ static EnumPropertyItem prop_sculpt_face_set_create_types[] = {
{0, NULL, 0, NULL, NULL},
};
-static int sculpt_face_set_create_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
+static int sculpt_face_set_create_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
@@ -354,7 +354,7 @@ void SCULPT_OT_face_sets_create(wmOperatorType *ot)
ot->description = "Create a new Face Set";
/* api callbacks */
- ot->invoke = sculpt_face_set_create_invoke;
+ ot->exec = sculpt_face_set_create_exec;
ot->poll = SCULPT_mode_poll;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -594,7 +594,7 @@ static void sculpt_face_sets_init_loop(Object *ob, const int mode)
BM_mesh_free(bm);
}
-static int sculpt_face_set_init_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
+static int sculpt_face_set_init_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
@@ -687,7 +687,7 @@ void SCULPT_OT_face_sets_init(wmOperatorType *ot)
ot->description = "Initializes all Face Sets in the mesh";
/* api callbacks */
- ot->invoke = sculpt_face_set_init_invoke;
+ ot->exec = sculpt_face_set_init_exec;
ot->poll = SCULPT_mode_poll;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -753,9 +753,7 @@ static EnumPropertyItem prop_sculpt_face_sets_change_visibility_types[] = {
{0, NULL, 0, NULL, NULL},
};
-static int sculpt_face_sets_change_visibility_invoke(bContext *C,
- wmOperator *op,
- const wmEvent *UNUSED(event))
+static int sculpt_face_sets_change_visibility_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
SculptSession *ss = ob->sculpt;
@@ -888,7 +886,7 @@ void SCULPT_OT_face_sets_change_visibility(wmOperatorType *ot)
ot->description = "Change the visibility of the Face Sets of the sculpt";
/* Api callbacks. */
- ot->invoke = sculpt_face_sets_change_visibility_invoke;
+ ot->exec = sculpt_face_sets_change_visibility_exec;
ot->poll = SCULPT_mode_poll;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -901,9 +899,7 @@ void SCULPT_OT_face_sets_change_visibility(wmOperatorType *ot)
"");
}
-static int sculpt_face_sets_randomize_colors_invoke(bContext *C,
- wmOperator *UNUSED(op),
- const wmEvent *UNUSED(event))
+static int sculpt_face_sets_randomize_colors_exec(bContext *C, wmOperator *UNUSED(op))
{
Object *ob = CTX_data_active_object(C);
@@ -955,7 +951,7 @@ void SCULPT_OT_face_sets_randomize_colors(wmOperatorType *ot)
ot->description = "Generates a new set of random colors to render the Face Sets in the viewport";
/* Api callbacks. */
- ot->invoke = sculpt_face_sets_randomize_colors_invoke;
+ ot->exec = sculpt_face_sets_randomize_colors_exec;
ot->poll = SCULPT_mode_poll;
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;