Commit Graph

120055 Commits

Author SHA1 Message Date
Falk David
63d3573c2b Cleanup: VSE: Rename occurences of sequence in lookup code
Rename `sequence` -> `strip` for all the lookup code for strips.
2025-01-07 17:04:00 +01:00
Falk David
9421d4f623 Cleanup: VSE: Remove unused declaration in header 2025-01-07 17:04:00 +01:00
Falk David
32a1de9f78 Cleanup: VSE: Rename SEQ macros to STRIP
Rename `SEQ` macros (that refer to strips) to `STRIP`.
2025-01-07 17:04:00 +01:00
Miguel Pozo
164f6d0591 Fix #132667, #132665: Overlay-Next: Sculpt selection
Use draw_expand, like regular meshes.
2025-01-07 16:57:06 +01:00
Falk David
c9772fee13 Fix: Build error after cleanup commit
Broken by ff91c27481.
2025-01-07 16:27:59 +01:00
Jonas Holzman
8a855f9cbd UI: Refactor templates into individual files
This PR refactors each UI template into its own `interface_template_*.cc`
file.

* Added `interface_templates_intern.hh` which exposes shared utility
  functions and macros.
* Doxygen comment sections that were redundant of the file name were
  removed. If they contained additional description, they were added
  to the file Doxygen `\file` header.
* Short templates that were closely related were kept together in single
  files (e.g `uiTemplateHistogram`, `uiTemplateWaveform` and
  `uiTemplateVectorScope` are all in `interface_template_scopes.cc`).
  In this case, Doxygen comment section were preserved.

The only things remaining in `interface_templates.cc` are:
* Common utility function exposed by `interface_templates_intern.hh`
* Small independent templates (`uiTemplatePathBuilder`,
  `uiTemplateNodeSocket` and `uiTemplateFileSelectPath`)

Ref: https://projects.blender.org/blender/blender/issues/117604
Pull Request: https://projects.blender.org/blender/blender/pulls/132468
2025-01-07 16:21:07 +01:00
Falk David
ff91c27481 Cleanup: VSE: Rename SequenceType to StripType as well as flags
Rename the flags from `SEQ_TYPE_*` to `STRIP_TYPE_*`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132753
2025-01-07 16:10:36 +01:00
Falk David
82cfa92233 Cleanup: VSE: Rename seq_ functions/variables to strip_
This should only rename functions and variables that are
referring to (operations on) a single `Strip`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132748
2025-01-07 16:03:11 +01:00
Yahia
de9d021830 Fix #119557: XYZ labels on vector outputs missing if Single Value is disabled
Pull Request: https://projects.blender.org/blender/blender/pulls/132144
2025-01-07 15:48:43 +01:00
Sybren A. Stüvel
446f0a806e Anim: version Actions before versioning Action Assignments
Split the versioning of legacy Actions to slotted ones into two steps:

1. Versioning the Actions themselves, in the regular versioning code
   (`do_versions_after_linking_400`). This has to happen in the 'after
   linking' stage, and not in the 'before linking' stage, as there's
   older 'after linking' code that will break when it gets fed slotted
   actions. Any ID that is using a legacy Action will get tagged.
2. Versioning Action assignments, where the correct Action Slot has to
   be chosen & assigned for each tagged ID. This has to happen in the
   `do_versions_after_setup` stage, as choosing a slot requires that the
   actions (both local & linked) have been converted already.

This also includes some necessary changes to the pre-2.50 Action versioning
code.

Note that this change does not handle library overrides. That's dealt
with in !131426.

Pull Request: https://projects.blender.org/blender/blender/pulls/131627
2025-01-07 15:35:19 +01:00
Nathan Vegdahl
2f84d20455 Anim: Fix versioning of pre-2.50 animation data
The code for converting pre-Animato actions was not getting run properly
because `chanbase` (where animation data used to be stored) was
erroneously getting cleared before the relevant versioning code was run.

The root cause was that the code checking whether an action was already
valid as a layered action or not was NOT confirming that `chanbase` was
empty as part of that check (as it is a DNA-deprecated field), which in
turn triggered code that defensively clears `chanbase` (among other
things) when an action is identified as layered.

