Commit Graph

132969 Commits

Author SHA1 Message Date
Hans Goudey ca49998049 Cleanup: Make format 2024-02-15 11:36:28 -05:00
Hans Goudey af9709089e Cleanup: Remove unnecessary set curve type optimization
Now that attributes use implicit sharing, copying CurvesGeometry
is relatively cheap, and the complexity of this function isn't worth
the remaining optimization of avoiding user count updates.
2024-02-15 11:35:33 -05:00
Hans Goudey 1bf6d8b0b9 WM: Move report list to runtime struct
These reports were embedded in the window manager DNA,
but they were always cleared when reading it from files. It's clearer
to just not store the reports in files at all. I also moved the reports
initialization and freeing to the constructor and destructor of the
runtime class.

This is the only place `ReportList` was embedded in DNA, so
after this we can move that to use C++ features if we want.

Pull Request: https://projects.blender.org/blender/blender/pulls/118329
2024-02-15 16:42:35 +01:00
YimingWu b661b368c4 GPv3: Length modifier
This ports the length modifier to Grease Pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/117124
2024-02-15 16:37:54 +01:00
Sebastian Parborg 8a388a39ea Fix #118276: IDs were remapped by mistake when copying in the VSE
All IDs in the current bmain were remapped while it should have only
been done for IDs in the dummy scene created for the copy operation.
2024-02-15 16:31:30 +01:00
Omar Emara 49faea5f36 Fix #111345: Compositor uses entire viewport in camera view
The compositor assumes the entire viewport as its compositing space even
in camera view. The current design decision was to limit the compositing
space by the camera region only if the camera passepartout is opaque,
that is, areas outside of the camera are not visible.

This patch changes that behavior to always limit the compositing space
by the camera region. The downside is that areas outside of the camera
will be left uncomposited.

This is useful to match viewport compositing to final render compositing
in terms of maintaining the same space, but not necessarily the same
resolution. However, this still has the limitation that space will be
different when the camera region intersects the viewport, since we only
composite their intersection in that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/118241
2024-02-15 15:46:34 +01:00
Raul Fernandez ed6f8c5b86 Fix #81948: Sculpt mode Annotation tool cursor conflict
This fix checks if the annotation tool is active in `bool SCULPT_mode_poll_view3d(bContext *C)` to hide the sculpt cursor .

Pull Request: https://projects.blender.org/blender/blender/pulls/118255
2024-02-15 15:28:16 +01:00
Aras Pranckevicius b4c6c69632 ImBuf: do not clear newly allocated image pixels when not needed
In some/many cases, an `ImBuf` is allocated, and all the pixels are
immediately filled by some code. Doing the memory clear within allocation
is just memory traffic for no good reason.

Add a flag to skip initialization of ImBuf pixels (IB_uninitialized_pixels)
and use that in some parts of VSE effects/rendering/cache/scopes, as well
as image loading code.

Rendering out VSE movie, on Windows/VS2022/Ryzen5950X:
- Sprite Fright: 443sec -> 414sec (takes 93% of previous time)
- Gold previs: 367sec -> 325sec (takes 88% of prev time)

Pull Request: https://projects.blender.org/blender/blender/pulls/118321
2024-02-15 14:54:57 +01:00
YimingWu 76b0976500 GPv3: Multiple Strokes Modifier
This migrates the multiple strokes modifier to Grease Pencil v3.

Pull Request: https://projects.blender.org/blender/blender/pulls/117796
2024-02-15 14:19:50 +01:00
Pratik Borhade 43996a54cf GPv3: Lock/Unlock All Layers
Port the legacy lock/unlock all layers operator from GPv2.

Pull Request: https://projects.blender.org/blender/blender/pulls/118259
2024-02-15 12:14:17 +01:00
Omar Emara 4780cd3368 Fix: GPU compositor ignores border region
The GPU compositor does not take the border region into consideration,
which means it reads more than it should, leading to corruption. Fix
this by taking the border region into account when computing render
width and height.
2024-02-15 12:56:16 +02:00
Campbell Barton 7e66026fa0 Cleanup: odd doc-string formatting, match argument names in headers
Quiet argument name mis-match warning.
Assert that WM_event_timer_add takes a timer event type.
2024-02-15 21:31:08 +11:00
Jacques Lucke c1c3a4e45d Merge branch 'blender-v4.1-release' 2024-02-15 11:29:31 +01:00
Campbell Barton 67481dcd47 Merge branch 'blender-v4.1-release' 2024-02-15 21:22:56 +11:00
Campbell Barton 55adfdc7af Merge branch 'blender-v4.1-release' 2024-02-15 21:22:52 +11:00
Jacques Lucke 590e4652b6 Fix #118211: clarify use cases of layout panels in api docs
We could support layout panels in sublayouts like boxes eventually,
but for now this is out of scope.
2024-02-15 11:21:11 +01:00
Campbell Barton 4b7d44d015 Fix incorrect use of sizeof() for Wayland
The size of the string in bytes happened to match the the pointer size
on 64bit systems, nevertheless the logic was wrong would would fail on
32bit systems. Also use a character to search the string instead of a
single character string.
2024-02-15 20:56:45 +11:00
Sergey Sharybin 20145ea51f Cleanup: Unused variable in release builds
Pull Request: https://projects.blender.org/blender/blender/pulls/118312
2024-02-15 10:41:17 +01:00
Aras Pranckevicius ffbc90874b ffmpeg: cache swscale contexts instead of re-creating them
ffmpeg's libswscale is used to do RGB<->YUV conversions on movie reading
and writing. The "context" for the scale operation was being created
and destroyed for each movie clip / animation. Now, maintain a cache
of the scale contexts instead.

