diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-09 15:52:56 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-09-09 15:52:56 +0400 |
commit | 3daa283604930167be0bc2dad5d1684a871ca254 (patch) | |
tree | 96ee0481d6a7124e38c327e919d74995fe332e3e /source/blender/editors/space_buttons/buttons_ops.c | |
parent | 8878c30b9b032f1a630c13c5ebb260cb9029ce3c (diff) |
2.5: Object module
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...
Diffstat (limited to 'source/blender/editors/space_buttons/buttons_ops.c')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_ops.c | 127 |
1 files changed, 0 insertions, 127 deletions
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 1567f393d87..0df6f6250ff 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -85,133 +85,6 @@ #include "buttons_intern.h" // own include -/********************** group operators *********************/ - -static int group_add_exec(bContext *C, wmOperator *op) -{ - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); - Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Base *base; - Group *group; - int value= RNA_enum_get(op->ptr, "group"); - - if(!ob) - return OPERATOR_CANCELLED; - - base= object_in_scene(ob, scene); - if(!base) - return OPERATOR_CANCELLED; - - if(value == -1) - group= add_group( "Group" ); - else - group= BLI_findlink(&bmain->group, value); - - if(group) { - add_to_group(group, ob); - ob->flag |= OB_FROMGROUP; - base->flag |= OB_FROMGROUP; - } - - WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); - - return OPERATOR_FINISHED; -} - -static EnumPropertyItem group_items[]= { - {-1, "ADD_NEW", 0, "Add New Group", ""}, - {0, NULL, 0, NULL, NULL}}; - -static EnumPropertyItem *group_itemf(bContext *C, PointerRNA *ptr, int *free) -{ - EnumPropertyItem tmp = {0, "", 0, "", ""}; - EnumPropertyItem *item= NULL; - Main *bmain; - Group *group; - int a, totitem= 0; - - if(!C) /* needed for docs */ - return group_items; - - RNA_enum_items_add_value(&item, &totitem, group_items, -1); - - bmain= CTX_data_main(C); - if(bmain->group.first) - RNA_enum_item_add_separator(&item, &totitem); - - for(a=0, group=bmain->group.first; group; group=group->id.next, a++) { - tmp.value= a; - tmp.identifier= group->id.name+2; - tmp.name= group->id.name+2; - RNA_enum_item_add(&item, &totitem, &tmp); - } - - RNA_enum_item_end(&item, &totitem); - - *free= 1; - - return item; -} - -void OBJECT_OT_group_add(wmOperatorType *ot) -{ - PropertyRNA *prop; - - /* identifiers */ - ot->name= "Add Group"; - ot->idname= "OBJECT_OT_group_add"; - - /* api callbacks */ - ot->exec= group_add_exec; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - - /* properties */ - prop= RNA_def_enum(ot->srna, "group", group_items, -1, "Group", "Group to add object to."); - RNA_def_enum_funcs(prop, group_itemf); -} - -static int group_remove_exec(bContext *C, wmOperator *op) -{ - Scene *scene= CTX_data_scene(C); - Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Group *group= CTX_data_pointer_get_type(C, "group", &RNA_Group).data; - Base *base; - - if(!ob || !group) - return OPERATOR_CANCELLED; - - base= object_in_scene(ob, scene); - if(!base) - return OPERATOR_CANCELLED; - - rem_from_group(group, ob); - - if(find_group(ob, NULL) == NULL) { - ob->flag &= ~OB_FROMGROUP; - base->flag &= ~OB_FROMGROUP; - } - - WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_group_remove(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Remove Group"; - ot->idname= "OBJECT_OT_group_remove"; - - /* api callbacks */ - ot->exec= group_remove_exec; - - /* flags */ - ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; -} - /********************** material slot operators *********************/ static int material_slot_add_exec(bContext *C, wmOperator *op) |