Commit Graph

117289 Commits

Author SHA1 Message Date
Campbell Barton
7ae7592899 Fix #128346: Search results fail to display in the outliner
Regression in [0] caused the outliner not to draw at the clamped scroll
position. This meant searching in the outliner could show no results
even when results were found. It also meant deleting objects could show
nothing until the user manually forced the outliner to redraw.

Workaround the problem by detecting when outliner drawing changes the
scroll position and draw again. While inelegant this doesn't happen
often in practice.

Fixing without a second draw likely involves resolving the order of
initialization problem by separating bounds calculating from drawing.

[0]: a63ac425d0
2024-10-16 14:05:23 +11:00
Sybren A. Stüvel
399c2148c3 Cleanup: run make format
No functional changes.
2024-10-15 15:12:42 -07:00
Clément Foucault
fcae6f2fc4 Fix: GPU: GLSL preprocessor not using binary output stream
This was adding a lot of CLRF newlines on windows which
in turn caused the new runtime parsing to fail.
2024-10-15 22:56:32 +02:00
Clément Foucault
39d5013c6e GPU: Use filename hash for line directive instead of path
This ensures same values on all systems.
2024-10-15 22:26:08 +02:00
Clément Foucault
f15227946a GPU: Improve dependency error logging 2024-10-15 22:26:08 +02:00
Clément Foucault
c1f4394b14 GPU: Use 32bit hash in static_strings_suffix
Also make sure to use stoul for parsing it.
2024-10-15 22:26:08 +02:00
Jesse Yurkovich
619a295922 Merge branch 'blender-v4.3-release' 2024-10-15 11:25:42 -07:00
Jesse Yurkovich
81f439ff37 Fix #128916: Tag Light ID when applying scale
When applying scale on a light in the viewport, ensure we tag the light
itself for updating. Otherwise, the viewport get confused over which
size to use.

Pull Request: https://projects.blender.org/blender/blender/pulls/129030
2024-10-15 20:24:32 +02:00
Clément Foucault
c41326a296 Cleanup: GPU: GLSL Preprocessor: Use raw strings and remove template 2024-10-15 20:16:45 +02:00
Clément Foucault
cf9da6f642 GPU: Move global scope constant linting to preprocessor
# Conflicts:
#	source/blender/gpu/glsl_preprocess/glsl_preprocess.hh
2024-10-15 20:16:45 +02:00
Clément Foucault
d712be0662 GPU: Change global scope variable to defines to avoid overhead on Metal 2024-10-15 20:06:46 +02:00
Clément Foucault
62826931b0 GPU: Move more linting and processing of GLSL to compile time
The goal is to reduce the startup time cost of
all of these parsing and string replacement.

All comments are now stripped at compile time.
This comment check added noticeable slowdown at
startup in debug builds and during preprocessing.

Put all metadatas between start and end token.
Use very simple parsing using `StringRef` and
hash all identifiers.

Move all the complexity to the preprocessor that
massagess the metadata into a well expected input
to the runtime parser.

All identifiers are compile time hashed so that no string
comparison is made at runtime.

Speed up the source loading:
- from 10ms to 1.6ms (6.25x speedup) in release
- from 194ms to 6ms (32.3x speedup) in debug

Follow up #129009

Pull Request: https://projects.blender.org/blender/blender/pulls/128927
2024-10-15 19:47:30 +02:00
Sybren A. Stüvel
7fa5ba705e Cleanup: run make format
No functional changes.
2024-10-15 19:21:58 +02:00
Sebastian Parborg
1ca1855ca6 Merge branch 'blender-v4.3-release' 2024-10-15 18:27:04 +02:00
YimingWu
1e2e90e2d4 Fix #129051: GPv3: Write default u_scale in draw tool
The `u_scale` should be given a default value of `1.0f` so that newly drawn
strokes with the drawing already having `u_scale` attributes will have
correct texture mapping size instead of a default of `0.0f`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129060
2024-10-15 16:39:17 +02:00
Clément Foucault
86f442df95 GPU: Make create info list not runtime generated
This avoid cmake shenanigans to try to make proper
dependency tracking.

The previous code was not tracking changes inside
the create info files.

