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-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-14ViewLayer: Lazy sync of scene data.Monique Dewanchand
When a change happens which invalidates view layers the syncing will be postponed until the first usage. This will improve importing or adding many objects in a single operation/script. `BKE_view_layer_need_resync_tag` is used to tag the view layer to be out of sync. Before accessing `BKE_view_layer_active_base_get`, `BKE_view_layer_active_object_get`, `BKE_view_layer_active_collection` or `BKE_view_layer_object_bases` the caller should call `BKE_view_layer_synced_ensure`. Having two functions ensures that partial syncing could be added as smaller patches in the future. Tagging a view layer out of sync could be replaced with a partial sync. Eventually the number of full resyncs could be reduced. After all tagging has been replaced with partial syncs the ensure_sync could be phased out. This patch has been added to discuss the details and consequences of the current approach. For clarity the call to BKE_view_layer_ensure_sync is placed close to the getters. In the future this could be placed in more strategical places to reduce the number of calls or improve performance. Finding those strategical places isn't that clear. When multiple operations are grouped in a single script you might want to always check for resync. Some areas found that can be improved. This list isn't complete. These areas aren't addressed by this patch as these changes would be hard to detect to the reviewer. The idea is to add changes to these areas as a separate patch. It might be that the initial commit would reduce performance compared to master, but will be fixed by the additional patches. **Object duplication** During object duplication the syncing is temporarily disabled. With this patch this isn't useful as when disabled the view_layer is accessed to locate bases. This can be improved by first locating the source bases, then duplicate and sync and locate the new bases. Will be solved in a separate patch for clarity reasons ({D15886}). **Object add** `BKE_object_add` not only adds a new object, but also selects and activates the new base. This requires the view_layer to be resynced. Some callers reverse the selection and activation (See `get_new_constraint_target`). We should make the selection and activation optional. This would make it possible to add multiple objects without having to resync per object. **Postpone Activate Base** Setting the basact is done in many locations. They follow a rule as after an action find the base and set the basact. Finding the base could require a resync. The idea is to store in the view_layer the object which base will be set in the basact during the next sync, reducing the times resyncing needs to happen. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15885
2022-09-14Adding `const Scene*` parameter in many areas.Monique Dewanchand
Related to {D15885} that requires scene parameter to be added in many places. To speed up the review process the adding of the scene parameter was added in a separate patch. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15930
2022-09-01Cleanup: Remove/replace View Layer macros.Monique Dewanchand
This patch is a cleanup required before refactoring the view layer syncing process {T73411}. * Remove FIRSTBASE. * Remove LASTBASE. * Remove BASACT. * Remove OBEDIT_FROM_WORKSPACE. * Replace OBACT with BKE_view_layer_active_object. * Replace OBEDIT_FROM_VIEW_LAYER with BKE_view_layer_edit_object. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15799
2022-08-27Cleanup: pass notifiers as constCampbell Barton
2022-08-09Cleanup: use own username in code-comment tagsCampbell Barton
2022-06-03Cleanup: spelling in commentsCampbell Barton
2022-05-13Cleanup: spelling in comments, capitalize tagsCampbell Barton
Also add missing task-ID reference & remove colon after \note as it doesn't render properly in doxygen.
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-03Fix T66913: undo after frame-change doesn't refresh properlyCampbell Barton
Use the ID.recalc flag to detect when updates after frame-change is needed. Since comparing the last calculated frame doesn't take undo into account (see code-comment for details). `ID_RECALC_AUDIO_SEEK` has been renamed to `ID_RECALC_FRAME_CHANGE` since this is not only related to audio however internally this flag is still categorized in `NodeType::AUDIO`. Reviewed By: sergey Ref D13942
2021-12-10Cleanup: move public doc-strings into headers for various API'sCampbell Barton
Some doc-strings were skipped because of blank-lines between the doc-string and the symbol and needed to be moved manually. - 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. Ref T92709
2021-12-08Cleanup: move public doc-strings into headers for 'editors'Campbell Barton
Ref T92709
2021-12-02Fix T93410: Crash hiding a region from Python used by a popoverCampbell Barton
Close all active buttons when hiding a region as this can be called from Python a popover is open from that region. Failure to do this causes the popover to read from the freed button. Also rename UI_screen_free_active_but to UI_screen_free_active_but_highlight since it only frees highlighted buttons.
2021-11-22UI: Use a map for block name lookupsErik
Use a map to speed up search for UI block names. Time to redraw the node editor was decreased from around 75-120ms to 40-70ms in a tree with many Geometry Nodes. Differential Revision: https://developer.blender.org/D13225
2021-10-27WM: de-duplicate cursor motion checks for selection pickingCampbell Barton
Replace local static mouse coordinate storage with a single function. also resolve inconsistencies. - Edit-mesh selection used equality check (ignoring `U.move_threshold`). - Motion to clear tooltips checked the value without scaling by the DPI. Also prevent the unlikely case of the previous motion check matching a different area by resetting the value when the active region changes.
2021-10-22Fix T92357: assert changing scenes while in edit modeCampbell Barton
ScrArea.runtime.tool needs to be updated after switching scenes.
2021-10-22Fix crash when creating a new window failsCampbell Barton
Also add operator error report.
2021-10-20Cleanup: use an array for wmEvent cursor position variablesAaron Carlisle
Use arrays for wmEvent coordinates, this quiets warnings with GCC11. - `x, y` -> `xy`. - `prevx, prevy` -> `prev_xy`. - `prevclickx, prevclicky` -> `prev_click_xy`. There is still some cleanup such as using `copy_v2_v2_int()`, this can be done separately. Reviewed By: campbellbarton, Severin Ref D12901
2021-10-18Cleanup: spelling in commentsCampbell Barton
2021-10-05XR: Add runtime window area for XR eventsPeter Kim
This adds an offscreen View3D window area for the VR view in order to execute XR events/operators in the proper context. The area is created as runtime data before XR events are dispatched and set as the active area during XR event handling. Since the area is runtime-only, it will not be saved in files and since the area is offscreen, it will not interfere with regular window areas. The area is removed with the rest of the XR runtime data on exit, file read, or when stopping the VR session. Note: This also adds internal types (EVT_DATA_XR, EVT_XR_ACTION) and structs (wmXrActionData) for XR events. Reviewed By: Severin Differential Revision: https://developer.blender.org/D12472
2021-08-20Cleanup: use "free_data" suffix when the argument isn't freedCampbell Barton
Avoid API misuse that caused leaks in T90791 & 2788b0261cb7d33a2f6f2978ff4f55bb4987edae.
2021-08-06Cleanup: use MEM_SAFE_FREE macroCampbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-29Fix T89526: "Toggle Maximize Area" clears context screen propertiesCampbell Barton
Removed in b787581c9cda5a0cd4bc8b03bbdd1f9832438db4 as it's comment noted it was bad code, the reason for it's necessity was no longer valid. Add this back with comment explaining why it's still needed.
2021-06-20Cleanup: use eSpace_Type enum typeCampbell Barton
2021-06-16Screen: simplify internal logic for new full-screen areasCampbell Barton
Creating a new full screen area had it's area initialized as empty, updating the screen then set the area to a 3D view (as a fallback), before the actual area type was set. This made setting the intended space-type run the 3D views exit callback on a 3D view without a View3D struct allocated, which the exit callback needed to account for. Resolve by calling ED_screen_change after the area type has been set.
2021-06-11Render Window as Non-Child on Win32 platformHarley Acheson
This patch makes the "Render" window a top-level window, not a child of the main window, which was the case in blender versions prior to 2.93. This means it is no longer "on top", nor is the icon grouped on the taskbar in the same way, but you can Alt-Tab between it and the main window. This change only affects the Windows platform as the other platforms behave this way. See D11576 for links to negative feedback that prompts this change. Differential Revision: https://developer.blender.org/D11576 Reviewed by Brecht Van Lommel
2021-05-14Cleanup: use enum types for screen direction variablesCampbell Barton
The term direction was used in 3 different ways in screen editing code, making it hard to follow: - 0-3 for as magic numbers mapped to [west,north,east,south]. - `h`, `v` characters for [horizontal,vertical] axes. - Cycle direction SPACE_CONTEXT_CYCLE_PREV, SPACE_CONTEXT_CYCLE_NEXT The following changes have been made: - Add `eScreenDir` for [west,north,east,south], use variable name `dir`. - Add `eScreenAxis` for [horizontal,vertical] values, use variable name `dir_axis`. - Add `eScreenCycle` for existing enum `SPACE_CONTEXT_CYCLE_{PREV/NEXT}`. - Add macros `SCREEN_DIR_IS_VERTICAL(dir)`, `SCREEN_DIR_IS_HORIZONTAL(dir)`. Replacing `ELEM(dir, 1, 3)`, `ELEM(dir, 0, 2)`. - Move `ED_screen_draw_join_highlight`, `ED_screen_draw_split_preview` to `screen_intern.h`. Reviewed By: Severin Ref D11245
2021-05-13Cleanup: use boolean argumentCampbell Barton
2021-05-13UI: Improved "Area Close" Neighbor SelectionHarley Acheson
The new "Close Area" operator can let any neighbor replace the area to be closed. This patch improves the selection of the best, and most- aligned, neighbor. It maximizes the ratio of the shared edge lengths, rather than minimize the absolute amount of misalignment. This follows our expectations closer because it takes into account the relative sizes of the areas and their edges. see D11143 for details and examples. Differential Revision: https://developer.blender.org/D11143 Reviewed by Campbell Barton
2021-04-26Cleanup: spellingCampbell Barton
2021-04-26Cleanup: inconsistent naming for screen editing variables & argsCampbell Barton
2021-04-23UI: Join or Close Any Screen AreaHarley Acheson
Corner action zones allow joining any neighbors. New 'Area Close' operator. Improved Header Context Menu. Differential Revision: https://developer.blender.org/D8084 Reviewed by Campbell Barton
2021-03-23WM: don't set the area when toggling full-screenCampbell Barton
The stated reason for this no longer applies.
2021-02-22UI: Simplify Window CreationHarley Acheson
Refactoring: WM_window_open() that can open different types of windows. 'New Window' with simplified layout. Differential Revision: https://developer.blender.org/D10419 Reviewed by Brecht Van Lommel
2021-02-14Cleanup: spellingCampbell Barton
2021-02-05Cleanup: correct spelling in commentsCampbell Barton
2021-02-01Fix T84780: Corrupt screen layout when loading file with area full-screenJulian Eisel
This could happen with files saved before ef4aa42ea4ff, so before global areas were written to .blend files. We would just always add the top- and status-bar, even though the screen wasn't supposed to have them. I'm not entirely sure what caused the further issues observed there, most code should probably handle the case fine still. But apparently something didn't. Steps to reproduce were: * Open Blender from before ef4aa42ea4ff (e.g 2.91 release) * In 3D View, View > Area > Toggle Fullscreen Area * Save the file * Open the saved file (can be in newer version too) The fullscreen is corrupt now, especially noticable after duplicating the workspace.
2020-12-15Fix various issues with temporary, maximized File BrowsersJulian Eisel
If Preferences > Interface > Temporary Editors > File Browser is set to "Maximized Area", opening a File Browser from a File or Asset Browser as regular editor would cause some issues. For example after closing the temporary File Browser, the regular browser would take over the file path and display settings from the temporary one. This is because they used to share the same area data. Some similar issues may have happend with temporary image editors. Now, this commit finally separates the space data of temporary maximized editors from the regular ones. So the editor data is entirely independent now, as it should be.
2020-12-15Fix crash opening maximized File Browser from Asset BrowserJulian Eisel
If Preferences > Interface > Temporary Editors > File Browser is set to "Maximized Area", opening a File Browser from an Asset Browser would cause the new maximized editor to be an Asset Browser. Exiting it again would crash. This fixes the wrong behavior and the crash. There's still an issue with exiting the editor again, it stays a File Browser then and doesn't go back to being an Asset Browser. That's to be fixed separately.
2020-11-30Cleanup: Use "region" for ARegion variable namesHans Goudey
As proposed in T74432 and already implemented in several commits, "region" is the preferred name for `ARegion` variables, rather than any variant of "ar". This commit changes a few "ar" variables that have popped up over time and also adjusted names of variants like "arnew".
2020-11-06Cleanup: use ELEM macroCampbell Barton
2020-10-17Cleanup: Reduce variable scope in screen directoryHans Goudey
Also return early and use LISTBASE_FOREACH in a few places
2020-10-05Fix T80282: Playback start delayed with AV syncRichard Antalik
If current frame is set to before start frame, with AV sync there is delay when playback is started. Tag scene with ID_RECALC_AUDIO_SEEK, so audio playback starts from correct position. Reviewed By: sergey Differential Revision: https://developer.blender.org/D8809
2020-09-07Cleanup: spellingCampbell Barton
Also correct wrapped lines of example code in threads.cc.
2020-08-21Cleanup: Use LISTBASE_FOREACH in editors/screen directoryHans Goudey
Differential Revision: https://developer.blender.org/D8653
2020-08-20Depsgraph: refactor tagging after time changesJacques Lucke
This reverts {rB1693a5efe91999b60b3dc0bdff727473b3bd00bb} and implements an alternative solution. The old patch had the problem that the depsgraph would always evaluate at the current frame of the original scene (even when `DEG_evaluate_on_framechange` was used). Now it is possible to evaluate the depsgraph at a specific frame without having to change the original scene. Reviewers: sergey, sybren Differential Revision: https://developer.blender.org/D8616
2020-08-20Revert "Cleanup: Use LISTBASE_FOREACH in editors screen directory"Hans Goudey
This reverts commit 52f40bcff21b285b7eaa21aaa9c6c7b9d6fa8669. Apologies for the noise. I caught a problem with this that I hadn't before. I will commit later after thorough testing.
2020-08-20Cleanup: Use LISTBASE_FOREACH in editors screen directoryHans Goudey
Differential Revision: https://developer.blender.org/D8653
2020-08-18Cleanup: remove bmain argument from BKE_scene_graph_update_for_newframeJacques Lucke
Reviewers: sergey Differential Revision: https://developer.blender.org/D8613