Commit Graph

120055 Commits

Author SHA1 Message Date
Brecht Van Lommel
f27cd94a0c OpenVDB: Support build without delay loading 2025-01-06 17:21:11 +01:00
Bastien Montagne
927d1b0ef6 Refactor: Assets: Replace custom code writing brush assets with PartialWriteContext.
Also allows to remove any usage of `ID_TAG_NEED_EXPAND` outside of
readfile code, which will be nice to generalize changes being worked on
in #131695 and !132169.

Implements #132301.

Pull Request: https://projects.blender.org/blender/blender/pulls/132305
2025-01-06 16:39:43 +01:00
Julian Eisel
88cc4e9ddf Fix: compile error when building without Audaspace
Rename was missed in 655a17a6ab.
2025-01-06 16:17:19 +01:00
Jeroen Bakker
588087f88e Fix #131943: GPU: Vertex formats for polyline shaders
PR #129315 refactored polylines. The shaders now attaches the vertex
attributes as SSBOs. Adding a workaround for polyline shaders to
extract the correct vertex formats when called via Python.

Pull Request: https://projects.blender.org/blender/blender/pulls/132689
2025-01-06 16:05:50 +01:00
Jeroen Bakker
c2b8186b07 Fix #132590: Python/GPU: Builtin clipped shaders messages
Confusing error messages are printed when requesting a clipped builtin
shader via Python that does not exist.

This PR will remove the confusion of the messaging:
- Replaced BLI_assert_unreachable with an assert as it is reachable
  code.
- Adding clipped configuration for POLYLINE_UNIFORM_COLOR

Pull Request: https://projects.blender.org/blender/blender/pulls/132686
2025-01-06 15:42:07 +01:00
Jeroen Bakker
7db07fcc0b Fix #132611: EEVEE: Background disappear when using forward shaded volumes
In case forward shaded volumes are used the background can turn black.
This is because in this case an incorrect framebuffer could be bound.

Pull Request: https://projects.blender.org/blender/blender/pulls/132678
2025-01-06 15:13:58 +01:00
Jeroen Bakker
13b5e4f025 Fix #132454: Channel shuffling image engine
Current code selected incorrect `.push_constant` override and only
uploaded a single float (R).

Pull Request: https://projects.blender.org/blender/blender/pulls/132693
2025-01-06 15:09:44 +01:00
Falk David
655a17a6ab Refactor: VSE: Rename Sequence to Strip
This renames the struct `Sequence` to `Strip`.

While the motivation for this partially comes from
the "Sequence Design" #131329, it seems like this
is a good refactor whether the design gets implemented
or not.

The `Sequence` represents what users see as strips in the
VSE. Many places in the code already refere to a `Sequence`
as "strip". It's the C-style "base class" of all strip types.

This also renames the python RNA type `bpy.types.Sequence`
to `bpy.types.Strip` which means that this technically breaks
the python API.

Pull Request: https://projects.blender.org/blender/blender/pulls/132179
2025-01-06 14:19:24 +01:00
Sybren A. Stüvel
c6d6efaaa2 Fix #132606: ActionSlots can be created with too long names
The max length of the RNA property `ActionSlot.identifier` was set
incorrectly. The setter code did manage the length properly, but the
getter was checking agains that incorrect max length, and rightfully
complained.

Pull Request: https://projects.blender.org/blender/blender/pulls/132691
2025-01-06 13:55:07 +01:00
Jeroen Bakker
818c886350 Vulkan: Timeline semaphores
This PR will add timeline semaphores to be required. It doesn't use
the timeline semaphores yet, but as multiple developments will
rely on it it is better to add the requirement.

Pull Request: https://projects.blender.org/blender/blender/pulls/132683
2025-01-06 11:44:13 +01:00
YimingWu
b2b73ca489 Fix #132480: Grease Pencil: Length modifier early return on empty filter
If material/layer influence filter causes no stroke to be selected,
return early to prevent crashes due to index errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/132510
2025-01-06 11:36:25 +01:00
Brecht Van Lommel
24e5226ff0 Fix #128186: Invalid GPU framebuffer free from context
Framebuffers are getting freed in the GPUContext base class destructor. But
the framebuffer destructors use the MTL/VK/GLContext derived class, whose
destructor has already completed at this point. So these contexts are no
longer valid to use.

