Commit Graph

120055 Commits

Author SHA1 Message Date
Falk David
29b884903a Fix #128914: GPv3: Crash applying modifier to all frames
The issue was that the `merge_layers` function assumed that the
`src_grease_pencil` always returns a drawing when calling
`get_eval_drawing` which can return `nullptr`.

The fix makes sure to check that the `src_drawing` exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/129074
2024-10-16 10:22:58 +02:00
Clément Foucault
7f03a305eb EEVEE: Avoid printf injection in debug build
This avoid a crash in debug build caused by the printf
feature to be not so stable.
2024-10-16 09:50:55 +02:00
Christoph Lendenfeld
0211a68fb4 Fix #128805: Missing Depsgraph Update when removing FCurve modifiers
The problem was that when removing FCurve modifiers via the python API
the Depsgraph wasn't notified.
Fixed by tagging the owner ID of the fcurve modifier for an update.

Pull Request: https://projects.blender.org/blender/blender/pulls/128984
2024-10-16 09:29:45 +02:00
Christoph Lendenfeld
41a3e6c3bd Fix #125451: Duplicating bone doesn't copy pose bone colors
When duplicating a bone (has to be done in edit mode)
the pose bone colors were not copied.
This adds the code to do just that

This also fixes it for symmetrising because that uses the
same code path

Pull Request: https://projects.blender.org/blender/blender/pulls/129007
2024-10-16 09:26:48 +02:00
Clément Foucault
4ba944b15a GPU: GLSL Preprocess: Always remove quotes
We cannot do this for the MSL files. Also
they are written in MSL which should not be
processed. So use datatoc for them.

Also add quote linting for GLSL files.
2024-10-16 09:08:51 +02:00
Clément Foucault
7110890b09 GPU: GLSL preprocessor: Only do function parsing on library files 2024-10-16 09:08:51 +02:00
Campbell Barton
11dfa3297e Merge branch 'blender-v4.3-release' 2024-10-16 17:02:56 +11:00
Campbell Barton
ccb92947c5 Fix #129067: Transforming an edit-mesh crashes with cage editing
Regression in [0] although prior to this the `deformed_only` was not
being set, caused by a separate regression.

[0]: 80fa49f24ae768c5869065363e116b51175fb2df
2024-10-16 16:57:06 +11:00
Campbell Barton
2aee3331f1 Cleanup: reduce the scope of startx/y variables in outliner drawing
Simplify outliner_draw_tree by clarifying when these values are reset
as it wasn't obvious when the previously calculated values weren't
reused.
2024-10-16 16:29:50 +11:00
Campbell Barton
ee9f16227b Cleanup: pass TreeViewContext by const reference
Use a reference as this is never null.
2024-10-16 16:12:43 +11:00
Campbell Barton
948c9921a5 Cleanup: context arguments for outliner drawing
- Add TreeViewContext::layer_collection.
- Remove the context argument for outliner drawing,
  use TreeViewContext instead.
- Pass the TreeViewContext to outliner_sync_selection instead of
  initializing again from the context.
2024-10-16 16:12:43 +11:00
Sean Kim
e6d684a357 Merge branch 'blender-v4.3-release' 2024-10-15 22:06:10 -07:00
Sean Kim
b8e5c66947 Fix #129069: Drag Dot and Anchored paint brush modes don't clear mesh
Introduced in d282b1735e

The two stroke types need to have the mix_colors StrokeCache variable
reset in between daubs to prevent extra data from accumulating when
applying colors.

Pull Request: https://projects.blender.org/blender/blender/pulls/129084
2024-10-16 07:04:08 +02:00
Campbell Barton
93c984283e Cleanup: quiet compiler warnings 2024-10-16 15:07:13 +11:00
Aras Pranckevicius
db4d8d1046 Fix: Video CRF being reset when switching to AV1 codec
Two issues were present in code that was resetting CRF quality level
to "do not use CRF, use bitrate settings" mode:

- It did not include AV1 codec, so whenever you switched to AV1 the CRF
  was changing to constant bitrate.
- It wrongly included DNxHD codec. That seemed like it was trying to
  fix #100079 in 06a01168f6, but it was doing exactly the opposite
  of what a fix should have been? I don't understand it :/ In any case,
  now with DNxHD removed the CRF properly switches to constant bitrate
  when changing codec to DNxHD.

Factored the actual logic into BKE_ffmpeg_codec_supports_crf function.

Pull Request: https://projects.blender.org/blender/blender/pulls/129050
2024-10-16 05:48:51 +02:00
Campbell Barton
71198d4f8f Merge branch 'blender-v4.3-release' 2024-10-16 14:07:22 +11:00
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