Go to file
Julian Eisel fa0f295b53 UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.

Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.

We plan to use this in #102879.

This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences

Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.

Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
  This patch makes it disappear entirely.

## Implementation

- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
.gitea Merge branch 'blender-v3.5-release' into main 2023-03-07 13:23:43 +01:00
.github Docs: change Git URLs to point projects.blender.org instead of git.blender.org 2023-02-07 14:23:05 +01:00
build_files Cycles: Upgrade to new Embree 4 while staying compatible with Embree 3 2023-04-05 11:03:06 +02:00
doc Merge branch 'blender-v3.5-release' 2023-03-07 20:06:05 -05:00
extern Externals/IO: update fast_float.h to latest version 2023-03-31 11:03:13 +03:00
intern Cleanup: correct comment, quiet warnings 2023-04-05 20:11:08 +10:00
locale Updated translations from SVN trunk (r6419). 2023-04-03 12:58:50 +02:00
release Fix Snap package error on startup in older Linux version 2023-04-03 17:32:35 +02:00
scripts I18n: fix add-on extraction when UI code appears in __init__.py 2023-04-04 10:07:02 +02:00
source UI: Region polling support 2023-04-05 15:30:32 +02:00
tests Fix Cycles Metal failing when run in parallel, always run serial 2023-03-30 19:46:49 +02:00
tools Cleanup: spelling in comments 2023-04-05 14:39:51 +10:00
.clang-format Clang-Format: Allow empty functions to be single-line 2023-03-29 16:50:54 +02:00
.clang-tidy Clang-tidy: Ignore variable name length and .c/.cc include warnings 2022-05-06 15:26:54 +02:00
.editorconfig pyproject: add configuration for autopep8 2022-04-22 10:13:39 +10:00
.git-blame-ignore-revs
.gitignore Ignore build files for VS and VS Code 2023-03-07 17:38:34 +01:00
CMakeLists.txt Cleanup: remove references to the Blender Game Engine Player 2023-04-04 17:26:37 +10:00
COPYING
GNUmakefile Re-design of submodules used in blender.git 2023-02-21 16:39:58 +01:00
make.bat make.bat: adjust for recent submodule changes 2023-03-16 17:51:12 -06:00
pyproject.toml pyproject: remove tools/pyproject.toml 2023-03-01 22:18:28 +11:00
README.md Update references to the new projects platform and main branch 2023-02-07 14:18:19 +01:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.