Commit Graph

6124 Commits

Author SHA1 Message Date
Campbell Barton
8aff65daf2 Cleanup: naming for GPUSelectResult
Prefer the name 'hit_result' since 'result' was sometimes used for
a vector of GPUSelectResult and is often used a functions return value.

Use hit_results for the span/vector and hit_result for a single hit.

Also assign struct members for new GPUSelectResult as it reads better
and avoids depending on struct order.
2023-12-01 09:45:02 +11:00
Jesse Yurkovich
abf59eb23a Selection: Remove limit on number of items which can be selected at once
This removes the long-standing static limit for the selection buffer in
favor of a dynamic approach.

It replaces the static array with our Vector type where the inline
buffer provides parity with existing code while also providing the
ability to grow as necessary.

Fixes #102487, #109178, #112350, #112493, and https://projects.blender.org/blender/blender-manual/issues/102485

See PR for further notes and links to the different limits remaining.
Pull Request: https://projects.blender.org/blender/blender/pulls/112491
2023-11-30 21:27:15 +01:00
Bastien Montagne
fe3cb11ae4 BKE_lib: Convert BKE_lib_remap and lib_intern headers to be fully C++. 2023-11-30 19:51:22 +01:00
Campbell Barton
15db0cb446 Cleanup: use style for doxygen comment blocks 2023-11-30 14:15:11 +11:00
Campbell Barton
3b5031f1cb Cleanup: use 'r_' prefix for output arguments, order last
Also clarify some naming.
2023-11-30 10:42:18 +11:00
Hans Goudey
7e3ba529ea Cleanup: Move four blenkernel headers to C++ 2023-11-28 16:05:12 -05:00
Julian Eisel
e3b3399bcb Cleanup: Add constructor/destructor for drag data to avoid includes
`wmDragActiveDropState` contains a `bContextStore` unique pointer, so
when constructing/destructing an object of this type `BKE_context.hh`
had to be included. It wouldn't be obvious why this include is necessary
in some cases. And the pointer is otherwise managed internally in the
source file, so the need for this include shouldn't bleed into other
files.

Make sure the unique pointer construction/destruction happens in the
translation unit of the source file that otherwise also manages it.

Avoids include in #107230.
2023-11-28 15:26:39 +01:00
Bastien Montagne
dad1eea511 Move BKE_main_idmap and BKE_main_namemap to be fully cpp headers.
NOTE: `BKE_main.h` is currently used by `writeffmpeg.c`, so not trivial
to make it a full CPP header file for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/115485
2023-11-27 18:09:27 +01:00
Ray Molenkamp
1b6cd937ff Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115425
2023-11-25 23:37:24 +01:00
Ray Molenkamp
6b70c04724 Cleanup: CMake: Modernize bf_depsgraph dependencies
Pretty straightforward

- Remove any bf_depsgraph paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115422
2023-11-25 22:51:59 +01:00
RedMser
bf97bc634f Fix: remove leading space in window title
Remove leading space in window title for saved files.

Pull Request: https://projects.blender.org/blender/blender/pulls/114704
2023-11-24 18:57:09 +01:00
Ray Molenkamp
ae25298774 Cleanup: CMake: Modernize bf_blenfont dependencies
Pretty straightforward

- Remove any bf_blenfont paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115365
2023-11-24 18:29:09 +01:00
Ray Molenkamp
b683bcc46c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any bf_intern_clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115323
2023-11-24 17:12:24 +01:00
Jason Fielder
18f7d158fe GPU: cleanup texture view usage flags
Texture usage flag `GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW`
was originally implemented and used too conservatively for many
cases in which the underlying API flags were not required.

Renaming to `GPU_TEXTURE_USAGE_FORMAT_VIEW` to reflect
the only essential use case for when a texture view is initialized with
a different texture format to the source texture. Texture views can
still be created without this flag when mip range or base level is
adjusted,

This flag is still required by stencil views and internally by the Metal
backend for certain feature support such as SRGB render toggling.

Patch also includes some small changes to the Metal backend to
adapt to this new compatibility and correctly capture all texture view
use-cases.

Related to #115269

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/115300
2023-11-24 15:21:00 +01:00
Hans Goudey
3d57bc4397 Cleanup: Move several blenkernel headers to C++
Mostly focus on areas where we're already using C++ features,
where combining C and C++ APIs is getting in the way.

Pull Request: https://projects.blender.org/blender/blender/pulls/114972
2023-11-16 11:41:55 +01:00
Pratik Borhade
920d9a9165 Fix #114758: keep text field empty for global search
Revert cea02c15f8. This will fix the issue
mentioned in #114758 and it will also allow user to see recent
searches in the list below the search box (F3).