Note that the conversion of IPO curves and other pre-Animato data
happens quite late in the versioning, even _after_ the "versioning after
linking" stage. This is not introduced in this commit, this is just to
illuminate pre-existing design that might not be entirely obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/131975
2025-01-07 15:35:09 +01:00
Sybren A. Stüvel
63adbb19fb Anim: Always name the slot "Legacy Slot" when versioning legacy Actions
When creating Action Slots for legacy Actions, always name those slots
"Legacy Slot". Before this commit, the slot was named after the ID that
is animated by the Action; this matches what Blender will do when
animating that ID from scratch.

The old versioning behaviour caused issues when dealing with legacy
Actions: if there are multiple Actions in a file (for example multiple
run cycle animations) and only one of those was assigned to the
character (the rest has a fake user), Blender would only name that one
action slot after the character. The "fake user" Actions would just be
get a slot named "Slot".

This causes issues when toggling between the different Actions, as
Blender will not automatically assign a slot when switching from the
character- named one to the "Slot" one.

Ref: #129563, #130261

Pull Request: https://projects.blender.org/blender/blender/pulls/131425
2025-01-07 15:34:53 +01:00
Falk David
8541296e9d Cleanup: VSE: Rename Strip *seq variables to strip
This only renames variables named `seq` and not other variants,
like `seq_*` or `seq1`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132736
2025-01-07 14:09:45 +01:00
Brecht Van Lommel
019269e2cb Fix: Build error on some Windows build configurations after recent changes 2025-01-07 13:40:03 +01:00
Miguel Pozo
f740923793 Fix #132035: Add line strip variation for custom bone shape wires
Add a shader version for line strip buffers that takes the different
input primitive rates and restart indices into account.

Pull Request: https://projects.blender.org/blender/blender/pulls/132084
2025-01-07 13:31:54 +01:00
Miguel Pozo
3f5fa8b65e Fix #132211: Overlay-Next: Drag&Drop material assets doesn't work
`GLIndexBuf::bind_as_ssbo` didn't bind subrange index buffers.

Pull Request: https://projects.blender.org/blender/blender/pulls/132712
2025-01-07 13:19:03 +01:00
Philipp Oeser
5d8ba173c4 Fix #132629: Generating asset previews for grease pencil is broken
Reason is that `BKE_camera_view_frame_fit_to_scene` cannot handle grease
pencil data [it used to, that was once added in 80d0b68290 but lost in
the switch to GPv3 (see 5c57e24fea)].

So to resolve, add back support for grease pencil in
`BKE_camera_view_frame_fit_to_scene` which is similar to what we do for
getting the bounding box.

Pull Request: https://projects.blender.org/blender/blender/pulls/132733
2025-01-07 13:09:30 +01:00
Omar Emara
508ee95db6 Fix: Missing include for reduce_max 2025-01-07 14:01:14 +02:00
Brecht Van Lommel
920e709069 Refactor: Make header files more clangd and clang-tidy friendly
When using clangd or running clang-tidy on headers there are
currently many errors. These are noisy in IDEs, make auto fixes
impossible, and break features like code completion, refactoring
and navigation.

This makes source/blender headers work by themselves, which is
generally the goal anyway. But #includes and forward declarations
were often incomplete.

* Add #includes and forward declarations
* Add IWYU pragma: export in a few places
* Remove some unused #includes (but there are many more)
* Tweak ShaderCreateInfo macros to work better with clangd

Some types of headers still have errors, these could be fixed or
worked around with more investigation. Mostly preprocessor
template headers like NOD_static_types.h.

Note that that disabling WITH_UNITY_BUILD is required for clangd to
work properly, otherwise compile_commands.json does not contain
the information for the relevant source files.

For more details see the developer docs:
https://developer.blender.org/docs/handbook/tooling/clangd/

Pull Request: https://projects.blender.org/blender/blender/pulls/132608
2025-01-07 12:39:13 +01:00
Brecht Van Lommel
85df741aca Fix #131931: Joining mesh material slots fails with invalid indices
* Clamp invalid per-face slot numbers to match rendering logic.
* When objects have no slots, ensure faces get assigned to an empty slot.
* Refactor code to avoid strong coupling between far away code.

Pull Request: https://projects.blender.org/blender/blender/pulls/132728
2025-01-07 12:25:39 +01:00
Omar Emara
2d6353a50e Fix: Zero division in Glare node
Zero division might happen in the Glare node for Fog Glow and Bloom if
the input Size is zero. This fix protects against those cases.
2025-01-07 13:20:18 +02:00
Pratik Borhade
92f777557f Cleanup: Grease Pencil: Remove layer reorder operator
`GREASE_PENCIL_OT_layer_reorder` operator is not exposed in UI.
Alternative options exists for rearranging layers/groups: drag-drop and
`grease_pencil.layer_move()`.
As discussed previously in chat, remove the operator code.