Now free the framebuffers earlier.

This caused ASAN warnings, it's not known to cause actual bugs.

Pull Request: https://projects.blender.org/blender/blender/pulls/132504
2025-01-06 11:32:02 +01:00
Falk David
ca2ed14849 Fix #131839: Crash in dopesheet channel drawing
This code is now only used by annotations but was not updated.
Uses the right properties now and removes the layer mask
one which is not used by annotations.

Pull Request: https://projects.blender.org/blender/blender/pulls/132030
2025-01-06 11:31:09 +01:00
YimingWu
96c6f543ec Fix #131738: Grease Pencil: Use correct textures in acquire_resources.
Apparently the issue was caused by a copy-paste mistake in 37f9ec7235
where in `use_mask_fb` branch it should bind `mask_` textures. Now
mask layer draws correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/132343
2025-01-06 11:22:30 +01:00
Sybren A. Stüvel
2ec1b6887d Core: move short-lived ID_TAG_ID_LINK_PLACEHOLDER to runtime struct
Move the `ID_TAG_ID_LINK_PLACEHOLDER` bit of `id->tag` to
`id->runtime.readfile_data->tags.is_id_link_placeholder`. It also
introduces the necessary stucts and allocation/freeing code.

Old code:

```cpp
if (id_tag & ID_TAG_ID_LINK_PLACEHOLDER) {
```

New code:

```cpp
if (readfile_id_runtime_tags(id).is_id_link_placeholder) {
```

where `readfile_id_runtime_tags(id)` is a getter for
`id->runtime.readfile_data->tags` that is null-safe for
`id->runtime.readfile_data`. The `readfile_data` is not allocated in
these cases:

1. When reading undo steps, because that doesn't have to deal with
   versioning or linking (which are the sole purposes for this
   struct).
2. When linking from another file (for example from the 'Link...'
   operator). The just-linked IDs will have the `readfile_data`
   struct, but already-loaded IDs will already have had those freed.

No functional changes intended.

Pull Request: https://projects.blender.org/blender/blender/pulls/132169

Design Task: #131695
2025-01-06 10:58:56 +01:00
Sybren A. Stüvel
b7d18210e9 Fix #132193: bone snapping fails under specific conditions
Fix bone snapping failure by removing the Armature bounding box check.
That check would go over all the bones, compute the total bounding box,
just to avoid the remaining code (which goes over all the bones anyway).

Not sure why the code is causing these issues, but I'm guessing it's due
to getting the bounding box in the wrong space (could be a bug
introduced in 6212c3c374). Since this call doesn't look like it's an
actual optimization to me, I think it's better to remove it.

Pull Request: https://projects.blender.org/blender/blender/pulls/132602
2025-01-06 10:51:03 +01:00
nutti
313f3ecf98 PyDoc: correct CollectionProperty & PointerProperty type in Python docs
Ref: !132420
2025-01-06 20:29:29 +11:00
nutti
10e3e3b4a0 PyDoc: add bpy_prop_collection_idprop class document
Ref: !132587
2025-01-06 20:29:29 +11:00
Omar Emara
503e2c46a5 Fix: Compositor crash with group of different typed socket
The compositor crashes if a node inside a node group is connected to a
group input that have a different type and the node group is used
without a connection to that input. That's because the compositor code
assumes the type of the group input without implicit type conversion to
the expected type of the node. To fix this, handle implicit conversion
for unconnected sockets as well.
2025-01-06 11:14:27 +02:00
Omar Emara
b3623feab2 Compositor: Support node integer sockets
This patch adds support for using integer sockets in compositor nodes.
This involves updating the Result class, node tree compiler, implicit
conversion operation, multi-function procedure operation, shader
operation, and some operations that supports multiple types.

Shader operation internally treats integers as floats, doing conversion
to and from int when reading and writing. That's because the GPUMaterial
compiler doesn't support integers. This is also the same workaround used
by the shader system. Though the GPU module are eyeing adding support
for integers, so we will update the code once they do that.

