Commit Graph

120055 Commits

Author SHA1 Message Date
Sebastian Parborg
86522d9ab1 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 18:06:54 +01:00
Miguel Pozo
50a3a0253d Revert "EEVEE: Remove Thickness output"
This reverts commit 91b727028a.
The change was only meant for 4.1.
Thickness output is required for EEVEE-Next.
2024-02-15 18:04:30 +01:00
Miguel Pozo
5eac9e6095 Merge branch 'blender-v4.1-release' 2024-02-15 17:59:44 +01:00
Miguel Pozo
91b727028a EEVEE: Remove Thickness output 2024-02-15 17:57:20 +01:00
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
Christoph Lendenfeld
0c560fb7ef Fix #112395: Proportional editing indicator in Graph Editor and Dope Sheet
When using proportional editing in the Graph Editor or the Dope Sheet,
the GUI displays a circle suggesting that the influence is limited in x and y.

In reality those editors only look at the x-axis to determine which keys to influence.

This PR fixes that by adding a new drawing function for those editors that
draws 2 lines to indicate a range.

In theory this can be a feature in other 2D editors in the future.
I assume the VSE would benefit from this as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/118196
2024-02-15 16:50:34 +01: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
Sean Kim
a2f49b05f8 Sculpt: Disable set pivot and select color for invisible objects
This PR disables the `SCULPT_OT_sample_color` and `SCULPT_OT_set_pivot_position` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Set Pivot
* Sample Color

| Set Pivot | Sample Color |
| --- | --- |
| ![invisible_set_pivot.gif](/attachments/0dd23857-abdf-4214-a08d-ce986f15e16f) | ![invisible_set_color.gif](/attachments/84950810-1c3d-4f02-8e84-67425d80754d) |

### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118306
2024-02-15 16:30:31 +01:00
Sean Kim
1e3e5c5ac2 Sculpt: Disable face set operators on invisible objects
This PR disables the `SCULPT_OT_face_sets_init`, `SCULPT_OT_face_sets_create`, `SCULPT_OT_face_sets_edit`, `SCULPT_OT_face_sets_randomize_colors`, `SCULPT_OT_face_set_change_visibility`, `SCULPT_OT_face_set_box_gesture`, and `SCULPT_OT_face_set_lasso_gesture` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Face Set From Masked
* Face Set from Visible
* Face Set from Edit Mode Selection
* Initialize Face Sets
* Grow Face Set
* Shrink Face Set
* Randomize Colors
* Toggle Visibility
* Hide Active Face SEt
* Box Face Set
* Lasso Face Set

| Init | Create | Edit |
| --- | --- | --- |
| ![fs_init.gif](/attachments/f44e96ab-e1c9-4279-9f69-80ea9503c830) | ![fs_create.gif](/attachments/3992b8fc-bd59-4aee-a2f6-6d7aa507f0b9) | ![fs_edit.gif](/attachments/78a7c447-8fd8-41dc-846a-5617751e5594) |

| Randomize Colors | Visibility | Gestures |
| --- | --- | --- |
| ![fs_color.gif](/attachments/43230f6b-4a39-4417-ac90-b94e3f33e724) | ![fs_hide.gif](/attachments/fe6fcdac-eda9-4f55-b013-f132f373fe65) | ![fs_gesture.gif](/attachments/5f36d7ed-c5bf-4154-af9e-0f19fb24249c) |
### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118228
2024-02-15 16:29:08 +01:00
Sean Kim
fca979e237 Sculpt: Disable modal filter operators on invisible objects
This PR disables the `SCULPT_OT_mesh_filter`,  `SCULPT_OT_cloth_filter`, and `SCULPT_OT_color_filter` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Mesh Filter
* Color FIlter
* Cloth Filter
| Mesh & Cloth | Color |
| ---- | --- |
| ![invisible_filter_mesh.gif](/attachments/87d2dfe2-be27-40bf-bb58-e9aa761a3f0a) | ![invisible_filter_color.gif](/attachments/ac51584e-bd87-4392-9bda-6ad5191cf38f) |

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118172
2024-02-15 16:26:38 +01:00
Sean Kim
d76c1e30e7 Sculpt: Disable mask operators on invisible objects
This PR disables the `SCULPT_OT_mask_init`, `SCULPT_OT_mask_filter`, `SCULPT_OT_mask_by_color`,  and `SCULPT_OT_mask_from_cavity` operators and the following actions that correspond to them when attempting to operate on invisible objects:
* Random Mesh
  * Per Vertex
  * Per Face Set
  * Per Loose Part
* Smooth Mask
* Sharpen Mask
* Grow Mask
* Shrink Mask
* Increase Contrast
* Decrease Contrast
* Mask By Color
* Mask From Cavity

| Init | Filter | By Color | From Cavity |
| ---- | --- | --- | --- |
| ![](/attachments/fc2ea68e-0af9-4887-b1a3-b2aa2eacaf21) | ![](attachments/3e94f48c-b463-417c-9ad9-bdc74e24bd70) | ![](/attachments/16029e7c-d973-483e-8c4a-164133d0fe11) | ![](/attachments/b356a248-354b-4c68-bf5b-c49907edcaff)

### Limitations
* All of the operators invoked by a menu option do not indicate to the user that they are currently invalid or will not operate due to the mesh being invisible, potentially leading to a confusing user experience.

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118173
2024-02-15 16:24:39 +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
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
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
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
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