E.g. in Gold edit, it only ever needs two contexts (one for reading
source movie clips since they are all exactly the same resolution
and format; and one for rendering the resulting movie).

During playback, on some of the "slow" frames (camera cuts) this
saves 10-20ms (Windows, Ryzen 5950X). Rendering whole movie goes
from 390sec to 376sec.

Pull Request: https://projects.blender.org/blender/blender/pulls/118130
2024-02-15 10:35:02 +01:00
Bastien Montagne 59d59006c4 GPv3: Implement EditMode Undo.
Relatively basic and straightforward implementation.

Further optimizations are possible (and needed), especially regarding
the handling of caches.

Notes:
* All drawings are stored in each undo step. This is needed (also for
  Reference drawings), in case some drawings are added, removed or
  re-ordered between undo steps.
* The whole tree of layers is copied as-is, using the C++ classes copy
  constructors, so they only handle what these constructors copy
  (noticeably, the `Layer` copy constructor does not currently handles
   masks?).
* The active layer pointer is stored and restored by its name.
* The layer customdata is also duplicated using standard `BKE_customdata`
  API.

Pull Request: https://projects.blender.org/blender/blender/pulls/117072
2024-02-15 10:19:52 +01:00
Bastien Montagne 9be522d480 GPv3: Add low-level `resize_drawings` function. 2024-02-15 10:19:50 +01:00
Bastien Montagne 13887fc427 GPv3: Add assignement operator to `LayerGroup` class. 2024-02-15 10:19:50 +01:00
Bastien Montagne f2e481a519 Core: Refactor id_delete.
This commit essentially:
* Remove the 'delete single ID' code path.
  The multi-deletion code has now be around for a long while, so we
  should be able to assume it is mature enough. It is also several times
  faster when deleting a lot of IDs at once.
* Move away from using `LIB_TAG_DOIT` ID tag in internal code, using a
  Set instead to store the IDs to be deleted.

Potential side-effects:
* The 'delete single ID' codepath (removed by this commit) was making
  some dangerous assumptions regarding order of IDs in Main and 'strong'
  dependencies between them. While these assumptions where presumably
  correct in current code/data model context, they were logically wrong
  and could have randomly cause bugs in the future.
* The sanitiing check on usercount performed in the case of the single
  ID deletion cannot be done anymore. Should not be that usefull
  anymore, as there are other places where IDs usercounts are validated.
* Performances:
  * The batch-deletion did not show any significant difference in speed.
  * Massively deleting IDs one by one however, showed a surprising 10%
    speedup.

Pull Request: https://projects.blender.org/blender/blender/pulls/118283
2024-02-15 10:16:32 +01:00
Bastien Montagne a3bf395a10 Core: IDRemapper: Refactor handling of 'never null' ID usages.
Existing code would allow tagging on request IDs which had a 'never
null' usage potentially cleared by the remapping operation (e.g. if an
Object obdata would have been set to `nullptr`).

While this worked for the current extremely restricted usecase (ID
deletion), this was not the best design, as it forced the ID remapping
user code to be very careful about its own usages of the `LIB_TAG_DOIT`
tag.

This commit replaces internal tagging by adding such IDs to a Set in
`IDRemapper` class, which user code can then use to find which IDs
(would have) had a 'never null' ID pointer cleared.

There are two additional changes induced by this commit:
* `BKE_libblock_unlink` `do_flag_never_null` parameter is removed.
  As it is not used in current codebase, simpler to remove than update
  the code to support it.
* `ID_REMAP_FLAG_NEVER_NULL_USAGE` option is renamed to
  `ID_REMAP_STORE_NEVER_NULL_USAGE`.
  In addition, its behavior is slightly modified:
  * Before, the owner ID would systematically be tagged if it had such
    'never null' ID usages, regardless of whether said ID usages (would)
    have actually been remapped to `nullptr`.
  * Now, the owner ID is only added to the `never_null_users` set if its
    'never null' usages (would) have been cleared.
2024-02-15 10:16:30 +01:00
Jeroen Bakker f72fdcf4ae GPU: Validate All Statically Defined Shaders As Argument
This PR adds a new command line argument to validate all statically
defined shaders. It is useful for platform support to understand
what isn't working.

It only checks statically defined shaders. Dynamic shaders (EEVEE/Compositor)
can still be fail.

The report is printed to console. After checking with windows platform and
triaging we could also add it to gpu debug script. There is a risk of adding it there
as it might crash and don't store any output.