Domain realization is not yet supported for integer types, but this is
an internal limitation so far, as we do not plan to add nodes that
outputs integers soon. We are not yet sure how realization should happen
with regards to interpolation and we do not have base functions to
sample integer images, that's why I decided to delay its implementation
when it is actually needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/132599
2025-01-06 10:09:26 +01:00
Campbell Barton
5303e85b3f Fix #130744: Crash searching menus with Viewport Pie add-on
The logic to expand non menu-type menu buttons was calling panels
draw function without first checking the poll() function succeeded.
2025-01-06 15:44:10 +11:00
YimingWu
18b690dee6 Fix #132325: Decimate fails to convert small faces to quads
Decimate used `is_quad_convex_v3` to check if faces should be converted
to quads, adjust the epsilon since small faces were being skipped.

Ref: !132342
2025-01-06 13:46:41 +11:00
Campbell Barton
c27bf6bef8 Cleanup: CMake indentation 2025-01-06 12:48:51 +11:00
Harley Acheson
df57beb676 UI: Improved User Feedback for Animation Playback Timer
The "Blender" menu contains seven items in "System / "Redraw Timer"
that are for troubleshooting and testing.  Six of the items take far
less than a second, but one takes a long time. "Animation Play" times
how long it takes to play through your current animation ten times. But
there is no way to guess this and some users have run it accidentally
by finding it in menu search. It gives no feedback at all, and there
are no hints on how long it will take. Once it plays through your
animation once you might guess that it runs forever.  This PR shows
the test name and where it is in its ten runs. On platforms that
support it this also shows an app progress bar (on the taskbar icon for
Windows).

Pull Request: https://projects.blender.org/blender/blender/pulls/132648
2025-01-05 02:00:37 +01:00
Campbell Barton
5f640457d8 Cleanup: suppress various pylint warnings 2025-01-04 21:17:29 +11:00
Campbell Barton
6f64d70e60 Cleanup: use main(), declare __all__ for code generaltion scripts
- Using a main function allows the scripts to be imported without
  executing logic.
- Declaring `__all__` lets tools such as "vulture" detect unused code.
2025-01-04 20:06:15 +11:00
Campbell Barton
4c852d5566 Fix #131195: Crash with PyDrivers after canceling extensions update
Rendering a scene with py-drivers would crash after dropping an
extension onto Blender's window then canceling before the update
completed.

This was caused by context.temp_override pushing arguments into the
context but failing to pop them in the case of an error - which would
happen when the popup was closed while the update ran.
2025-01-04 19:09:54 +11:00
Campbell Barton
9363ad59b0 Fix #132615: Memory leak calling context.temp_override()
ContextTempOverride objects were not freeing the reference to their
arguments when the context managers __exit__ didn't run.

This would happen if __enter__ failed with an unsupported configuration
or if object was created and not used.

Resolve by making ContextTempOverride a container type with GC support.

This also allows the ContextTempOverride to be reused since it's
arguments are now cleared when it's deallocated instead of __exit__.
2025-01-04 19:09:53 +11:00
Campbell Barton
535b26d436 Cleanup: remove "__tp" from function names in bpy_rna_context
This convention seems strange and doesn't help with readability/clarity.
2025-01-04 16:32:04 +11:00
Campbell Barton
d2d754be3f Cleanup: spelling in comments (make check_spelling*)
- Back-tick quote math expressions so differentiate them
  from English.
- Use doxygen code blocks for TEX expressions.
2025-01-04 16:26:39 +11:00
Aaron Carlisle
1bcc01519a Cleanup: Spelling: "Explicitly" 2025-01-03 22:35:05 -05:00
Harley Acheson
9ed7b03e35 Fix #100652: Correct Shortcut Hovering Editor Type Button
When hovering over the "Editor Type" button it always shows Shift-F1 as
the shortcut no matter what the current Editor Type is. We already have
specific code for "SCREEN_OT_space_type_set_or_cycle" for the items on
the popup menu, but it doesn't handle the case of hovering the menu
itself. This adds just adds a line to handle this.

