diff options
author | Sebastian Parborg <darkdefende@gmail.com> | 2021-03-24 18:17:59 +0300 |
---|---|---|
committer | Sebastian Parborg <darkdefende@gmail.com> | 2021-03-24 18:23:32 +0300 |
commit | 80450331c7cc015f471dbafc3c783fafd1707cf5 (patch) | |
tree | f389966123511b71c26215cb38f173d7cc815a54 /source/blender/editors/object/object_add.c | |
parent | 80602936568b9756ff291172b8c3f7772f6ada07 (diff) |
Fix T86884: Don't remove the "line art object add" enum item
We would not add the "object line art" enum to the operator enum list,
if there were no active object in the scene.
This would make it impossible to call this operator from python code as
the enum would we hidden when we were not in a viewport context.
Always make the operator available, having no active object is not a
strict requirement for the operator to work, so expose it always.
Diffstat (limited to 'source/blender/editors/object/object_add.c')
-rw-r--r-- | source/blender/editors/object/object_add.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index e4527740164..b3fb497aa9a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1440,7 +1440,7 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static const EnumPropertyItem *object_gpencil_add_options(bContext *C, +static const EnumPropertyItem *object_gpencil_add_options(bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) @@ -1453,18 +1453,9 @@ static const EnumPropertyItem *object_gpencil_add_options(bContext *C, /* Default types. */ for (i = 0; i < orig_count; i++) { - if (item_ref[i].value == GP_LRT_OBJECT || item_ref[i].value == GP_LRT_COLLECTION || - item_ref[i].value == GP_LRT_SCENE) { - if (item_ref[i].value == GP_LRT_SCENE) { - /* separator before line art types */ - RNA_enum_item_add_separator(&item, &totitem); - } - else if (item_ref[i].value == GP_LRT_OBJECT) { - Object *ob = CTX_data_active_object(C); - if (!ob || ob->type != OB_MESH) { - continue; - } - } + if (item_ref[i].value == GP_LRT_SCENE) { + /* separator before line art types */ + RNA_enum_item_add_separator(&item, &totitem); } RNA_enum_item_add(&item, &totitem, &item_ref[i]); } |