Pull Request: https://projects.blender.org/blender/blender/pulls/132299
2025-01-07 11:46:50 +01:00
Omar Emara
004e3d39fa Compositor: Improve Glare node UX
This patch redesigns the Glare node to improve the user experience. The
improvements are as follows.

Two new outputs were added, Glare and Highlights. The Glare output gives
the generated glare without the input, and is useful when the user wants
to adjust the glare before adding it to the image. The Highlights output
gives the areas that are considered highlights when computing the glare,
and is useful if the user wants to temporally check the highlights while
doing adjustments or wants to use those as a base for creating a custom
glare setup.

The Mix node option was removed and a new Strength single value input
was added to serve the same functionality. The Mix option had a range of
[-1, 1], where the [-1, 0] sub-range essentially controlled the strength
of the glare, 0 being full strength and -1 being zero strength. While
the [0, 1] range returned the generated glare with an attenuated version
of the image added, that is, it was useless except for the value of 1,
which returned the generate glare only.
Aside from being a very intuitive range, it also meant that the power of
glare can't be boosted beyond the full strength of, you guessed it, 0.
The newly added Strength input has a soft range of [0, 1] and can be
boosted beyond 1. If the users want the glare only, they can use the
newly provided Glare output.

The Size node option used for Bloom and Fog Glow was removed and a new
Size single value input was added. The Size node option had yet another
very intuitive range of [1, 9], and it was related exponentially to the
actual size of the Glare. For Bloom, the actual bloom size relative to
the image was 2^(Size-9), so a Size of 8 means the bloom covers half of
the image. For Fog Glow, the actual bloom size in pixels is 2^Size, so
the glare size is not relative to the image size and would thus change
as the image resolution change. Furthermore, the maximum possible glare
size was 512 pixels, and the user couldn't make fine adjustments to the
size.
The newly added Size input has a range [0, 1], where 1 means the glare
covers the entire image, 0.5 means it covers half the image, and so on.
That means it is consistent between Bloom and Fog Glow, it is relative
to the image size, it allows as large of a glare as possible, it is
continuous for Fog Glow, but not for Bloom because that requires an
algorithmic change that will be implemented separately.

The Threshold, Streaks, Streaks Angle, Iterations, Fade, and Color
Modulation node option was turned into a single value node input to
allow the option to be used in node groups.

---

Versioning was added to transfer node options into sockets, but it is
not all 1:1 versioning, since the old Size option was not relative to
the image size, so it depends on runtime information of the input size.
As a guess, we assume the render size in that case. Versioning the
[0, 1] range of the Mix option intentionally omits the attenuation of
the image input, because that is almost certainly not what the user
wants and was probably done thinking it controls the strength.

Glare code now sets the alpha channel to 1, that's because it was
already ignored in the mixing step, but now that we expose the Glare
output, we need to set it to 1. So this is not a functional change.

The get_glare_size() method was renamed for clarity since it now
conflicts with the newly added Size input.

---

This is a partial implementation of #124176 to address #131325. In
particular, it adjust existing functionality, it doesn't add any new
ones. Those will be added in separate patches.

Pull Request: https://projects.blender.org/blender/blender/pulls/132499
2025-01-07 11:15:26 +01:00
Brecht Van Lommel
0c2ec3dcf9 Fix #132716: Selected to active bake broken after recent bugfix
Consistently pass evaluated bake target objects to Cycles, instead
of using the original for this case. This way it can be matched with
evaluated objects being rendered.

Pull Request: https://projects.blender.org/blender/blender/pulls/132722
2025-01-07 10:57:46 +01:00
Campbell Barton
60e7a77184 Fix #131888: Text "Fast editing" disables fill in all modes 2025-01-07 20:47:48 +11:00
Jeroen Bakker
15aa7f882e Fix #132659: Vulkan: Provoking Vertex
Selection shader changes the provoking vertex for edge selection.
Using a non default provoking vertex was not implemented in Vulkan
resulting in selecting a different edge then expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/132729
2025-01-07 10:40:19 +01:00
nutti
d42a9ae406 PyDoc: use argument "type" to list valid types for class registration
Ref: !132482
2025-01-07 20:09:35 +11:00
Aras Pranckevicius
016167e8f3 Fix #132529: VSE strip scaled to 0.0 occludes strips below it
The "does a strip cover whole screen" logic did not handle the case
of completely zero size strip, and thus was wrongly deciding
that the strip is opaque.