Pull Request: https://projects.blender.org/blender/blender/pulls/132612
2025-01-04 00:58:20 +01:00
Jesse Yurkovich
e5b3b9b9cb Cleanup: USD: various non-functional changes
- Pass large std::function by const ref
- Shift the mesh material assignment helpers inside main namespace
- Use MaterialFaceGroups type alias in more places
- Remove unused bmain argument from import_mesh_skel_bindings

Pull Request: https://projects.blender.org/blender/blender/pulls/132586
2025-01-03 20:36:07 +01:00
Damien Picard
e3f1a62a3f Geometry Nodes: rename Curve Spiral to Spiral in Add Node menu
Nodes should have the same name in the Add Node menu as their actual
name, but the Spiral node is called "Curve Spiral". Since there is no
ambiguity with another primitive node called Spiral, it can be renamed
to that.

This also fixes an issue with translation, where the node could not be
translated since its name was never extracted to the translation
files.

Pull Request: https://projects.blender.org/blender/blender/pulls/122289
2025-01-03 20:26:11 +01:00
Jacques Lucke
dc797e1210 Revert "Fix #132408: crash when outputting anonymous attribute from foreach zone"
This breaks some tests.

This reverts commit e948279818.
2025-01-03 19:55:15 +01:00
Hans Goudey
48cecef1e0 Cleanup: Use is_same_any_v wrapper
Pull Request: https://projects.blender.org/blender/blender/pulls/132567
2025-01-03 19:15:01 +01:00
Hans Goudey
3df7c6a428 Fix #132426: Crash loading old file with noise texture node
Some recently added versioning code incorrectly assumed that the
noise texture node would always have its storage struct allocated.
Just create the storage struct in versioning where necessary, to
avoid relying on defaults not changing in the future when the
struct is created as the node tree is initialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/132555
2025-01-03 18:47:32 +01:00
Jacques Lucke
e948279818 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.

Pull Request: https://projects.blender.org/blender/blender/pulls/132560
2025-01-03 18:42:09 +01:00
Philipp Oeser
b79af08ade Fix #132548: keyframe_points.insert() misinterprets arguments
Symptoms were broken `keyframe_type` & `options` (e.g. falsely assuming
'NEEDED' option when this was not provided at all).

The parameter order was flipped (leading to false interpretations for
the enum (flag) values).

For historic reference: the `keyframe_type` was introduced in
570fbba3f3 (but in a way that would have broken the existing API),
that was tried to be corrected in 46aaa53998 (but that commit only
flipped the order in the parameter definitions, not in the actual
function `rna_FKeyframe_points_insert`).

So to resolve, correct the order in the function declaration.

Pull Request: https://projects.blender.org/blender/blender/pulls/132595
2025-01-03 17:42:07 +01:00
Philipp Oeser
8fa61bfdef Fix #132254: Symmetrized Limit Location Constraint wrong enabled min/max
We were already flipping the minima & maxima the right way, but the
checkboxes for which axis gets limited to a min/max were not updated. So
when a max X actually gets a min X, those checkboxes should be set
accordingly (now done).

Pull Request: https://projects.blender.org/blender/blender/pulls/132265
2025-01-03 17:41:31 +01:00
Christoph Lendenfeld
7636e6fca4 Fix #132182: Graph Editor slider increment having no visible effect
The issue was that the range for the time offset operator
was so large, that the 0.1 increment seemingly had no effect.
The solution is to add functionality to the slider to specify the increment step.
Since the time offset operator deals in frames it made sense to snap to whole numbers.

Also fixes #132187
For that the increment step has been chosen to allow for 10 steps in the slider range.

Pull Request: https://projects.blender.org/blender/blender/pulls/132554
2025-01-03 17:23:12 +01:00
Sean Kim
4c8fd7a17e Cleanup: Adjust some Sculpt undo multires comments
Pull Request: https://projects.blender.org/blender/blender/pulls/132600
2025-01-03 17:20:11 +01:00
Hans Goudey
c01b7ff9ad Fix: Mistaken node legacy enum change in recent refactor
Mistake in b43e2168e3.
2025-01-03 10:03:02 -05:00
Sybren A. Stüvel
266d1e8d2f Anim: do not draw constraint relationship lines for invalid targets
Only draw relationship lines between a constrained object/bone and its
target when there is actually a valid target. Previously Blender would
always draw a line, which would go to the world origin when the
constraint has no target. This was visually rather noisy and potentially
even misleading when there is actually an object at the origin.

