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
path: root/source
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-12-21 17:31:28 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-12-21 17:31:28 +0400
commit045a91a37860dd40a2604f8208325b8d11c9e3a9 (patch)
treed416dba1df786ff06e748d270a8da61787b3aaa6 /source
parent04077f46802b6561cb2e4f7942903ba5c9666f2f (diff)
Do not show "Modify" modifiers group for curve objects
This commit prevents adding empty groups to Add Modifier menu making this menu small and nice for objects which don't support all modifiers from some group (like Curves don't support Modify modifiers).
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/object_modifier.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 913e5893a77..9a592bc9324 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -643,7 +643,7 @@ static int modifier_add_exec(bContext *C, wmOperator *op)
static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
{
Object *ob= ED_object_active_context(C);
- EnumPropertyItem *item= NULL, *md_item;
+ EnumPropertyItem *item= NULL, *md_item, *group_item= NULL;
ModifierTypeInfo *mti;
int totitem= 0, a;
@@ -663,6 +663,17 @@ static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *UNUSED(ptr)
(ob->type==OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh))))
continue;
}
+ else {
+ group_item= md_item;
+ md_item= NULL;
+
+ continue;
+ }
+
+ if(group_item) {
+ RNA_enum_item_add(&item, &totitem, group_item);
+ group_item= NULL;
+ }
RNA_enum_item_add(&item, &totitem, md_item);
}