Pull Request: https://projects.blender.org/blender/blender/pulls/132714
2025-01-07 10:01:11 +01:00
Aras Pranckevicius
ab1fc88f2e Fix #132646: VSE proxy strip incorrectly occludes strips below it
Depending on proxy size and scaling factor, the "does proxy cover
whole screen" code was producing wrong results, due to mismatched
resolutions it was working on: SeqRenderData at that point contains
proxy resolution (reduced), but SEQ_image_transform_final_quad_get
works at full resolution. The produced quad needs to be scaled down
to what the render context is operating at.
2025-01-07 10:01:10 +01:00
Philipp Oeser
348332783f Fix #132662: Grease Pencil Sculpt using wrong plane on rotated object
The `DeltaProjectionFunc` introduced in cbe2bb6755 was always using a
"worldspace" plane [which ignored the layer rotations for projections --
be it through actual layer transforms or object rotations].

So to resolve, use the appropriate axis of the (already available)
`layer_to_world` matrix.

Pull Request: https://projects.blender.org/blender/blender/pulls/132690
2025-01-07 09:12:31 +01:00
Pratik Borhade
7fbe1e1a31 Fix #132661: Grease Pencil: Simplify operators greyed out in Stroke selection
This is due to wrong poll function

Pull Request: https://projects.blender.org/blender/blender/pulls/132674
2025-01-07 09:11:50 +01:00
Campbell Barton
5003253aca Cleanup: spelling & repeated terms 2025-01-07 13:20:19 +11:00
Campbell Barton
235d615f5a 3D Text: implement common behavior for cursor motion with a selection
Moving the cursor with a selection now drops the selection
and moves the the selection bounds.
2025-01-07 13:06:02 +11:00
Campbell Barton
292ba724ab Cleanup: use a define to make it explicit the BGL API shouldn't be used
Now bgl.hh only exposes the module initialization function
since other functions aren't used elsewhere and probably shouldn't be
used in the future.
2025-01-07 11:39:24 +11:00
Campbell Barton
a404f521a3 Cleanup: remove typedef struct & function(void) in Python declarations 2025-01-07 11:27:20 +11:00
Campbell Barton
724e4fe937 Cleanup: move bgl header to C++ 2025-01-07 11:16:14 +11:00
Campbell Barton
6ae599c588 Fix gpu.shader.from_builtin exception without returning null
Returning an object instead of null meant to exception would
not be raised as intended.

Oversight in !132686
2025-01-07 10:18:59 +11:00
Sean Kim
72180241c1 Fix #132520: Pose Brush "Use Connected" behaves oddly
When the brush refactor project was in progress, the "Fake Neighbors"
feature used exclusively by the Pose brush was made more explicit.
However, the migration missed the usage of this data in the `flood_fill`
APIs.

This resulted in the option not affected unconnected topology islands
except when the Pose Origin Offset was non zero and using the Topology
mode of the brush.

To fix this, this commit updates the flood_fill APIs to take in the
pre-calculated fake neighbor data and use it when traversing connected
vertices and applying weights.

Pull Request: https://projects.blender.org/blender/blender/pulls/132610
2025-01-06 21:38:36 +01:00
Hans Goudey
a4bfa399e9 Fix #132631: Sculpt multires drawing performance regression
Caused by 39f7c506b5.

GPU vertex buffers were way over-allocated. Not sure how that happened.
2025-01-06 14:25:35 -05:00
Sean Kim
9e8c037375 Python API: Make paint.brush and paint.eraser_brush read-only
With the brush asset project, the `Paint` `brush` and `eraser_brush`
properties were effectively turned into a convenient cache of the active
brush. A related operator, `paint.brush_set` was also removed in favor
of `brush.asset_activate`

While this is technically a breaking change to the API, it currently
seems better to align this property with expected usage & other recent
changes rather than allow users to set a property that may not behave as
expected.

There are two currently known side effects that setting this property
via the Python API has that the equivalent call to brush.asset_activate
does not:

* Changing this property via the console or script, peforming a stroke
  and then undoing the stroke causes the active brush to change - this
  directly contrasts with the normal experience of using the asset
  shelf where brush changes are not affected by undo

* The asset shelf itself does not update the currently active brush
  until a subsequent mouseover

Pull Request: https://projects.blender.org/blender/blender/pulls/131991
2025-01-06 18:52:01 +01:00
Bastien Montagne
1b82ef37be Refactor: Use ENUM_OPERATORS macro for PartialWriteContext operations enum.
Reduces slightly verbosity.

Pull Request: https://projects.blender.org/blender/blender/pulls/132710
2025-01-06 18:19:18 +01:00
Falk David
4edf250a65 Cleanup: VSE: Rename uses of "sequence" in outliner code
Renames some internal names to reflect the new naming
of `Sequence` -> `Strip`.

Pull Request: https://projects.blender.org/blender/blender/pulls/132701
2025-01-06 18:17:47 +01:00
Falk David
0f8cf1a0e9 Cleanup: VSE: Rename SequenceRuntime to StripRuntime
Pull Request: https://projects.blender.org/blender/blender/pulls/132704
2025-01-06 18:17:25 +01:00
Jacques Lucke
41b2611a8d BLI: add remove_if function for global memory cache
Before, it was only possible to clear the entire cache at once or to rely on
automatic clearing when it gets full. This patch adds the ability to remove
cached data based on a predicate function.

This is useful for #124369 for partially invalidating the cache for some files.

Pull Request: https://projects.blender.org/blender/blender/pulls/132605
2025-01-06 18:07:03 +01:00
Jacques Lucke
a848b376d4 Fix #132408: crash when outputting anonymous attribute from foreach zone
The issue was that the propagation of referenced anonymous attributes treated
geometry outputs of the foreach zone as "normal". That means that every
anonymous attributes referenced by the input socket would also be referenced by
the output socket.

However, just like in the repeat zone, this so called "propagate relation" needs
some special behavior, because anonymous attributes references created inside a
zone have to remain inside that zone. Instead, the output node creates a new
anonymous attribute reference that is used outside of the zone.

Note, this is the same as #132560 but also implements the right-to-left pass,
whereas before only the left-to-right pass was implemented.

Pull Request: https://projects.blender.org/blender/blender/pulls/132607
2025-01-06 18:06:20 +01:00
Jacques Lucke
c129d078f2 Fix #127721: crash when loading file with rigid body world when WITH_BULLET is off
There were two separate issues which have a very similar solution:
* When loading the .blend file, the `scene->rigid_body_world->group` collection
  pointer has to be mapped to the actual address. However, that was not done
  because `BKE_rigidbody_world_id_loop` was a stub when `WITH_BULLET` is off.
  That resulted in the collection pointer having an invalid address.
* When closing the file, there was some issue because of incomplete code for
  copying rigid body related stuff for the depsgraph and hence there was some
  unexpectedly shared ownership which leads to a use-after-free. Here the fix is
  to move the copy code out of a `#ifdef WITH_BULLET` block too.

Since none of the moved code actually needs bullet, it seems fine to move it.
The code should be exactly the same in the common case with `WITH_BULLET` is on.

Pull Request: https://projects.blender.org/blender/blender/pulls/132697
2025-01-06 18:05:25 +01:00
Hans Goudey
c4cb68e53b Fix #132660: Sculpt multires mask overlay skipped without face sets
Overlay next code didn't account for 1618448abd.
2025-01-06 11:53:24 -05:00
Julian Eisel
11b006e01a UI: Don't spawn asset shelf popup by hovering button
Papercut reported in #132293.

Allow explicitly disabling this behavior for a button, and do so for the
big preview asset shelf popup button. It gets more in the way than it's
useful in this case.
2025-01-06 17:42:29 +01:00
Hans Goudey
c3d7cd0424 Fix #132651: Multires sculpt drawing crash with color attribute overlay
Mistak in 39f7c506b5.

The VBOs need to be allocated! And we can just use a single dummy
type as well, rather than using the type from the attribute request
which is meaningless in this case.
2025-01-06 11:41:52 -05:00
Brecht Van Lommel
c3c05559d6 OpenImageIO: Compatibility with version 3.0
Pull Request: https://projects.blender.org/blender/blender/pulls/132654
2025-01-06 17:21:11 +01:00