Pull Request: https://projects.blender.org/blender/blender/pulls/114774
2023-11-14 12:31:55 +01:00
Miguel Pozo
f32699369d Merge branch 'blender-v4.0-release' 2023-11-13 15:36:27 +01:00
Miguel Pozo
aef7a17aa5 Fix #114189: Workbench: VR Session crashes on exit
Ensure there's a valid GPU context when freeing a wm_surface.

Pull Request: https://projects.blender.org/blender/blender/pulls/114795
2023-11-13 15:35:11 +01:00
Campbell Barton
7d99be77f7 Cleanup: rename data -> ghost_data in wm_playanim
Follow naming convention used elsewhere in wm_playanim.cc.
2023-11-11 19:52:30 +11:00
Campbell Barton
536e5323f5 Cleanup: suppress UBSAN undefined behavior warnings 2023-11-09 17:28:39 +11:00
Campbell Barton
8ee209cb77 Fix #114614: Reload scripts leaks memory
Address regression in [0] which allowed wmKeyMapItem::properties to
remain set when a valid wmKeyMapItem::ptr can't be created because the
wmOperatorType isn't available (temporarily in the case of reloading).

Resolve by freeing wmKeyMapItem::properties when the `ptr` isn't set.

Also add null pointer check not to assume wmKeyMapItem::properties
implies an allocated wmKeyMapItem::ptr. Something which is already
accounted for everywhere else.

[0]: 08e5f94a70
2023-11-09 15:48:07 +11:00
Campbell Barton
33e6e5aed1 Fix #114614: Reload scripts leaks memory
Also add null pointer check not to assume wmKeyMapItem::properties
implies an allocated wmKeyMapItem::ptr. Something which is already
accounted for everywhere else.
2023-11-09 15:37:40 +11:00
Campbell Barton
59264115ce Merge branch 'blender-v4.0-release' 2023-11-09 14:52:29 +11:00
Campbell Barton
7e12d92f40 Fix invalid value for ENUM_OPERATORS(...) macro
Use defines for multiple flags.
2023-11-09 14:51:33 +11:00
Campbell Barton
704985152e Refactor: initialize IMB after parsing settings
Avoid awkward kludges with IMB_init/exit & IMB_ffmpeg_init calls.

The animation player was responsible for calling IMB_exit, not IMB_init,
this complicated drag & drop which needed to re-internalize IMB before
returning.

Delay initializing IMB since none of the other argument handlers
depend on it, make wm_main_playanim_intern responsible for calling
both initialization & exit calls for IMB.

Also expand code comments for ARG_PASS_SETTINGS.
2023-11-09 13:58:00 +11:00
Campbell Barton
368b38be37 Merge branch 'blender-v4.0-release' 2023-11-09 13:07:44 +11:00
Campbell Barton
609ac5e378 Fix crash dragging images into the animation player (again)
This was fixed by [0] however that fix didn't account for IMB
sometimes freeing GPU resources created by color management
(resolved by [1] which effectively reverted [0]).

Resolve by re-initializing IMB in the case of drag & drop.

[0]: 51467b0611
[1]: 05c56603a9
2023-11-09 12:52:14 +11:00
Campbell Barton
58ea0e051f Cleanup: spelling in comments 2023-11-09 09:54:28 +11:00
Jesse Yurkovich
c6b5bb3d89 Merge branch 'blender-v4.0-release' 2023-11-07 18:31:59 -08:00
Jesse Yurkovich
8178b12af4 Windows: Remove wait for key-press in --debug mode
This was initially added a long time ago[1] to help with certain exit
behavior while running under a debugger. However, this shouldn't be
necessary any longer.

More importantly, tests have started to use the `--debug` option[2].
Somehow the bots are fine, but anyone running the tests locally on
Windows will experience what looks like a hang; unless they press a key
to allow the tests to continue.

[1] 1cc19c6993
[2] The `blendfile_versioning` test

Pull Request: https://projects.blender.org/blender/blender/pulls/114605
2023-11-08 03:30:42 +01:00
Brecht Van Lommel
7618d4a0ac Merge branch 'blender-v4.0-release' into main 2023-11-07 20:32:33 +01:00
Jason Fielder
05c56603a9 Fix #114192: Resolve animation player greying out on resize in Metal
Standalone animation player has inconsistent GPU context activation
paradigm compared with standard rendering paths. The Metal backend
utilises the context activation step to refresh target window swapchains
from within the GHOST module.

