Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2020-10-02Fix (unreported) design flow in how workspace's relation data are read from ↵Bastien Montagne
.blend file. Relying on pointer addresses across different data-blocks is extremely not recommended (and should be strictly forbidden ideally), in particular in direct_link step of blend file reading. - It assumes a specific order in reading of data, which is not ensured in future, and is in any case a very bad, non explicit, hidden dependency on behaviors of other parts of the codebase. - It is intrinsically unsafe (as in, it makes writing bad code and making mistakes easy, see e.g. fix in rB84b3f6e049b35f9). - It makes advanced handling of data-blocks harder (thinking about partial undo code e.g., even though in this specific case it was not an issue as we do not re-read neither windowmanagers nor worspaces during undo). New code uses windows' `winid` instead as 'anchor' to find again proper workspace hook in windows at read time. As a bonus, it will also cleanup the list of relations from any invalid ones (afaict it was never done previously). Differential Revision: https://developer.blender.org/D9073
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-05-26Cleanup/refactor: Workspace API, boilerplate code, early exitJulian Eisel
* Simplify workspace API a bit * Comment on behavior of workspace-layout relations where exposed in API * Remove annoying getters/setters * Avoid lookups if we can early exit * A NULL check is removed in `direct_link_workspace()` that I don't see a need for. Am not 100% sure though, fingers crossed. In general these changes should improve readability and make things easier to reason about.
2020-03-09Cleanup: WorkSpace: Move to IDTypeInfo and remove unused BKE API.Bastien Montagne
2020-03-02Cleanup: make remaining blenkernel headers work in C++Jacques Lucke
2019-08-25Cleanup: redundant struct declarationsCampbell Barton
2019-05-15Tool System: avoid redundant refreshCampbell Barton
Workspaces refreshes tools multiple times when used by multiple windows. Also improve comments.
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-28Cleanup: sort forward declarations of enum & structCampbell Barton
Done using: source/tools/utils_maintenance/c_sort_blocks.py
2018-09-27Tool System: set a default tool for each modeCampbell Barton
Also clear tools for the default startup file so changes to defaults apply to new files.
2018-07-04Workspaces: store view layer per main window, instead of per workspace.Brecht Van Lommel
It was a bit odd that the scene was stored per window but not the view layer. The reasoning was that you would use different view layers for different tasks. This is still possible, but it's more predictable to switch them both explicitly, and with child window support manually syncing the view layers between multiple windows is no longer needed as often.
2018-06-15Cleanup: G.main removal from 2.8-only code.Bastien Montagne
2018-05-25Fix T55183, fix T55174: crashes with workspace / view layer relation.Brecht Van Lommel
Don't store pointers to ViewLayer in the workspace, only names. Add specific relation type since the generic mechanism makes the code hard to follow. Integrate with pointer restore for undo and library remapping code to avoid data going out of sync. Also add relation automatically if there doesn't exists one yet in BKE_workspace_view_layer_get, because in general it's really hard to ensure it will exist when making arbitrary scene changes. Differential Revision: https://developer.blender.org/D3432
2018-04-26Properties: remove redundant settings from workspaces tab.Brecht Van Lommel
Use render settings and active view layer will be handled elsewhere. Also change icon to not be confusing with render layers. Probably we should get rid of the workspace tab entirely and do it in the user preferences, but that's for later.
2018-04-18Workspaces: remove workspace engine, use 3D viewport draw mode instead.Brecht Van Lommel
ViewRender was removed, which means we can't get the render engine for files saved in 2.8. We assume that any files saved in 2.8 were intended to use Eevee and set the engine to that. A fix included with this is that .blend thumbails now draw with Clay mode, and never Eevee or Cycles. These were drawn with solid mode in 2.7, and should be very fast and not e.g. load heavy image textures. Differential Revision: https://developer.blender.org/D3156
2018-04-18Move transform orientation to sceneCampbell Barton
This was stored in the workspace, selected from the view. Move both to scene since custom orientations are closely related to your scene data.
2018-04-16Depsgraph: remove EvaluationContext, pass Depsgraph instead.Brecht Van Lommel
The depsgraph was always created within a fixed evaluation context. Passing both risks the depsgraph and evaluation context not matching, and it complicates the Python API where we'd have to expose both which is not so easy to understand. This also removes the global evaluation context in main, which assumed there to be a single active scene and view layer. Differential Revision: https://developer.blender.org/D3152
2018-04-13Depsgraph: don't pass evaluation context to update functions.Brecht Van Lommel
The depsgraph now contains all the state needed to evaluate it. Differential Revision: https://developer.blender.org/D3147
2018-04-05Remove workspace object mode, reverts changes w/ 2.8Campbell Barton
This caused too many problems syncing object modes with multiple objects/windows/workspaces, see: D3130 for details.
2018-02-28WorkSpace: UI filtering for add-onsCampbell Barton
Allows for each workspace to have it's own add-ons on display. Filtering for: Panels, Menus, Keymaps & Manipulators. Automatically applies to add-ons at the moment. Access from workspace, toggled off by default once enabled, add-ons can be white-listed. See D3076
2018-02-13Object Mode: remove Scene.obeditCampbell Barton
Add ED_screen_window_find, BKE_workspace_edit_object
2018-02-08Object Mode: move to workspace structCampbell Barton
- Read-only access can often use EvaluationContext.object_mode - Write access to go to WorkSpace.object_mode. - Some TODO's remain (marked as "TODO/OBMODE") - Add-ons will need updating (context.active_object.mode -> context.workspace.object_mode) - There will be small/medium issues that still need resolving this does work on a basic level though. See D3037
2018-02-07Fix error with Main.eval_ctx.object_mode being unsetCampbell Barton
This made vertex/weight/sculpt crash. Add BKE_workspace_update_object_mode which sets the object mode from the workspace. We may want to re-visit exactly when this is set, for now call within wm_event_do_refresh_wm_and_depsgraph.
2017-12-01Workspaces: Store an active view-layer per sceneJulian Eisel
Instead of storing a single active view-layer in the workspace, one is stored for each scene the workspace showed before. With this, some things become possible: * Multiple windows in the same workspace but showing different scenes. * Toggling back and forth scene keeps same active view-layer for each scene. * Activating workspace which didn't show current scene before, the current view-layer is kept. A necessary evil for this is that accessing view-layer and object mode from .py can't be done via workspace directly anymore. It has to be done through the window, so RNA can use the correct scene. So instead of `workspace.view_layer`, it's `window.view_layer` now (same with mode) even though it's still workspace data. Fixes T53432.
2017-11-25Get workspace mode from the workspace view-layerJulian Eisel
While this probably isn't the final solution we'll go with, it's nicer as current one, which was basically broken. So consider this as temporary solution. It also allows testing how changing workspace changes mode & active object, but only by having the workspaces use different view-layers. Decided to remove WorkSpace.mode for now. If we need to bring it back, we'll have to version patch it anyway.
2017-11-23Rename any instance of scene layer or render layer in code with view layerDalai Felinto
The RenderResult struct still has a listbase of RenderLayer, but that's ok since this is strictly for rendering. * Subversion bump (to 2.80.2) * DNA low level doversion (renames) - only for .blend created since 2.80 started Note: We can't use DNA_struct_elem_find or get file version in init_structDNA, so we are manually iterating over the array of the SDNA elements instead. Note 2: This doversion change with renames can be reverted in a few months. But so far it's required for 2.8 files created between October 2016 and now. Reviewers: campbellbarton, sergey Differential Revision: https://developer.blender.org/D2927
2017-11-08Depsgraph: Move storage from single per-scene depsgraph to a hash storageSergey Sharybin
Depsgraph itself is still created fer the whole scene rather than for a single layer, this is to be addressed next. The storage for those dependency graphs is in scene, but now it is a hash indexed by layer. In the future we can extend hash key to include extra information (workspace? window?).
2017-10-17Merge branch 'master' into blender2.8Campbell Barton
2017-10-16Workspace: Move engines to workspace and Properties Editor cleanupDalai Felinto
Engine is not stored in WorkSpaces. That defines the "context" engine, which is used for the entire UI. The engine used for the poll of nodes (add node menu, new nodes when "Use Nodes") is obtained from context. Introduce a ViewRender struct for viewport settings that are defined for workspaces and scene. This struct will be populated with the hand-picked settings that can be defined per workspace as per the 2.8 design. * use_scene_settings * properties editor: workshop + organize context path Use Scene Settings ================== For viewport drawing, Workspaces have an option to use the Scene render settings (F12) instead of the viewport settings. This way users can quickly preview the final render settings, engine and View Layer. This will affect all the editors in that workspace, and it will be clearly indicated in the top-bar. Properties Editor: Add Workspace and organize context path ========================================================== We now have the properties of: Scene, Scene > Layer, Scene > World, Workspace [Scene | Workspace] > Render Layer > Object [Scene | Workspace] > Render Layer > Object > Data (...) Reviewers: Campbell Barton, Julian Eisel Differential Revision: https://developer.blender.org/D2842
2017-06-13Woarkspace: Remove residue of hidden typeSergey Sharybin
There is no reason to be special for workspace and go against other design decision in Blender. If something like this is going to become a common practice in Blender it should be well thought and well tested, including tests of all supported compilers and configurations. This feature was relying on type re-definition, which is not only confusing but also available in C11 only.
2017-06-01Move custom transform orientations to workspaceJulian Eisel
This commit moves the list of transform orientations from scenes to workspaces. Main reasons for this are: * Transform orientations are UI data and should not be stored in the scene. * Introducion of workspaces caused some (expected) glitches with transform orientations. Mainly when removing one. * Improves code. More technically speaking, this commit does: * Move list of custom transform orientations from Scene to WorkSpace struct. * Store active transform orientation index separate from View3D.twmode (twmode can only be set to preprocessor defined values now). * Display custom transform orientation name in header when transforming in it (used to show "global" which isn't really correct).
2017-06-01Main Workspace IntegrationJulian Eisel
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