There is no real benefit for having these headers listed in
the cmakefile itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/129027
2024-10-15 16:31:37 +02:00
Sybren A. Stüvel
43d7558e5b Anim: Remove 'Slotted Actions' experimental flag
This commit takes the 'Slotted Actions' out of the experimental phase.
As a result:

- All newly created Actions will be slotted Actions.
- Legacy Actions loaded from disk will be versioned to slotted Actions.
- The new Python API for slots, layers, strips, and channel bags is
  available.
- The legacy Python API for accessing F-Curves and Action Groups is
  still available, and will operate on the F-Curves/Groups for the first
  slot only.
- Creating an Action by keying (via the UI, operators, or the
  `rna_struct.keyframe_insert` function) will try and share Actions
  between related data-blocks. See !126655 for more info about this.
- Assigning an Action to a data-block will auto-assign a suitable Action
  Slot. The logic for this is described below. However, There are cases
  where this does _not_ automatically assign a slot, and thus the Action
  will effectively _not_ animate the data-block. Effort has been spent
  to make Action selection work both reliably for Blender users as well
  as keep the behaviour the same for Python scripts. Where these two
  goals did not converge, reliability and understandability for users
  was prioritised.

Auto-selection of the Action Slot upon assigning the Action works as
follows. The first rule to find a slot wins.

1. The data-block remembers the slot name that was last assigned. If the
    newly assigned Action has a slot with that name, it is chosen.
2. If the Action has a slot with the same name as the data-block, it is
    chosen.
3. If the Action has only one slot, and it has never been assigned to
    anything, it is chosen.
4. If the Action is assigned to an NLA strip or an Action constraint,
    and the Action has a single slot, and that slot has a suitable ID
    type, it is chosen.