Fixes #131477

Pull Request: https://projects.blender.org/blender/blender/pulls/132592
2025-01-03 15:51:40 +01:00
Sean Kim
c9ffd42417 Fix #132530: Undo after Apply Base doesn't correctly restore data
With the recent sculpt refactor project prior to 4.3, the Sculpt undo
system was changed such that an individual `SculptUndoStep` would store
a single type on the `StepData` struct instead of storing individual
nodes that each had their own type.

This works for most operators supported by Sculpt Mode, however, the
`Apply Base` multires operator was dependent on needing to store both
Geometry and Position data.

To restore old functionality, this commit removes the need for storing
this Position data by instead forcing the object space Sculpt Mode
multires data to be flushed to the tangent space MDisp data prior to
saving the current geometry state so that it can be restored correctly.

This has the following benefits:
* We can continue to assume that Geometry steps represent full-mesh
  changes and should require no further specialized processing.
* This better aligns with the future state of trying to flush this
  multires data on a per-stroke basis instead of needing to wait unti
  lthe user either quits or exits sculpt mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/132569
2025-01-03 15:06:24 +01:00
Sybren A. Stüvel
61f8364dd1 Refactor: Anim, reduce cognitive complexity in ..._get_tarmat functions
Simplify the `${CONSTRAINT}_get_tarmat` functions, mostly by reducing
nesting via early returns.

Code like this:

```cpp
void blabla_get_tarmat(...) {
  if (VALID_CONS_TARGET(ct)) {
    // ... do useful stuff.
  }
  else if (ct) {
    unit_m4(ct->matrix);
  }
}
```

now looks like:

```cpp
void blabla_get_tarmat(...) {
  if (!VALID_CONS_TARGET(ct)) {
    unit_ct_matrix_nullsafe(ct);
    return;
  }

  // ... do useful stuff.
}
```

This is mostly done as preparation for an upcoming functional change.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/132591
2025-01-03 14:07:29 +01:00
Campbell Barton
33e38c605f Cleanup: correct indentation for CMake files, strip trailing space 2025-01-03 13:23:38 +11:00
Harley Acheson
72a9990779 Fix #92998: Allow UI List Reversed Alpha Sort
UI Lists has some buttons at the bottom related to sorting. One button
sorts in alphabetical order, the other reverses sort order. But when
both buttons are enabled you don't get reserved alpha. Contrary to what
the buttons show, enabling "reversed" turns off alpha sorting so you
just get a reversal of the natural order. This button fixes that so you
can reverse both natural and alpha sorted lists.

Pull Request: https://projects.blender.org/blender/blender/pulls/132578
2025-01-03 02:28:51 +01:00
Iliya Katueshenock
fa8574b80b Fix: Geometry Nodes: Triangulate Mesh node assertion case
Typo from ea875f6f32.
A range of triangles is pushed into the mask, but _last_ instead of _end_
was  used. This was found in #132333 report, but this PR does not fix a
reported issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/132405
2025-01-03 01:42:39 +01:00
Charles Wardlaw
0c544974d1 USD: option to convert the scene's meters per unit value
This rescales the whole scene by its root transform to match the same
visual size while not forcing the user to wait for scale to be applied to
each object.

This is requested by studios whose main applications / USD scenes are
in CM, because referencing and payloading scenes from disparate scales
can cause issues at resolution time.

If "Apply Unit Scale Conversion" is unchecked on import, the user now
has the ability to bring the objects in with a scale factor of 1.0, so that the
objects may be edited as if Blender's scene units matches the imported
stage's.

At export time, a "Stage Meters Per Unit" value can be chosen from a list
of common measurements, as well as setting a custom value.

Co-authored-by: kiki <charles@skeletalstudios.com>
Co-authored-by: Michael Kowalski <makowalski@nvidia.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/122804
2025-01-02 22:04:58 +01:00