Pull Request: https://projects.blender.org/blender/blender/pulls/117326
2024-02-15 08:13:44 +01:00
Campbell Barton 5c87dfd269 Cleanup: use BLI_time_ prefix for time functions
Also use the term "now" instead of "check" for clarity.
2024-02-15 13:15:56 +11:00
Hans Goudey e6c919830c Cleanup: Remove unused logging macros that free the input string 2024-02-14 21:08:58 -05:00
Hans Goudey e9fff6124c Merge branch 'blender-v4.1-release' 2024-02-14 21:04:40 -05:00
Hans Goudey f1cb2fa74b Fix: Crash with logging after recent std::string cleanup
The macro tried to free the string.
2024-02-14 21:04:15 -05:00
Campbell Barton 34ed7ee2d9 Merge branch 'blender-v4.1-release' 2024-02-15 13:00:26 +11:00
Campbell Barton e8baa8a505 Fix #113395: Invalid selection history after solidify
Clear the selection history since the previously selected
faces are de-selected.
2024-02-15 12:48:09 +11:00
Campbell Barton c838111571 Merge branch 'blender-v4.1-release' 2024-02-15 11:03:49 +11:00
Campbell Barton 3dde1e9df7 Merge branch 'blender-v4.1-release' 2024-02-15 11:03:45 +11:00
Campbell Barton bdd40f167e Merge branch 'blender-v4.1-release' 2024-02-15 11:03:42 +11:00
Campbell Barton 7848533395 Fix memory leak in anim.view_curve_in_graph_editor, restore the context
Ensure the selection is freed by the operator, also restore the
windowing context after setting temporary values.
2024-02-15 10:57:21 +11:00
Hans Goudey c07132b43b Cleanup: Make format 2024-02-14 17:43:03 -05:00
Hans Goudey c4d0e88e6e Fix: Asset browser crash after recent cleanup
After 57586df687. Turns out the library can be null here.
2024-02-14 17:41:17 -05:00
Hans Goudey b9ed6ce0a5 Refactor: Various C++ improvements to collection property search
- Use FunctionRef to avoid passing a separate user_data pointer
- Use std::string in arguments struct
- Add search items in one loop after gathering search items
- Use Vector of unique_ptr for search items instead of linked list
2024-02-14 17:23:01 -05:00
Hans Goudey 61e61ce0e1 Cleanup: Use Span instead of Vector const reference
Span is preferrable since it's agnostic of the source container,
makes it clearer that there is no ownership, is 8 bytes smaller,
and can be passed by value.
2024-02-14 17:23:01 -05:00
Hans Goudey a24d6e7012 Cleanup: Use StringRef instead of StringRefNull
The called function here only needs StringRef, that can apply here too.
2024-02-14 17:23:01 -05:00
Hans Goudey aef0b6552b Cleanup: Use helper functions to access next and previous face corners 2024-02-14 17:23:01 -05:00
Hans Goudey 57586df687 Cleanup: Remove unnecessary asset system functions
These functions appear to be thin wrappers around the C++ classes
that previously weren't accessible in C code.
2024-02-14 17:23:01 -05:00
Hans Goudey 7098e53c61 Cleanup: Use "this" keyword to access class methods 2024-02-14 17:23:01 -05:00
Iliya Katueshenock faf056f17b Cleanup: Move mesh utility to create mesh without attributes
Mesh with no attributes is used to build new mesh from scratch.
Some data can be shared, so there is no reason to have allocated attributes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118297
2024-02-14 23:14:12 +01:00
Sergey Sharybin 33af56f13e GPU Compositor: Avoid global DST lock on Linux
It is not required to hold the lock of DST when performing
compositing on GPU, as the compositor implementation uses the
GPU module directly, bypassing the draw manager.

However, currently this is known to cause issues on macOS,
and is not yet tested on Windows.

On Linux it works correctly, and avoids lock while compositor
is running.

There could still be a small locking hiccup, when the GPU
context is created and disposed. This needs to be looked
into.

Pull Request: https://projects.blender.org/blender/blender/pulls/118286
2024-02-14 19:30:38 +01:00
Clément Foucault 7b328390f4 Cleanup: EEVEE-Next: Remove unused mip level in remap shader 2024-02-14 18:52:58 +01:00
Clément Foucault da72cdee5e EEVEE-Next: Add compute shader to downsample sphere probe
This has no functional change except that it might speed
up probe updates since only updated pixels are processed.

Ref #118256
2024-02-14 18:52:58 +01:00
Hans Goudey 1c3c1e7776 Cleanup: Simplify asset metadata copy function
Also move the destructor declaration to be consistent with the style guide.
2024-02-14 12:06:56 -05:00
Harley Acheson 48dee674f3 UI: Changes to Menu Separator Padding
Add interior horizontal padding to menu separator lines.

Pull Request: https://projects.blender.org/blender/blender/pulls/118227
2024-02-14 17:14:17 +01:00
Hans Goudey a52323d711 Cleanup: Move BKE_duplilist.hh to C++ 2024-02-14 10:51:46 -05:00