2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2008-01-01 18:29:19 +00:00
|
|
|
* ***** 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-01-01 18:29:19 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
2011-02-21 07:25:24 +00:00
|
|
|
|
|
|
|
/** \file ED_screen.h
|
|
|
|
* \ingroup editors
|
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __ED_SCREEN_H__
|
|
|
|
#define __ED_SCREEN_H__
|
2008-01-01 18:29:19 +00:00
|
|
|
|
|
|
|
#include "DNA_screen_types.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
#include "DNA_space_types.h"
|
|
|
|
#include "DNA_view2d_types.h"
|
|
|
|
#include "DNA_view3d_types.h"
|
2017-10-16 17:15:03 -02:00
|
|
|
#include "DNA_workspace_types.h"
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2016-12-01 16:43:57 +01:00
|
|
|
#include "BLI_compiler_attrs.h"
|
|
|
|
|
2017-11-03 14:36:49 +01:00
|
|
|
struct Depsgraph;
|
2008-01-07 18:03:41 +00:00
|
|
|
struct wmWindowManager;
|
|
|
|
struct wmWindow;
|
|
|
|
struct wmNotifier;
|
2008-12-15 18:43:18 +00:00
|
|
|
struct wmEvent;
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
struct wmKeyConfig;
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
struct WorkSpace;
|
|
|
|
struct WorkSpaceInstanceHook;
|
2008-12-19 14:14:43 +00:00
|
|
|
struct bContext;
|
2009-02-08 12:16:35 +00:00
|
|
|
struct Scene;
|
2017-11-22 10:52:39 -02:00
|
|
|
struct ViewLayer;
|
2009-02-08 12:16:35 +00:00
|
|
|
struct bScreen;
|
|
|
|
struct ARegion;
|
2008-12-14 12:16:55 +00:00
|
|
|
struct uiBlock;
|
2.5: WM Compositing
* Triple Buffer is now more complete:
- Proper handling of window resize, duplicate, etc.
- It now uses 3x3 textures (or less) if the power of two sizes
do not match well. That still has a worst case wast of 23.4%,
but better than 300%.
- It can also use the ARB/NV/EXT_texture_rectangle extension
now, which may be supported on hardware that does not support
ARB_texture_non_power_of_two.
- Gesture, menu and brushe redraws now require no redraws at all
from the area regions. So even on a high poly scene just moving
the paint cursor or opening a menu should be fast.
* Testing can be done by setting the "Window Draw Method" in the
User Preferences in the outliner. "Overlap" is still default,
since "Triple Buffer" has not been tested on computers other than
mine, would like to avoid crashing Blender on startup in case
there is a common bug, but it's ready for testing now.
- For reference "Full" draws the full window each time.
- "Triple Buffer" should work for both swap copy and swap exchange
systems, the latter still need the -E command line option for
"Overlap".
- Resizing and going fullscreen still gives flicker here but no
more than "Full" drawing.
* Partial Redraw was added. ED_region_tag_redraw_partial takes a
rect in window coordinates to define a subarea of the region.
On region draw it will then set glScissor to a smaller area, and
ar->drawrct will always be set to either the partial or full
window rect. The latter can then be used for clipping in the 3D
view or clipping interface drawing. Neither is implemented yet.
2009-01-23 03:52:52 +00:00
|
|
|
struct rcti;
|
2016-12-01 16:43:57 +01:00
|
|
|
struct Main;
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* regions */
|
2017-05-02 09:58:01 +10:00
|
|
|
void ED_region_do_listen(
|
|
|
|
struct bScreen *sc, struct ScrArea *sa, struct ARegion *ar,
|
|
|
|
struct wmNotifier *note, const Scene *scene);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_region_do_draw(struct bContext *C, struct ARegion *ar);
|
|
|
|
void ED_region_exit(struct bContext *C, struct ARegion *ar);
|
|
|
|
void ED_region_pixelspace(struct ARegion *ar);
|
|
|
|
void ED_region_set(const struct bContext *C, struct ARegion *ar);
|
2014-04-02 18:42:08 +11:00
|
|
|
void ED_region_update_rect(struct bContext *C, struct ARegion *ar);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_region_init(struct bContext *C, struct ARegion *ar);
|
|
|
|
void ED_region_tag_redraw(struct ARegion *ar);
|
2015-06-30 15:31:55 +10:00
|
|
|
void ED_region_tag_redraw_partial(struct ARegion *ar, const struct rcti *rct);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_region_tag_redraw_overlay(struct ARegion *ar);
|
2014-06-15 01:40:15 +10:00
|
|
|
void ED_region_tag_refresh_ui(struct ARegion *ar);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *ar);
|
2015-07-01 21:48:42 +02:00
|
|
|
void ED_region_panels(
|
|
|
|
const struct bContext *C, struct ARegion *ar,
|
|
|
|
const char *context, int contextnr,
|
|
|
|
const bool vertical);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_region_header_init(struct ARegion *ar);
|
|
|
|
void ED_region_header(const struct bContext *C, struct ARegion *ar);
|
2016-04-19 16:04:44 +02:00
|
|
|
void ED_region_cursor_set(struct wmWindow *win, struct ScrArea *sa, struct ARegion *ar);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_region_toggle_hidden(struct bContext *C, struct ARegion *ar);
|
2015-07-01 21:48:42 +02:00
|
|
|
void ED_region_info_draw(struct ARegion *ar, const char *text, float fill_color[4], const bool full_redraw);
|
2017-05-04 21:56:34 +02:00
|
|
|
void ED_region_info_draw_multiline(ARegion *ar, const char *text_array[], float fill_color[4], const bool full_redraw);
|
2015-10-05 20:46:53 +11:00
|
|
|
void ED_region_image_metadata_draw(int x, int y, struct ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_region_grid_draw(struct ARegion *ar, float zoomx, float zoomy);
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
float ED_region_blend_factor(struct ARegion *ar);
|
2012-12-18 13:59:47 +00:00
|
|
|
void ED_region_visible_rect(struct ARegion *ar, struct rcti *rect);
|
2012-12-16 09:37:15 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* spaces */
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_spacetypes_keymap(struct wmKeyConfig *keyconf);
|
|
|
|
int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco);
|
2008-12-16 18:42:12 +00:00
|
|
|
|
2008-01-07 18:03:41 +00:00
|
|
|
/* areas */
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_area_initialize(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *sa);
|
|
|
|
void ED_area_exit(struct bContext *C, struct ScrArea *sa);
|
|
|
|
int ED_screen_area_active(const struct bContext *C);
|
2017-10-16 22:49:00 +02:00
|
|
|
void ED_area_do_listen(struct bScreen *sc, ScrArea *sa, struct wmNotifier *note, Scene *scene,
|
|
|
|
struct WorkSpace *workspace);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_area_tag_redraw(ScrArea *sa);
|
|
|
|
void ED_area_tag_redraw_regiontype(ScrArea *sa, int type);
|
|
|
|
void ED_area_tag_refresh(ScrArea *sa);
|
|
|
|
void ED_area_do_refresh(struct bContext *C, ScrArea *sa);
|
2015-04-25 01:29:53 +02:00
|
|
|
void ED_area_azones_update(ScrArea *sa, const int mouse_xy[]);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_area_headerprint(ScrArea *sa, const char *str);
|
Fix a bunch of temp full-screen glitches
Steps to reproduce fixed glitches were:
* Change any editor to be file browser from menu, Ctrl+O *from the file browser area*, Esc -> area reset to what it was before changing to file browser initially
* Ctrl+O from any area, F12, Esc -> returns to initial editor in full-screen (expected is file browser in full-screen)
Fixes T46229
Core of the fix is removing old area from spacedata list when going back to previous area (see ED_area_prevspace -> BKE_spacedata_remove). Also, when creating a new temp area we now don't exit old area anymore (needed so SpaceFile->op is kept, but it also makes sense in general)
Aaand finally removes some ugly hacks.
Tested quite a bit, so I think it's safe to apply (besides of remark below), just would like to get things double checked and confirmed. After all, this full-screen stuff finally starts to feel like it's working :P
Note, there's still a memory leak when quitting Blender with temp area open. Haven't found out how to solve yet, but it's not that important for review anyway.
Reviewers: campbellbarton, brecht
Reviewed By: brecht
Subscribers: plyczkowski, Blendify
Maniphest Tasks: T46229
Differential Revision: https://developer.blender.org/D1531
2016-02-29 16:18:42 +01:00
|
|
|
void ED_area_newspace(struct bContext *C, ScrArea *sa, int type, const bool skip_ar_exit);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_area_prevspace(struct bContext *C, ScrArea *sa);
|
|
|
|
void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2);
|
|
|
|
int ED_area_headersize(void);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
|
|
|
/* screens */
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_screens_initialize(struct wmWindowManager *wm);
|
|
|
|
void ED_screen_draw(struct wmWindow *win);
|
|
|
|
void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win);
|
|
|
|
void ED_screen_do_listen(struct bContext *C, struct wmNotifier *note);
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
bool ED_screen_change(struct bContext *C, struct bScreen *sc);
|
2017-11-08 12:16:49 -02:00
|
|
|
void ED_screen_update_after_scene_change(
|
|
|
|
const struct bScreen *screen,
|
|
|
|
struct Scene *scene_new,
|
2017-11-22 10:52:39 -02:00
|
|
|
struct ViewLayer *view_layer);
|
2017-10-14 17:29:54 +11:00
|
|
|
void ED_screen_set_subwinactive(struct bContext *C, const struct wmEvent *event);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
|
|
|
|
void ED_screen_animation_timer(struct bContext *C, int redraws, int refresh, int sync, int enable);
|
|
|
|
void ED_screen_animation_timer_update(struct bScreen *screen, int redraws, int refresh);
|
2015-01-28 02:32:52 +01:00
|
|
|
void ED_screen_restore_temp_type(struct bContext *C, ScrArea *sa);
|
2011-06-06 00:42:36 +00:00
|
|
|
ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
|
Fix a bunch of temp full-screen glitches
Steps to reproduce fixed glitches were:
* Change any editor to be file browser from menu, Ctrl+O *from the file browser area*, Esc -> area reset to what it was before changing to file browser initially
* Ctrl+O from any area, F12, Esc -> returns to initial editor in full-screen (expected is file browser in full-screen)
Fixes T46229
Core of the fix is removing old area from spacedata list when going back to previous area (see ED_area_prevspace -> BKE_spacedata_remove). Also, when creating a new temp area we now don't exit old area anymore (needed so SpaceFile->op is kept, but it also makes sense in general)
Aaand finally removes some ugly hacks.
Tested quite a bit, so I think it's safe to apply (besides of remark below), just would like to get things double checked and confirmed. After all, this full-screen stuff finally starts to feel like it's working :P
Note, there's still a memory leak when quitting Blender with temp area open. Haven't found out how to solve yet, but it's not that important for review anyway.
Reviewers: campbellbarton, brecht
Reviewed By: brecht
Subscribers: plyczkowski, Blendify
Maniphest Tasks: T46229
Differential Revision: https://developer.blender.org/D1531
2016-02-29 16:18:42 +01:00
|
|
|
void ED_screen_full_prevspace(struct bContext *C, ScrArea *sa);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_screen_full_restore(struct bContext *C, ScrArea *sa);
|
2014-10-14 15:05:44 -03:00
|
|
|
struct ScrArea *ED_screen_state_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa, const short state);
|
2012-09-19 18:47:41 +00:00
|
|
|
void ED_screens_header_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg);
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
bool ED_screen_stereo3d_required(const struct bScreen *screen, const struct Scene *scene);
|
|
|
|
Scene *ED_screen_scene_find(const struct bScreen *screen, const struct wmWindowManager *wm);
|
2016-12-01 16:43:57 +01:00
|
|
|
void ED_screen_preview_render(const struct bScreen *screen, int size_x, int size_y, unsigned int *r_rect) ATTR_NONNULL();
|
2009-01-06 18:52:18 +00:00
|
|
|
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
/* workspaces */
|
|
|
|
struct WorkSpace *ED_workspace_add(
|
|
|
|
struct Main *bmain,
|
|
|
|
const char *name,
|
2017-12-01 15:47:24 +01:00
|
|
|
Scene *scene,
|
2017-11-22 10:52:39 -02:00
|
|
|
ViewLayer *act_render_layer,
|
2017-10-16 17:15:03 -02:00
|
|
|
struct ViewRender *view_render) ATTR_NONNULL();
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
bool ED_workspace_change(
|
|
|
|
struct WorkSpace *workspace_new,
|
|
|
|
struct bContext *C,
|
|
|
|
struct wmWindowManager *wm, struct wmWindow *win) ATTR_NONNULL();
|
|
|
|
struct WorkSpace *ED_workspace_duplicate(
|
|
|
|
struct WorkSpace *workspace_old,
|
|
|
|
struct Main *bmain, struct wmWindow *win);
|
|
|
|
bool ED_workspace_delete(
|
|
|
|
struct WorkSpace *workspace,
|
|
|
|
struct Main *bmain, struct bContext *C,
|
2017-10-06 18:01:40 +02:00
|
|
|
struct wmWindowManager *wm) ATTR_NONNULL();
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
void ED_workspace_scene_data_sync(
|
|
|
|
struct WorkSpaceInstanceHook *hook, Scene *scene) ATTR_NONNULL();
|
2017-11-22 10:52:39 -02:00
|
|
|
void ED_workspace_view_layer_unset(
|
2017-12-01 15:47:24 +01:00
|
|
|
const struct Main *bmain, struct Scene *scene,
|
|
|
|
const ViewLayer *layer_unset, ViewLayer *layer_new) ATTR_NONNULL(1, 2);
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
struct WorkSpaceLayout *ED_workspace_layout_add(
|
|
|
|
struct WorkSpace *workspace,
|
|
|
|
struct wmWindow *win,
|
|
|
|
const char *name) ATTR_NONNULL();
|
|
|
|
struct WorkSpaceLayout *ED_workspace_layout_duplicate(
|
|
|
|
struct WorkSpace *workspace, const struct WorkSpaceLayout *layout_old,
|
|
|
|
struct wmWindow *win) ATTR_NONNULL();
|
|
|
|
bool ED_workspace_layout_delete(
|
|
|
|
struct WorkSpace *workspace, struct WorkSpaceLayout *layout_old,
|
|
|
|
struct bContext *C) ATTR_NONNULL();
|
|
|
|
bool ED_workspace_layout_cycle(
|
|
|
|
struct WorkSpace *workspace, const short direction,
|
|
|
|
struct bContext *C) ATTR_NONNULL();
|
|
|
|
|
2009-02-04 17:40:50 +00:00
|
|
|
/* anim */
|
2017-11-22 10:52:39 -02:00
|
|
|
void ED_update_for_newframe(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, struct Depsgraph *depsgraph);
|
2010-11-02 09:34:32 +00:00
|
|
|
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_refresh_viewport_fps(struct bContext *C);
|
2012-05-25 12:37:11 +00:00
|
|
|
int ED_screen_animation_play(struct bContext *C, int sync, int mode);
|
2012-05-25 12:56:29 +00:00
|
|
|
bScreen *ED_screen_animation_playing(const struct wmWindowManager *wm);
|
2015-06-05 16:47:01 +02:00
|
|
|
bScreen *ED_screen_animation_no_scrub(const struct wmWindowManager *wm);
|
2008-01-07 18:03:41 +00:00
|
|
|
|
2010-02-12 00:44:26 +00:00
|
|
|
/* screen keymaps */
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_operatortypes_screen(void);
|
|
|
|
void ED_keymap_screen(struct wmKeyConfig *keyconf);
|
Main Workspace Integration
This commit does the main integration of workspaces, which is a design we agreed on during the 2.8 UI workshop (see https://wiki.blender.org/index.php/Dev:2.8/UI/Workshop_Writeup)
Workspaces should generally be stable, I'm not aware of any remaining bugs (or I've forgotten them :) ). If you find any, let me know!
(Exception: mode switching button might get out of sync with actual mode in some cases, would consider that a limitation/ToDo. Needs to be resolved at some point.)
== Main Changes/Features
* Introduces the new Workspaces as data-blocks.
* Allow storing a number of custom workspaces as part of the user configuration. Needs further work to allow adding and deleting individual workspaces.
* Bundle a default workspace configuration with Blender (current screen-layouts converted to workspaces).
* Pressing button to add a workspace spawns a menu to select between "Duplicate Current" and the workspaces from the user configuration. If no workspaces are stored in the user configuration, the default workspaces are listed instead.
* Store screen-layouts (`bScreen`) per workspace.
* Store an active screen-layout per workspace. Changing the workspace will enable this layout.
* Store active mode in workspace. Changing the workspace will also enter the mode of the new workspace. (Note that we still store the active mode in the object, moving this completely to workspaces is a separate project.)
* Store an active render layer per workspace.
* Moved mode switch from 3D View header to Info Editor header.
* Store active scene in window (not directly workspace related, but overlaps quite a bit).
* Removed 'Use Global Scene' User Preference option.
* Compatibility with old files - a new workspace is created for every screen-layout of old files. Old Blender versions should be able to read files saved with workspace support as well.
* Default .blend only contains one workspace ("General").
* Support appending workspaces.
Opening files without UI and commandline rendering should work fine.
Note that the UI is temporary! We plan to introduce a new global topbar
that contains the workspace options and tabs for switching workspaces.
== Technical Notes
* Workspaces are data-blocks.
* Adding and removing `bScreen`s should be done through `ED_workspace_layout` API now.
* A workspace can be active in multiple windows at the same time.
* The mode menu (which is now in the Info Editor header) doesn't display "Grease Pencil Edit" mode anymore since its availability depends on the active editor. Will be fixed by making Grease Pencil an own object type (as planned).
* The button to change the active workspace object mode may get out of sync with the mode of the active object. Will either be resolved by moving mode out of object data, or we'll disable workspace modes again (there's a `#define USE_WORKSPACE_MODE` for that).
* Screen-layouts (`bScreen`) are IDs and thus stored in a main list-base. Had to add a wrapper `WorkSpaceLayout` so we can store them in a list-base within workspaces, too. On the long run we could completely replace `bScreen` by workspace structs.
* `WorkSpace` types use some special compiler trickery to allow marking structs and struct members as private. BKE_workspace API should be used for accessing those.
* Added scene operators `SCENE_OT_`. Was previously done through screen operators.
== BPY API Changes
* Removed `Screen.scene`, added `Window.scene`
* Removed `UserPreferencesView.use_global_scene`
* Added `Context.workspace`, `Window.workspace` and `BlendData.workspaces`
* Added `bpy.types.WorkSpace` containing `screens`, `object_mode` and `render_layer`
* Added Screen.layout_name for the layout name that'll be displayed in the UI (may differ from internal name)
== What's left?
* There are a few open design questions (T50521). We should find the needed answers and implement them.
* Allow adding and removing individual workspaces from workspace configuration (needs UI design).
* Get the override system ready and support overrides per workspace.
* Support custom UI setups as part of workspaces (hidden panels, hidden buttons, customizable toolbars, etc).
* Allow enabling add-ons per workspace.
* Support custom workspace keymaps.
* Remove special exception for workspaces in linking code (so they're always appended, never linked). Depends on a few things, so best to solve later.
* Get the topbar done.
* Workspaces need a proper icon, current one is just a placeholder :)
Reviewed By: campbellbarton, mont29
Tags: #user_interface, #bf_blender_2.8
Maniphest Tasks: T50521
Differential Revision: https://developer.blender.org/D2451
2017-06-01 19:56:58 +02:00
|
|
|
/* workspace keymaps */
|
|
|
|
void ED_operatortypes_workspace(void);
|
2008-01-01 18:29:19 +00:00
|
|
|
|
2008-01-10 17:38:17 +00:00
|
|
|
/* operators; context poll callbacks */
|
2012-05-12 20:39:39 +00:00
|
|
|
int ED_operator_screenactive(struct bContext *C);
|
|
|
|
int ED_operator_screen_mainwinactive(struct bContext *C);
|
|
|
|
int ED_operator_areaactive(struct bContext *C);
|
|
|
|
int ED_operator_regionactive(struct bContext *C);
|
|
|
|
|
|
|
|
int ED_operator_scene_editable(struct bContext *C);
|
|
|
|
int ED_operator_objectmode(struct bContext *C);
|
|
|
|
|
|
|
|
int ED_operator_view3d_active(struct bContext *C);
|
|
|
|
int ED_operator_region_view3d_active(struct bContext *C);
|
|
|
|
int ED_operator_animview_active(struct bContext *C);
|
|
|
|
int ED_operator_timeline_active(struct bContext *C);
|
|
|
|
int ED_operator_outliner_active(struct bContext *C);
|
|
|
|
int ED_operator_outliner_active_no_editobject(struct bContext *C);
|
|
|
|
int ED_operator_file_active(struct bContext *C);
|
|
|
|
int ED_operator_action_active(struct bContext *C);
|
|
|
|
int ED_operator_buttons_active(struct bContext *C);
|
|
|
|
int ED_operator_node_active(struct bContext *C);
|
2013-06-05 19:06:33 +00:00
|
|
|
int ED_operator_node_editable(struct bContext *C);
|
2012-05-12 20:39:39 +00:00
|
|
|
int ED_operator_graphedit_active(struct bContext *C);
|
|
|
|
int ED_operator_sequencer_active(struct bContext *C);
|
2014-02-26 13:21:48 +11:00
|
|
|
int ED_operator_sequencer_active_editable(struct bContext *C);
|
2012-05-12 20:39:39 +00:00
|
|
|
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_console_active(struct bContext *C);
|
|
|
|
|
|
|
|
|
|
|
|
int ED_operator_object_active(struct bContext *C);
|
|
|
|
int ED_operator_object_active_editable(struct bContext *C);
|
|
|
|
int ED_operator_object_active_editable_mesh(struct bContext *C);
|
|
|
|
int ED_operator_object_active_editable_font(struct bContext *C);
|
|
|
|
int ED_operator_editmesh(struct bContext *C);
|
|
|
|
int ED_operator_editmesh_view3d(struct bContext *C);
|
|
|
|
int ED_operator_editmesh_region_view3d(struct bContext *C);
|
|
|
|
int ED_operator_editarmature(struct bContext *C);
|
|
|
|
int ED_operator_editcurve(struct bContext *C);
|
|
|
|
int ED_operator_editcurve_3d(struct bContext *C);
|
|
|
|
int ED_operator_editsurf(struct bContext *C);
|
|
|
|
int ED_operator_editsurfcurve(struct bContext *C);
|
|
|
|
int ED_operator_editsurfcurve_region_view3d(struct bContext *C);
|
|
|
|
int ED_operator_editfont(struct bContext *C);
|
|
|
|
int ED_operator_editlattice(struct bContext *C);
|
|
|
|
int ED_operator_editmball(struct bContext *C);
|
|
|
|
int ED_operator_uvedit(struct bContext *C);
|
2013-04-08 10:03:51 +00:00
|
|
|
int ED_operator_uvedit_space_image(struct bContext *C);
|
2012-05-12 20:39:39 +00:00
|
|
|
int ED_operator_uvmap(struct bContext *C);
|
2012-09-06 23:10:01 +00:00
|
|
|
int ED_operator_posemode_exclusive(struct bContext *C);
|
2012-09-23 02:31:30 +00:00
|
|
|
int ED_operator_posemode_context(struct bContext *C);
|
2012-05-12 20:39:39 +00:00
|
|
|
int ED_operator_posemode(struct bContext *C);
|
2016-11-16 10:39:41 +01:00
|
|
|
int ED_operator_posemode_local(struct bContext *C);
|
2012-06-04 16:42:58 +00:00
|
|
|
int ED_operator_mask(struct bContext *C);
|
2017-10-26 21:40:37 +11:00
|
|
|
int ED_operator_camera(struct bContext *C);
|
2009-02-01 18:07:02 +00:00
|
|
|
|
2008-12-26 19:07:31 +00:00
|
|
|
|
2014-04-02 16:50:06 +06:00
|
|
|
/* Cache display helpers */
|
|
|
|
|
|
|
|
void ED_region_cache_draw_background(const struct ARegion *ar);
|
|
|
|
void ED_region_cache_draw_curfra_label(const int framenr, const float x, const float y);
|
|
|
|
void ED_region_cache_draw_cached_segments(const struct ARegion *ar, const int num_segments, const int *points, const int sfra, const int efra);
|
|
|
|
|
2008-12-10 13:56:54 +00:00
|
|
|
/* default keymaps, bitflags */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define ED_KEYMAP_UI 1
|
|
|
|
#define ED_KEYMAP_VIEW2D 2
|
|
|
|
#define ED_KEYMAP_MARKERS 4
|
|
|
|
#define ED_KEYMAP_ANIMATION 8
|
|
|
|
#define ED_KEYMAP_FRAMES 16
|
|
|
|
#define ED_KEYMAP_GPENCIL 32
|
|
|
|
#define ED_KEYMAP_HEADER 64
|
2009-07-24 12:43:59 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __ED_SCREEN_H__ */
|
2008-01-01 18:29:19 +00:00
|
|
|
|