This PR adds activation and deactivation calls, and also aims to clean up
GPU_render_begin/end setup to ensure all paths are covered.

Also resolves a bug upon shutdown wherein GPU resources which may
be tied to a GPU context are released during IMB_exit(), which is called
after GPU context destruction.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/114573
2023-11-07 15:35:42 +01:00
Campbell Barton
611930e5a8 Cleanup: use std::min/max instead of MIN2/MAX2 macros 2023-11-07 16:33:19 +11:00
Campbell Barton
aaf05c2497 Cleanup: various C++ changes (use nullptr, function style casts) 2023-11-07 11:35:16 +11:00
Bastien Montagne
d6e1a6d616 Merge branch 'blender-v4.0-release' 2023-11-03 13:01:07 +01:00
Bastien Montagne
9c2164ba7c Fix #114430: UI: Blender no longer displays a warning for too new .blends
Root of the issue was that a1d7ec7139 (from !110109, new comptibility
handling) missed to update code of `handle_subversion_warning`, file
version numbers should be checked here now, not the minversion ones.

On top of that, this report has been changed to a `RPT_WARNING` instead
of a `RPT_ERROR`, and reports 'print level' for file reading was set to
`WARNING` level way too late to have any effect in existing code...
2023-11-03 12:55:29 +01:00
Richard Antalik
4d37fb80b1 Cleanup: Convert VSE headers from .h to .hh 2023-11-03 01:33:54 +01:00
Brecht Van Lommel
39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
The last good commit was 8474716abb.

After this commits from main were pushed to blender-v4.0-release. These are
being reverted.

Commits a4880576dc from to b26f176d1a that happend afterwards were meant for
4.0, and their contents is preserved.
2023-10-30 21:40:35 +01:00
Lukas Tönne
9c8daeb8c9 Fix WM_draw_region_free function declaration.
02fb605f removed the `hide` argument but did not update the WM_api.hh
header.
2023-10-30 13:48:22 +01:00
Julian Eisel
02fb605f8a Cleanup: Don't unset region visibility in unrelated WM function
`WM_draw_region_free()` should manage region-draw data, and not change
region state. This should be done by normal region state management
functions. Especially for a flag like `ARegion::visible` which is just
the cached result of the region's visibility evaluation, not the proper
way to actualy manage the region visibility.
2023-10-30 12:40:00 +01:00
Campbell Barton
dffee8b323 Revert "Revert "Fix #112441: Restore Key Map Item does not restore the active property""
This reverts commit 0f36ac4e66.

This revert was only done for testing and wasn't ment to be pushed.
2023-10-29 20:08:39 +11:00
Brecht Van Lommel
d7c2ef16fe Merge branch 'blender-v4.0-release' 2023-10-26 15:51:19 +02:00
Douglas Paul
c50b682858 Fix #114156: animation player assert on launch on macOS
Adds missing calls to GPU_render_begin and GPU_render_end,
required for Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/114157
2023-10-26 15:50:20 +02:00
Brecht Van Lommel
3832059c61 Merge branch 'blender-v4.0-release' into main 2023-10-25 16:21:13 +02:00
Brecht Van Lommel
a5cf5a00fb Fix #113849: animation player crash on launch on macOS
GPU backend detection was missing, causing it to try using the
non-existent OpenGL backend.

Thanks to Douglas Paul for helping identify the problem.
2023-10-25 16:19:44 +02:00
Campbell Barton
dbd7c5f35a WM: reduce noisy logging storing/loading operator properties
Don't log wm.operator operator properties when no properties
are stored/loaded, this was noisy, especially for the
INFO_OT_reports_display_update operator when runs from a timer.
2023-10-25 16:01:45 +11:00
Campbell Barton
be9b604190 WM: use a fake clipboard when simulating input
Allow simulated interactions to run without clobbering the users
clipboard text.
2023-10-25 15:51:22 +11:00
Campbell Barton
15692501b2 Merge branch 'blender-v4.0-release' 2023-10-24 23:35:15 +11:00
Campbell Barton
0f36ac4e66 Revert "Fix #112441: Restore Key Map Item does not restore the active property"
This reverts commit bb39f4fa41.
2023-10-24 23:35:06 +11:00
Campbell Barton
cdbde7d941 Fix #113603: User modified key-map preferences for add-ons don't load
Regression from [0] where the key-map was attempting to load preferences
for key-map items for add-on operators which were not yet defined.
Resolve by postponing keymap updating until after loading add-ons.

[0]: 6de294a191
2023-10-24 23:32:16 +11:00