This last step is what I was referring to with "Where these two goals
did not converge, reliability and understandability for users was
prioritised." For regular Action assignments (like via the Action
selectors in the Properties editor) this rule doesn't apply, even though
with legacy Actions the final state ("it is animated by this Action")
differs from the final state with slotted Actions ("it has no slot so is
not animated"). This is done to support the following workflow:

- Create an Action by animating Cube.
- In order to animate Suzanne with that same Action, assign the Action
  to Suzanne.
- Start keying Suzanne. This auto-creates and auto-assigns a new slot
  for Suzanne.

If rule 4. above would apply in this case, the 2nd step would
automatically select the Cube slot for Suzanne as well, which would
immediately overwrite Suzanne's properties with the Cube animation.

Technically, this commit:
- removes the `WITH_ANIM_BAKLAVA` build flag,
- removes the `use_animation_baklava` experimental flag in preferences,
- updates the code to properly deal with the fact that empty Actions are
  now always considered slotted/layered Actions (instead of that relying
  on the user preference).

Note that 'slotted Actions' and 'layered Actions' are the exact same
thing, just focusing on different aspects (slot & layers) of the new
data model.

The "Baklava phase 1" assumptions are still asserted. This means that:
- an Action can have zero or one layer,
- that layer can have zero or one strip,
- that strip must be of type 'keyframe' and be infinite with zero
  offset.

The code to handle legacy Actions is NOT removed in this commit. It will
be removed later. For now it's likely better to keep it around as
reference to the old behaviour in order to aid in some inevitable
bugfixing.

Ref: #120406
2024-10-15 16:29:53 +02:00
Jeroen Bakker
74cb86aba4 Vulkan: Fix point shader mismatch in wavevform_draw_one
Pull Request: https://projects.blender.org/blender/blender/pulls/129061
2024-10-15 16:13:40 +02:00
Clément Foucault
e943d8b0a4 EEVEE: Use imageLoad/StoreFast when possible
Extracted from #115195

Pull Request: https://projects.blender.org/blender/blender/pulls/128844
2024-10-15 15:48:37 +02:00
Pratik Borhade
301b2ae183 Fix #128831: GPv3: Crash when adding action track
When grease pencil has no actions (ale->adt), id data block channel is
still added due to `ANIMFILTER_ANIMDATA`. This would lead to crash if
operator is accessing the AnimData (ale->adt). To fix this, make sure
adt exists before creating an animchannel.

Pull Request: https://projects.blender.org/blender/blender/pulls/128841
2024-10-15 15:16:03 +02:00
Thomas Lachmann
5f84f934a8 Fix #127087: GPv3: Initialize/copy attributes when adding/duplicating layers
- set default values for attributes on new GP layer
- copy attributes when duplicating GP layer

Pull Request: https://projects.blender.org/blender/blender/pulls/128344
2024-10-15 15:08:09 +02:00
sean-murray
5be60642ad Fix: GPv3: Crash when using build modifier with cyclic curves
The build modifier crashes when getting lengths of cyclic curves because `evaluated_points_by_curve`
was previously always called with `cyclic` parameter set to `false`.
The `cyclic` parameter necessary for `curves::segments_num` to return correct number of segments.

Pull Request: https://projects.blender.org/blender/blender/pulls/128955
2024-10-15 14:17:05 +02:00
Falk David
715a37b662 Fix #129049: Solid mode doesn't render strokes correctly
Caused by 364d62e59b.

In draw mode, we want to make sure to show vertex colors by default
because users can draw with them. Otherwise this can lead to unexpected
behavior in solid shading mode when vertex colors used to not be
rendered in draw mode.

The previous fix tried to do this by enforcing the `V3D_SHADING_VERTEX_COLOR`
mode in draw mode. But this has the side effect that the material
stroke and fill color are overriden with pure white.

To fix the issue correctly, simply ensure that `vert_col_opacity` in
`grease_pencil_layer_cache_add` is set to 1.0f. This means that
vertex colors and material colors are shown just like in the render.

Also resolves #128680.

Pull Request: https://projects.blender.org/blender/blender/pulls/129054
2024-10-15 13:47:24 +02:00
Jeroen Bakker
791f90ab8d Vulkan: Remove guardedalloc option
WITH_VULKAN_GUARDEDALLOC is a development option to use Blenders guarded
allocator when allocating internal vulkan driver resources. It does not provide any benefits
as this should be covered by vulkan validation and drivers are often ignoring this. This
change will remove the option from cmake and source code.

Pull Request: https://projects.blender.org/blender/blender/pulls/129039
2024-10-15 13:46:00 +02:00
Jeroen Bakker
8c441ac937 Merge branch 'blender-v4.3-release' 2024-10-15 13:44:46 +02:00
Jeroen Bakker
6f6efb6ec0 Vulkan: Disable Intel 10th gen and lower on Windows
Intel Windows drivers for 10th gen and lower has some strange behavior
when using dynamic rendering. It requires pipeline conditions to be met,
when beginning a new rendering scope. This is strange as specs + VVL
notes that these conditions should be met during vkCmdDraw* commands.

Pull Request: https://projects.blender.org/blender/blender/pulls/129055
2024-10-15 13:44:05 +02:00
Jeroen Bakker
cdef54a5ce Vulkan: Workaround for unused attachment extension
This change makes unused attachments extension optional.
This extension is fairly new and not all drivers have support for it.

The workaround will create additional pipelines when attachments are
not set.

Pull Request: https://projects.blender.org/blender/blender/pulls/129046
2024-10-15 13:43:21 +02:00
Omar Emara
e8a9de550f Cleanup: Avoid writing to input arguments
This patch adjusts the GLSL compositor code to avoid writing to
inputting as variables. This is to make it easier to port the code to
CPU. Also, write to the output directly instead of per channel.
2024-10-15 14:21:45 +03:00
Damien Picard
5715693a97 UI: Use title case for Grease Pencil, Freestyle, Line Art
This was already the case for the vast majority of occurrences, and is
recommended by the human interface guideline's writing style.

Pull Request: https://projects.blender.org/blender/blender/pulls/129000
2024-10-15 13:00:47 +02:00
Aras Pranckevicius
f6242edf73 Fix: ffmpeg VP9 lossless flag was wrongly applied to all WebM containers
Previous fix to make VP9 lossless work (98689f51c0) applied it to
all videos that happen to be in WebM containers. While it is typical
that WebM would be used for VP9, it is not necessarily so (WebM can
have H.264 or really any other video). Do the check based on video
codec being VP9.

Pull Request: https://projects.blender.org/blender/blender/pulls/129045
2024-10-15 12:18:50 +02:00
Sergey Sharybin
91eb980891 Merge branch 'blender-v4.3-release' 2024-10-15 11:42:48 +02:00
Tobias Kozel
a9db29be82 Bake: Speed up "Selected to active" Texture-Baking
For Texture baking, there is a CPU-bound preparation step needed to
establish a mapping between the Hi-Res and Low-Res Meshes before the
rendering engine can take over and start the bake.

Part of this process is now taking advantage of parallel_for,
speeding up this step of the Bake process for many/large textures almost
linearly to the number of CPU-cores.

Pull Request: https://projects.blender.org/blender/blender/pulls/128964
2024-10-15 11:39:56 +02:00
Nathan Vegdahl
989634c0a1 Fix: handle embedded IDs when upgrading to slotted actions
The versioning code that upgrades legacy actions to new slotted actions
also needs to properly assign slots to the IDs that use those upgraded
actions. It was doing this correctly except for not traversing into and
assigning slots to embedded IDs.

This commit adds the code to handle embedded IDs as well.

Additionally, this changes how mismatched `id_type`s are handled when upgrading
actions. Rather than refusing to assign the slot created during the upgrade if
the `id_type` doesn't match the ID, we assign it anyway with a warning. The
rationale is that this represents a case where the Action `idroot` was already
mismatched, and it turns out that has always been possible. So we now opt to
simply preserve that state of affairs rather than attempt to "fix" it.

Pull Request: https://projects.blender.org/blender/blender/pulls/129002
2024-10-15 11:04:04 +02:00
Jacques Lucke
5ad56c52ff Fix #128861: crash with Index Switch node when sliced virtual arrays are used
It looks like this specific case never really worked. This wasn't found before,
because in the large majority of cases, execution uses a more optimized code
path instead of this general one.

Pull Request: https://projects.blender.org/blender/blender/pulls/128993
2024-10-15 11:02:22 +02:00
Omar Emara
440dc61db2 Compositor: Add stub implemenetation for CPU pixel nodes
This patch adds stub implementation for CPU pixel nodes in order to stop
those nodes from crashing when used while also easing future
development.

Pull Request: https://projects.blender.org/blender/blender/pulls/129033
2024-10-15 09:32:13 +02:00
Jeroen Bakker
d1ccebffd0 Cleanup: make format 2024-10-15 08:58:29 +02:00
Campbell Barton
aa6742897e Cleanup: spelling in comments 2024-10-15 16:22:38 +11:00
Campbell Barton
11e41f7276 Merge branch 'blender-v4.3-release' 2024-10-15 16:22:09 +11:00
Campbell Barton
eb36125218 Unbreak build from missing include 2024-10-15 16:20:53 +11:00
Omar Emara
fbdb803750 Compositor: Implement Multi-Function Procedure Operation
This patch implements the multi-function procedure operation for the new
CPU compositor, which is a concrete implementation of the PixelOperation
abstraction, much like ShaderOperation, but uses the FN system to more
efficiently evaluate a group of pixel-wise operations.

A few changes were done to FN to support development. The multi-function
builder now allows retrieving the built function. A new builder method
construct_and_set_matching_fn_cb was added to allow using the SI_SO
builders with non static functions. A few other SI_SO were added to. And
a CPP type for float4 was added.

Additionally, the Gamma, Math, Brightness, and Normal nodes were
implemented as an example. The Math node implementation reused the
existing GN math node implementation, so the code was moved to a common
file.

Reference #125968.

Pull Request: https://projects.blender.org/blender/blender/pulls/126988
2024-10-15 06:51:42 +02:00
Campbell Barton
44d0452a78 Cleanup: spelling in comments 2024-10-15 12:51:05 +11:00
Jesse Yurkovich
24301e9b22 Merge branch 'blender-v4.3-release' 2024-10-14 13:57:38 -07:00
Jesse Yurkovich
9c36cfb4b8 Fix: Use error reports as indication of cancellation for some IO ops
During development of Collection Export, it was noticed that our various
IO formats deal with errors in vastly different ways [1]. The crashes
were all fixed but now the motivating scenario is as follows:

If you setup a Collection Exporter for OBJ, STL, or PLY, and if it
runs into an error during processing, the C++ operator will return
"FINISHED" to the caller but the operator will also RPT_ERROR. This
causes the caller, Collection Export, to indicate "success" to the user
but the RPT_ERROR then causes a UI report that indicates failure.

This PR chooses to use the presence of the RPT_ERROR as indication of
"CANCELLED" operator status and should be safe enough to also apply
to 4.2 LTS.

This aligns with what Python does [2] and with what the new GSoC import
nodes have chosen to do [3]. Though doing this on import isn't quite
correct so this PR does not add that in to the base import operators.

Alembic and USD are better behaved in this scenario already. However,
they have their own quirks to follow-up afterwards.

[1] https://projects.blender.org/blender/blender/issues/117881
[2] https://projects.blender.org/blender/blender/src/branch/main/source/blender/python/intern/bpy_capi_utils.cc#L25
[3] https://projects.blender.org/blender/blender/src/branch/main/source/blender/nodes/geometry/nodes/node_geo_import_obj.cc#L49

Pull Request: https://projects.blender.org/blender/blender/pulls/127525
2024-10-14 22:55:20 +02:00
Sean Kim
b2a67aa750 Merge branch 'blender-v4.3-release' 2024-10-14 13:47:16 -07:00
Sean Kim
feaa7bbbcc Fix #129013: Certain brushes can cause artifacts
Any brush that used the `restore_position_from_undo_step` codepath (i.e.
brushes that use `OrigPositionData` to calculate their deformations) had
the possibility to cause artifacts due to the nested tbb parallelization
causing incorrect usage of TLS data.

To fix this we add a call to `threading::isolate_task` to prevent thread
stealing.

Pull Request: https://projects.blender.org/blender/blender/pulls/129020
2024-10-14 22:46:30 +02:00
Sean Kim
a68cad4d59 Cleanup: Various non-functional changes for sculpt_gesture.cc
* Use const where possible
* Use C++ math types where possible
* Use std::array of vector types instead of raw arrays where possible

The main areas untouched here are functions which currently do not have
a C++ equivalent (math_geom.cc) and some clip plane arguments which are
wider-reaching than just this file (PBVHFrustumPlanes).

Pull Request: https://projects.blender.org/blender/blender/pulls/128931
2024-10-14 22:07:56 +02:00
Sean Kim
f5f116aba8 Merge branch 'blender-v4.3-release' 2024-10-14 12:46:00 -07:00
Sean Kim
3d40d6e188 Fix #128999: Smooth Surface brush doesn't update viewport
Missed in 347ec1acd7

Pull Request: https://projects.blender.org/blender/blender/pulls/129017
2024-10-14 21:45:12 +02:00
Sybren A. Stüvel
975b5f4533 Anim: invert Action editor 'Show All Slots' filter flag meaning
In the Action editor header, change the "Show All Slots" filter to
become "Only Show Slot of Active Object". The default state remains
"off".

This means that any new/upgraded Action editor will show all slots in
the Action by default. I think this is a good idea, especially since
cb6ed12ef1 makes related data-blocks share
the same Action, and thus the Action will have a mixture of Object and
non-Object animation. I suspect that it'll help in understanding the new
functionality of slotted Actions when they are most visible, i.e. when
the multiple slots are all shown.

Since slotted Actions are so new, I don't think we need to add
versioning code to accomodate this change.

Pull Request: https://projects.blender.org/blender/blender/pulls/129011
2024-10-14 19:21:36 +02:00
Sybren A. Stüvel
bb310831b8 Anim: don't depend on space data pointer when unassigning Action
When un-assigning an Action, do not depend on the Dope Sheet space data
`action` pointer. Instead, Blender now just sets the RNA property
`id.animation_data.action = None` to un-assign the Action. Using RNA this
way will ensure that the messagebus gets notified of this change as well.

The Dope Sheet space data 'action' pointer is still set to `nullptr`, but
it is now no longer used as primary way to clear the Action.

Pull Request: https://projects.blender.org/blender/blender/pulls/129006
2024-10-14 18:34:10 +02:00