diff options
Diffstat (limited to 'source/blender/editors')
20 files changed, 62 insertions, 376 deletions
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt index 7e804a5bbfc..1559512d713 100644 --- a/source/blender/editors/CMakeLists.txt +++ b/source/blender/editors/CMakeLists.txt @@ -47,7 +47,6 @@ if(WITH_BLENDER) add_subdirectory(space_graph) add_subdirectory(space_image) add_subdirectory(space_info) - add_subdirectory(space_collections) add_subdirectory(space_logic) add_subdirectory(space_nla) add_subdirectory(space_node) diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index 0355925f837..35e9f35b4ef 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -49,7 +49,6 @@ struct ColorManagedDisplaySettings; void fdrawline(float x1, float y1, float x2, float y2); /* DEPRECATED */ void fdrawbox(float x1, float y1, float x2, float y2); /* DEPRECATED */ -void fdrawbox_filled(float x1, float y1, float x2, float y2); void sdrawline(int x1, int y1, int x2, int y2); /* DEPRECATED */ void sdrawbox(int x1, int y1, int x2, int y2); /* DEPRECATED */ diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 4d79a42e64e..f621ee7989d 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -55,7 +55,6 @@ struct wmOperatorType; struct PointerRNA; struct PropertyRNA; struct EnumPropertyItem; -struct LayerTree; /* object_edit.c */ struct Object *ED_object_context(struct bContext *C); /* context.object */ diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 01be63919be..f5f66a07aea 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -162,7 +162,6 @@ int ED_operator_image_active(struct bContext *C); int ED_operator_nla_active(struct bContext *C); int ED_operator_logic_active(struct bContext *C); int ED_operator_info_active(struct bContext *C); -int ED_operator_collections_active(struct bContext *C); int ED_operator_console_active(struct bContext *C); diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index b754e1ba20f..d268c578cf2 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -58,7 +58,6 @@ void ED_spacetype_logic(void); void ED_spacetype_console(void); void ED_spacetype_userpref(void); void ED_spacetype_clip(void); -void ED_spacetype_collections(void); /* calls for instancing and freeing spacetype static data * called in WM_init_exit */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 8b783377f61..69d15859407 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -212,9 +212,6 @@ enum { UI_BUT_ALIGN_STITCH_TOP = (1 << 18), UI_BUT_ALIGN_STITCH_LEFT = (1 << 19), UI_BUT_ALIGN_ALL = (UI_BUT_ALIGN | UI_BUT_ALIGN_STITCH_TOP | UI_BUT_ALIGN_STITCH_LEFT), - - /* Another hack, in some rare cases we don't want any text margin */ - UI_BUT_TEXT_NO_MARGIN = (1 << 20), }; /* scale fixed button widths by this to account for DPI */ diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h index f08c46af8a6..945ac1b6db9 100644 --- a/source/blender/editors/include/UI_interface_icons.h +++ b/source/blender/editors/include/UI_interface_icons.h @@ -83,6 +83,5 @@ struct PreviewImage *UI_icon_to_preview(int icon_id); int UI_rnaptr_icon_get(struct bContext *C, struct PointerRNA *ptr, int rnaicon, const bool big); int UI_idcode_icon_get(const int idcode); -int UI_colorset_icon_get(const int set_idx); #endif /* __UI_INTERFACE_ICONS_H__ */ diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index a9cdb34f634..f61eb99a621 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1407,14 +1407,6 @@ int UI_idcode_icon_get(const int idcode) } } -/** - * \param set_idx: A value from #rna_enum_color_sets_items. - */ -int UI_colorset_icon_get(const int set_idx) -{ - return (set_idx < 1) ? ICON_NONE : VICO_COLORSET_01_VEC - 1 + set_idx; -} - static void icon_draw_at_size( float x, float y, int icon_id, float aspect, float alpha, enum eIconSizes size, const bool nocreate) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 08d1b69dd22..e3bad758dd7 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1582,10 +1582,7 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB } } - if (but->drawflag & UI_BUT_TEXT_NO_MARGIN) { - /* skip */ - } - else if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) { + if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) { rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; } else if ((but->drawflag & UI_BUT_TEXT_RIGHT)) { diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index fbfbdb13a5f..a6235a8d26d 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -167,9 +167,6 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo case SPACE_CLIP: ts = &btheme->tclip; break; - case SPACE_COLLECTIONS: - ts = &btheme->tcollections; - break; default: ts = &btheme->tv3d; break; @@ -1211,11 +1208,6 @@ void ui_theme_init_default(void) rgba_char_args_set(btheme->tclip.strip_select, 0xff, 0x8c, 0x00, 0xff); btheme->tclip.handle_vertex_size = 5; ui_theme_space_init_handles_color(&btheme->tclip); - - /* space collection manager */ - btheme->tcollections = btheme->tv3d; - rgba_char_args_set_fl(btheme->tcollections.back, 0.42, 0.42, 0.42, 1.0); - rgba_char_args_set(btheme->tcollections.hilite, 255, 140, 25, 255); /* selected files */ } void ui_style_init_default(void) @@ -2879,11 +2871,7 @@ void init_userdef_do_versions(void) * (keep this block even if it becomes empty). */ { - for (bTheme *btheme = U.themes.first; btheme; btheme = btheme->next) { - btheme->tcollections = btheme->tv3d; - rgba_char_args_set_fl(btheme->tcollections.back, 0.42, 0.42, 0.42, 1.0); - rgba_char_args_set(btheme->tcollections.hilite, 255, 140, 25, 255); /* selected files */ - } + } if (U.pixelsize == 0.0f) diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 4a8edef4ca2..4baf3cd78b7 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -75,18 +75,6 @@ void fdrawbox(float x1, float y1, float x2, float y2) glEnd(); } -void fdrawbox_filled(float x1, float y1, float x2, float y2) -{ - glBegin(GL_POLYGON); - - glVertex2f(x1, y1); - glVertex2f(x1, y2); - glVertex2f(x2, y2); - glVertex2f(x2, y1); - - glEnd(); -} - void fdrawcheckerboard(float x1, float y1, float x2, float y2) /* DEPRECATED */ { unsigned char col1[4] = {40, 40, 40}, col2[4] = {50, 50, 50}; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index a55d6c2143f..32b63aca34c 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -321,10 +321,6 @@ int ED_operator_info_active(bContext *C) return ed_spacetype_test(C, SPACE_INFO); } -int ED_operator_collections_active(bContext *C) -{ - return ed_spacetype_test(C, SPACE_COLLECTIONS); -} int ED_operator_console_active(bContext *C) { diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 8c278c0b3ae..5ff1d758563 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -96,7 +96,6 @@ void ED_spacetypes_init(void) ED_spacetype_console(); ED_spacetype_userpref(); ED_spacetype_clip(); - ED_spacetype_collections(); // ... /* register operator types for screen and all spaces */ diff --git a/source/blender/editors/space_collections/CMakeLists.txt b/source/blender/editors/space_collections/CMakeLists.txt deleted file mode 100644 index 1cc4a40d657..00000000000 --- a/source/blender/editors/space_collections/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# ***** BEGIN GPL LICENSE BLOCK ***** -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Contributor(s): Jacques Beaurain. -# -# ***** END GPL LICENSE BLOCK ***** - -set(INC - ../include - ../../blenkernel - ../../blenlib - ../../blentranslation - ../../gpu - ../../makesdna - ../../makesrna - ../../windowmanager - ../../../../intern/guardedalloc - ../../../../intern/glew-mx -) - -set(INC_SYS - ${GLEW_INCLUDE_PATH} -) - -set(SRC - collections_ops.c - space_collections.c - - collections_intern.h -) - -blender_add_lib(bf_editor_space_collections "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/space_collections/collections_intern.h b/source/blender/editors/space_collections/collections_intern.h deleted file mode 100644 index 866f59659c3..00000000000 --- a/source/blender/editors/space_collections/collections_intern.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/editors/space_collections/collections_intern.h - * \ingroup spcollections - */ - -#ifndef __COLLECTIONS_INTERN_H__ -#define __COLLECTIONS_INTERN_H__ - -struct wmKeyConfig; - -/* collections_ops.c */ -void collections_operatortypes(void); -void collections_keymap(struct wmKeyConfig *keyconf); - -#endif /* __COLLECTIONS_INTERN_H__ */ - diff --git a/source/blender/editors/space_collections/space_collections.c b/source/blender/editors/space_collections/space_collections.c deleted file mode 100644 index 7dd50e5cbac..00000000000 --- a/source/blender/editors/space_collections/space_collections.c +++ /dev/null @@ -1,182 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/editors/space_collections/space_collections.c - * \ingroup spcollections - */ - -#include <string.h> - -#include "MEM_guardedalloc.h" - -#include "BIF_gl.h" - -#include "BKE_context.h" -#include "BKE_screen.h" - -#include "BLI_ghash.h" -#include "BLI_listbase.h" - -#include "ED_screen.h" -#include "ED_space_api.h" - -#include "UI_resources.h" -#include "UI_view2d.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "collections_intern.h" /* own include */ - -/* ******************** default callbacks for collection manager space ***************** */ - -static SpaceLink *collections_new(const bContext *UNUSED(C)) -{ - ARegion *ar; - SpaceCollections *scollection; /* hmm, that's actually a good band name... */ - - scollection = MEM_callocN(sizeof(SpaceCollections), __func__); - scollection->spacetype = SPACE_COLLECTIONS; - - /* header */ - ar = MEM_callocN(sizeof(ARegion), "header for collection manager"); - BLI_addtail(&scollection->regionbase, ar); - ar->regiontype = RGN_TYPE_HEADER; - ar->alignment = RGN_ALIGN_BOTTOM; - - /* main region */ - ar = MEM_callocN(sizeof(ARegion), "main region for collection manager"); - BLI_addtail(&scollection->regionbase, ar); - ar->regiontype = RGN_TYPE_WINDOW; - ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HIDE | V2D_SCROLL_VERTICAL_HIDE); - ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y); - - return (SpaceLink *)scollection; -} - -static void collections_free(SpaceLink *UNUSED(sl)) -{ -} - -static SpaceLink *collections_duplicate(SpaceLink *sl) -{ - SpaceCollections *scollection = MEM_dupallocN(sl); - - /* clear or remove stuff from old */ - - return (SpaceLink *)scollection; -} - -/* add handlers, stuff you only do once or on area/region changes */ -static void collection_main_region_init(wmWindowManager *wm, ARegion *ar) -{ - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); - ar->v2d.scroll |= (V2D_SCROLL_VERTICAL_FULLR | V2D_SCROLL_HORIZONTAL_FULLR); - - /* own keymap */ - wmKeyMap *keymap = WM_keymap_find(wm->defaultconf, "Layer Manager", SPACE_COLLECTIONS, 0); - WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); -} - -static void collections_main_region_draw(const bContext *C, ARegion *ar) -{ - SpaceCollections *spc = CTX_wm_space_collections(C); - View2D *v2d = &ar->v2d; - - if (spc->flag & SC_COLLECTION_DATA_REFRESH) { - } - - /* v2d has initialized flag, so this call will only set the mask correct */ - UI_view2d_region_reinit(v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); - - UI_ThemeClearColor(TH_BACK); - glClear(GL_COLOR_BUFFER_BIT); - - /* reset view matrix */ - UI_view2d_view_restore(C); - - /* scrollers */ - View2DScrollers *scrollers; - scrollers = UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY); - UI_view2d_scrollers_draw(C, v2d, scrollers); - UI_view2d_scrollers_free(scrollers); -} - -/* add handlers, stuff you only do once or on area/region changes */ -static void collections_header_region_init(wmWindowManager *UNUSED(wm), ARegion *ar) -{ - ED_region_header_init(ar); -} - -static void collections_header_region_draw(const bContext *C, ARegion *ar) -{ - ED_region_header(C, ar); -} - -static void collections_main_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegion *ar, wmNotifier *wmn) -{ - switch (wmn->category) { - case NC_SCENE: - if (wmn->data == ND_LAYER) { - ED_region_tag_redraw(ar); - } - break; - case NC_SPACE: - if (wmn->data == ND_SPACE_COLLECTIONS) { - ED_region_tag_redraw(ar); - } - } -} - -/* only called once, from space/spacetypes.c */ -void ED_spacetype_collections(void) -{ - SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype collections"); - ARegionType *art; - - st->spaceid = SPACE_COLLECTIONS; - strncpy(st->name, "LayerManager", BKE_ST_MAXNAME); - - st->new = collections_new; - st->free = collections_free; - st->duplicate = collections_duplicate; - st->operatortypes = collections_operatortypes; - st->keymap = collections_keymap; - - /* regions: main window */ - art = MEM_callocN(sizeof(ARegionType), "spacetype collections region"); - art->regionid = RGN_TYPE_WINDOW; - art->init = collection_main_region_init; - art->draw = collections_main_region_draw; - art->listener = collections_main_region_listener; - art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D; - BLI_addhead(&st->regiontypes, art); - - /* regions: header */ - art = MEM_callocN(sizeof(ARegionType), "spacetype collections header"); - art->regionid = RGN_TYPE_HEADER; - art->prefsizey = HEADERY; - art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_HEADER; - art->init = collections_header_region_init; - art->draw = collections_header_region_draw; - BLI_addhead(&st->regiontypes, art); - - BKE_spacetype_register(st); -} diff --git a/source/blender/editors/space_outliner/CMakeLists.txt b/source/blender/editors/space_outliner/CMakeLists.txt index 289d6e715e1..18998b5de5c 100644 --- a/source/blender/editors/space_outliner/CMakeLists.txt +++ b/source/blender/editors/space_outliner/CMakeLists.txt @@ -37,6 +37,7 @@ set(INC_SYS ) set(SRC + outliner_collections.c outliner_draw.c outliner_edit.c outliner_ops.c diff --git a/source/blender/editors/space_collections/collections_ops.c b/source/blender/editors/space_outliner/outliner_collections.c index 7e1bf8091b0..382276a64b2 100644 --- a/source/blender/editors/space_collections/collections_ops.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -15,11 +15,13 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + * Contributor(s): Blender Foundation, Dalai Felinto + * * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/editors/space_collections/collections_ops.c - * \ingroup spcollections +/** \file blender/editors/space_outliner/outliner_collections.c + * \ingroup spoutliner */ #include "BKE_context.h" @@ -34,7 +36,7 @@ #include "RNA_access.h" #include "RNA_define.h" -#include "collections_intern.h" /* own include */ +#include "outliner_intern.h" /* own include */ /* -------------------------------------------------------------------- */ /* polls */ @@ -80,15 +82,15 @@ static int operator_collection_active(bContext *C) static int collection_link_invoke(bContext *UNUSED(C), wmOperator *op, const wmEvent *UNUSED(event)) { TODO_LAYER_OPERATORS; - BKE_report(op->reports, RPT_ERROR, "COLLECTIONS_OT_collection_link not implemented yet"); + BKE_report(op->reports, RPT_ERROR, "OUTLINER_OT_collections_link not implemented yet"); return OPERATOR_CANCELLED; } -static void COLLECTIONS_OT_collection_link(wmOperatorType *ot) +void OUTLINER_OT_collections_link(wmOperatorType *ot) { /* identifiers */ ot->name = "Add Collection"; - ot->idname = "COLLECTIONS_OT_collection_link"; + ot->idname = "OUTLINER_OT_collections_link"; ot->description = "Link a new collection to the active layer"; /* api callbacks */ @@ -101,15 +103,15 @@ static void COLLECTIONS_OT_collection_link(wmOperatorType *ot) static int collection_unlink_invoke(bContext *UNUSED(C), wmOperator *op, const wmEvent *UNUSED(event)) { TODO_LAYER_OPERATORS; - BKE_report(op->reports, RPT_ERROR, "COLLECTIONS_OT_collection_unlink not implemented yet"); + BKE_report(op->reports, RPT_ERROR, "OUTLINER_OT_collections_unlink not implemented yet"); return OPERATOR_CANCELLED; } -static void COLLECTIONS_OT_collection_unlink(wmOperatorType *ot) +void OUTLINER_OT_collections_unlink(wmOperatorType *ot) { /* identifiers */ ot->name = "Add Collection"; - ot->idname = "COLLECTIONS_OT_collection_unlink"; + ot->idname = "OUTLINER_OT_collections_unlink"; ot->description = "Link a new collection to the active layer"; /* api callbacks */ @@ -132,11 +134,11 @@ static int collection_new_exec(bContext *C, wmOperator *UNUSED(op)) return OPERATOR_FINISHED; } -static void COLLECTIONS_OT_collection_new(wmOperatorType *ot) +void OUTLINER_OT_collections_new(wmOperatorType *ot) { /* identifiers */ ot->name = "New Collection"; - ot->idname = "COLLECTIONS_OT_collection_new"; + ot->idname = "OUTLINER_OT_collections_new"; ot->description = "Add a new collection to the scene, and link it to the active layer"; /* api callbacks */ @@ -150,15 +152,15 @@ static int override_new_invoke(bContext *UNUSED(C), wmOperator *op, const wmEven { TODO_LAYER_OPERATORS; TODO_LAYER_OVERRIDE; - BKE_report(op->reports, RPT_ERROR, "COLLECTIONS_OT_override_new not implemented yet"); + BKE_report(op->reports, RPT_ERROR, "OUTLINER_OT_collections_override_new not implemented yet"); return OPERATOR_CANCELLED; } -static void COLLECTIONS_OT_override_new(wmOperatorType *ot) +void OUTLINER_OT_collections_override_new(wmOperatorType *ot) { /* identifiers */ ot->name = "New Override"; - ot->idname = "COLLECTIONS_OT_override_new"; + ot->idname = "OUTLINER_OT_collections_override_new"; ot->description = "Add a new override to the active collection"; /* api callbacks */ @@ -172,15 +174,15 @@ static void COLLECTIONS_OT_override_new(wmOperatorType *ot) static int delete_invoke(bContext *UNUSED(C), wmOperator *op, const wmEvent *UNUSED(event)) { TODO_LAYER_OPERATORS; - BKE_report(op->reports, RPT_ERROR, "COLLECTIONS_OT_delete not implemented yet"); + BKE_report(op->reports, RPT_ERROR, "OUTLINER_OT_collections_delete not implemented yet"); return OPERATOR_CANCELLED; } -static void COLLECTIONS_OT_delete(wmOperatorType *ot) +void OUTLINER_OT_collections_delete(wmOperatorType *ot) { /* identifiers */ ot->name = "Delete"; - ot->idname = "COLLECTIONS_OT_delete"; + ot->idname = "OUTLINER_OT_collections_delete"; ot->description = "Delete active override or collection"; /* api callbacks */ @@ -200,11 +202,11 @@ static int select_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -static void COLLECTIONS_OT_select(wmOperatorType *ot) +void OUTLINER_OT_collections_select(wmOperatorType *ot) { /* identifiers */ ot->name = "Select"; - ot->idname = "COLLECTIONS_OT_select"; + ot->idname = "OUTLINER_OT_collections_select"; ot->description = "Change active collection or override"; /* api callbacks */ @@ -224,11 +226,11 @@ static int rename_invoke(bContext *UNUSED(C), wmOperator *op, const wmEvent *UNU return OPERATOR_CANCELLED; } -static void COLLECTIONS_OT_rename(wmOperatorType *ot) +void OUTLINER_OT_collections_rename(wmOperatorType *ot) { /* identifiers */ ot->name = "Rename"; - ot->idname = "COLLECTIONS_OT_rename"; + ot->idname = "OUTLINER_OT_collections_rename"; ot->description = "Rename active collection or override"; /* api callbacks */ @@ -240,7 +242,6 @@ static void COLLECTIONS_OT_rename(wmOperatorType *ot) } /* -------------------------------------------------------------------- */ -/* property editor operators */ static int stubs_invoke(bContext *UNUSED(C), wmOperator *op, const wmEvent *UNUSED(event)) { @@ -249,11 +250,11 @@ static int stubs_invoke(bContext *UNUSED(C), wmOperator *op, const wmEvent *UNUS return OPERATOR_CANCELLED; } -static void COLLECTIONS_OT_objects_add(wmOperatorType *ot) +void OUTLINER_OT_collections_objects_add(wmOperatorType *ot) { /* identifiers */ ot->name = "Add Objects"; - ot->idname = "COLLECTIONS_OT_objects_add"; + ot->idname = "OUTLINER_OT_collections_objects_add"; ot->description = "Add selected objects to collection"; /* api callbacks */ @@ -263,11 +264,11 @@ static void COLLECTIONS_OT_objects_add(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static void COLLECTIONS_OT_objects_remove(wmOperatorType *ot) +void OUTLINER_OT_collections_objects_remove(wmOperatorType *ot) { /* identifiers */ ot->name = "Remove Object"; - ot->idname = "COLLECTIONS_OT_objects_remove"; + ot->idname = "OUTLINER_OT_collections_objects_remove"; ot->description = "Remove object from collection"; /* api callbacks */ @@ -277,11 +278,11 @@ static void COLLECTIONS_OT_objects_remove(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static void COLLECTIONS_OT_objects_select(wmOperatorType *ot) +void OUTLINER_OT_collections_objects_select(wmOperatorType *ot) { /* identifiers */ ot->name = "Select Objects"; - ot->idname = "COLLECTIONS_OT_objects_select"; + ot->idname = "OUTLINER_OT_collections_objects_select"; ot->description = "Selected collection objects"; /* api callbacks */ @@ -291,11 +292,11 @@ static void COLLECTIONS_OT_objects_select(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -static void COLLECTIONS_OT_objects_deselect(wmOperatorType *ot) +void OUTLINER_OT_collections_objects_deselect(wmOperatorType *ot) { /* identifiers */ ot->name = "Deselect Objects"; - ot->idname = "COLLECTIONS_OT_objects_deselect"; + ot->idname = "OUTLINER_OT_collections_objects_deselect"; ot->description = "Deselected collection objects"; /* api callbacks */ @@ -305,36 +306,3 @@ static void COLLECTIONS_OT_objects_deselect(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; } -/* ************************** registration - operator types **********************************/ - -void collections_operatortypes(void) -{ - WM_operatortype_append(COLLECTIONS_OT_delete); - WM_operatortype_append(COLLECTIONS_OT_select); - WM_operatortype_append(COLLECTIONS_OT_rename); - WM_operatortype_append(COLLECTIONS_OT_collection_link); - WM_operatortype_append(COLLECTIONS_OT_collection_unlink); - WM_operatortype_append(COLLECTIONS_OT_collection_new); - WM_operatortype_append(COLLECTIONS_OT_override_new); - - WM_operatortype_append(COLLECTIONS_OT_objects_add); - WM_operatortype_append(COLLECTIONS_OT_objects_remove); - WM_operatortype_append(COLLECTIONS_OT_objects_select); - WM_operatortype_append(COLLECTIONS_OT_objects_deselect); -} - -void collections_keymap(wmKeyConfig *keyconf) -{ - wmKeyMap *keymap = WM_keymap_find(keyconf, "Collections Manager", SPACE_COLLECTIONS, 0); - - /* selection */ - WM_keymap_add_item(keymap, "COLLECTIONS_OT_select", LEFTMOUSE, KM_CLICK, 0, 0); - - WM_keymap_add_item(keymap, "COLLECTIONS_OT_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0); - WM_keymap_add_item(keymap, "COLLECTIONS_OT_rename", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); - - WM_keymap_add_item(keymap, "COLLECTIONS_OT_collection_new", NKEY, KM_PRESS, KM_CTRL, 0); - - WM_keymap_add_item(keymap, "COLLECTIONS_OT_delete", XKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "COLLECTIONS_OT_delete", DELKEY, KM_PRESS, 0, 0); -} diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index 768fe4d8551..aa3bcaaabe6 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -274,4 +274,19 @@ void OUTLINER_OT_modifier_operation(struct wmOperatorType *ot); void outliner_operatortypes(void); void outliner_keymap(struct wmKeyConfig *keyconf); +/* outliner_collections.c */ + +void OUTLINER_OT_collections_delete(struct wmOperatorType *ot); +void OUTLINER_OT_collections_select(struct wmOperatorType *ot); +void OUTLINER_OT_collections_rename(struct wmOperatorType *ot); +void OUTLINER_OT_collections_link(struct wmOperatorType *ot); +void OUTLINER_OT_collections_unlink(struct wmOperatorType *ot); +void OUTLINER_OT_collections_new(struct wmOperatorType *ot); +void OUTLINER_OT_collections_override_new(struct wmOperatorType *ot); +void OUTLINER_OT_collections_objects_add(struct wmOperatorType *ot); +void OUTLINER_OT_collections_objects_remove(struct wmOperatorType *ot); +void OUTLINER_OT_collections_objects_select(struct wmOperatorType *ot); +void OUTLINER_OT_collections_objects_deselect(struct wmOperatorType *ot); + + #endif /* __OUTLINER_INTERN_H__ */ diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index 5ddfdddc80d..d5adfeda980 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -84,6 +84,19 @@ void outliner_operatortypes(void) WM_operatortype_append(OUTLINER_OT_scene_drop); WM_operatortype_append(OUTLINER_OT_material_drop); WM_operatortype_append(OUTLINER_OT_group_link); + + /* collections */ + WM_operatortype_append(OUTLINER_OT_collections_delete); + WM_operatortype_append(OUTLINER_OT_collections_select); + WM_operatortype_append(OUTLINER_OT_collections_rename); + WM_operatortype_append(OUTLINER_OT_collections_link); + WM_operatortype_append(OUTLINER_OT_collections_unlink); + WM_operatortype_append(OUTLINER_OT_collections_new); + WM_operatortype_append(OUTLINER_OT_collections_override_new); + WM_operatortype_append(OUTLINER_OT_collections_objects_add); + WM_operatortype_append(OUTLINER_OT_collections_objects_remove); + WM_operatortype_append(OUTLINER_OT_collections_objects_select); + WM_operatortype_append(OUTLINER_OT_collections_objects_deselect); } void outliner_keymap(wmKeyConfig *keyconf) |