Commit Graph

113436 Commits

Author SHA1 Message Date
Jacques Lucke
fa33eb65bf Fix: missing translation in spreadsheet 2024-09-26 19:03:11 +02:00
Hans Goudey
6eea579f11 Fix #128004: Clay strips tip roundness ignored with 1.0 hardness
Caused by a subtle mistake in the translation of `sculpt_apply_hardness`
in 1d7dc7190f.
2024-09-26 13:01:18 -04:00
Hans Goudey
c1ab271480 Cleanup: Sculpt: Use C++ math types for brush cube distances 2024-09-26 13:01:18 -04:00
Harley Acheson
7b0c18afb4 UI: Automatically Add Some Tooltip Description Periods
While we continue to improve our tooltips, this PR appends a period to
descriptions if it does not already end in punctuation (.!?), or does
not contain a bullet character. This only does so under the same
circumstances as in earlier code, removed in #125460.

Pull Request: https://projects.blender.org/blender/blender/pulls/128097
2024-09-26 17:53:28 +02:00
Sean Kim
6eac125f24 Fix: Draw face set does not work for multires / dyntopo
Missed in 60ab232afb

Pull Request: https://projects.blender.org/blender/blender/pulls/128150
2024-09-26 17:37:50 +02:00
Sean Kim
f3121a3b96 Fix #128143: Relax face sets doesn't modify mesh
Missed in d64f62e4fa

Pull Request: https://projects.blender.org/blender/blender/pulls/128149
2024-09-26 17:36:54 +02:00
Jacques Lucke
5c3d215bfc Fix: Geometry Nodes: support Material Selection node for curves
The material handling on curves was not super strong yet because there was not a
lot of need for it. However, now with Grease Pencil it's much more likely that
material selections are used on curves.

The patch is larger than one might expect at first, because we have to pass more
information into the field context in many places, because the materials are
stored on `Curves` and not `CurvesGeometry`.

Related to #128109.

Pull Request: https://projects.blender.org/blender/blender/pulls/128182
2024-09-26 16:22:06 +02:00
Jeroen Bakker
725b5027fb Vulkan: Refactor immediate mode
Immediate mode uses the old 'resource tracker' which has been replaced
by swap chain resource pools. This PR optimizes immediate mode buffers
by utilizing resource pools.

Pull Request: https://projects.blender.org/blender/blender/pulls/128188
2024-09-26 16:01:30 +02:00
Christoph Lendenfeld
bcd0d14943 Versioning for layered actions
This implements versioning code to go from legacy to layered action.
The versioning is only triggered when the experimental flag for
Multi-Slot actions is enabled.

All the actions are converted in place, which should be fine because
of backwards and forwards compatibility with layered actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/127842
2024-09-26 15:45:53 +02:00
Sergey Sharybin
5f8721d92a Fix #127964: Crash when baking from mesh with no faces
The issue has been introduced in aca27e5462.

Before that change the memory used for baking was cleared-alloced,
but now it relies on the default object initialization. This could
leave fields uninitialized.

Pull Request: https://projects.blender.org/blender/blender/pulls/128181
2024-09-26 15:45:02 +02:00
Sergey Sharybin
a1a00ec49c Fix: Uninitialized variable in versioning code
The issue is originally caused by #120797.

Pull Request: https://projects.blender.org/blender/blender/pulls/128189
2024-09-26 15:42:30 +02:00
Sybren A. Stüvel
147d8aad54 Anim: Show Action Slot type in panel + change type icon RNA prop
Anim: Show Action Slot type in panel + change type icon RNA wrapper name

This PR combines two changes, both necessary to properly show the
Action Slot ID type in the GUI:

1. Expose the slot's ID type as an RNA enum property `id_root`, in the
   same way that the DNA `Action::idtype` is exposed as
   `Action.id_root` in RNA. The only differences are that this
   property is read-only on slots (it is supposed to be correct, and
   if it's not, I'd prefer a bug report over people working around
   this), and that the default value is named differently (`ANY` on
   Actions, `UNSPECIFIED` on Slots). The latter is done to clarify
   that this is not a situation that will last for long; as soon as
   the slot is assigned to any ID, it will be locked to that ID type.

2. Rename the RNA property `ActionSlot.idtype_icon` to
   `ActionSlot.id_root_icon` to be consistent with the above.

And of course the type is drawn in the Slot properties panel in the
Action editor. This now replaces the icon in the slot name (in the
same panel), so that it's clearer that that is the slot name, and not
an object/material/whatevertype name.
2024-09-26 15:33:44 +02:00
Nathan Vegdahl
124bae5a4d Fix: use action_treat_as_legacy() where appropriate
Previously we were using a bespoke hodgepodge of
`Action::is_action_legacy()` and `Action::is_action_layered()`,
sometimes in combination with checking for the Baklava feature flag,
when what we really meant is "Should this action be treated as legacy
or not?"

This commit changes the places where that's semantically what we meant
to use `action_treat_as_legacy()`. Some of those places were already
correct, using a compound conditional, but some of them weren't, and
thus were not always branching correctly. For those latter cases,
this commit is a bug fix.

Importantly, not all uses of bare `Action::is_action_legacy()` or
`Action::is_action_layered()` are semantically incorrect: there are many
places where that is the right thing to do. This commit takes care not
to touch those places.

Pull Request: https://projects.blender.org/blender/blender/pulls/128174
2024-09-26 15:16:56 +02:00
Charlie Jolly
c0a864aaa3 Fix #128102: Integer Math division has only float precision
The additional division modes were implemented with float
division then rounding to match float > int conversion in
existing float to int node.

As pointed out in the bug report the precision here is limited.

This patch replaces the float division with integer math which
increases the precision to much higher numbers.
Divide Round by due to the way it is calculated has less precision
than Divide Floor and Divide Ceil.

Pull Request: https://projects.blender.org/blender/blender/pulls/128123
2024-09-26 14:44:09 +02:00
Campbell Barton
381898b6dc Refactor: move BLI_path_util header to C++, rename to BLI_path_utils
Move to a C++ header to allow C++ features to be used there,
use the "utils" suffix as it's preferred for new files.

Ref !128147
2024-09-26 21:13:39 +10:00
Jacques Lucke
6810084a47 Attributes: improve API to iterate over attributes
This improve the API in multiple aspects:
* No need for an additional `lookup` call to get the current attribute. This
  would internally iterate over all attributes again. This leads to O(n^2)
  behavior. Note that there are still other reasons for O(n^2) behavior when
  processing attributes (where n is the number of attributes).
* Remove the need to return a value from the iteration code to indicate that the
  iteration should continue. This is now the default behavior. The iteration can
  still be stopped by calling `iter.stop()`.
* Easier access to `is_builtin` property.
* Iterator callback only has a single parameter instead of two (of which one is
  sometimes unused).

Pull Request: https://projects.blender.org/blender/blender/pulls/128128
2024-09-26 12:59:00 +02:00
Nathan Vegdahl
45085b2b0e Fix: cannot assign actions to IDs without animdata
This bug was introduced in #126561. The issue was that the UI action
selectors no longer ensured that animdata existed before attempting
to assign an action, which would then cause the assignment to fail.
However, this was only the case in Blender builds without experimental
features, since the new Baklava code paths would otherwise be taken,
which *do* handle this correctly.

This fixes the issue by ensuring animdata in the non-experimental code
paths again.

Pull Request: https://projects.blender.org/blender/blender/pulls/128083
2024-09-26 12:34:41 +02:00
Pratik Borhade
d10db547a7 Fix: Assert drawing GPv3 outline stroke
This is due to incorrect domain type.

Pull Request: https://projects.blender.org/blender/blender/pulls/128162
2024-09-26 12:07:41 +02:00
Jeroen Bakker
70313f68ce Vulkan: Log selected device
Currently the log only contained the first compatible device. It is
more important to the user to know which device is used.

This PR increases the level of the first compatible device so it is only
visible when increasing the log level. It reports the device, driver and
vendor when starting blender with `--debug-gpu`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128168
2024-09-26 12:05:09 +02:00
Jeroen Bakker
88b5467e0e Vulkan: Batch Upload Descriptor Sets
Descriptor sets will be uploaded in batch. This allows drivers to
do additional optimizations or at least push some looping to the
driver side.

Pull Request: https://projects.blender.org/blender/blender/pulls/128167
2024-09-26 12:04:09 +02:00
Jeroen Bakker
d75cf2efd4 Vulkan: Refactor resource binding
Resource binding was over-complicated as I didn't understood the state
manager and vulkan to make the correct decisions at that time. This
refactor will remove a lot of the complexity and improves the performance.

**Performance**

The performance improvement is noticeable in complex grease pencil
scenes.

Grease pencil benchmark file picknick:
- `NVIDIA Quadro RTX 6000` 17 fps -> 24 fps
- `Intel(R) Arc(tm) A750 Graphics (DG2)` 6 -> 21 fps

**Bottle-neck**

The performance improvements originates from moving the update entry
point from state manager to shader interface. The previous implementation
(state manager) had to loop over all the bound resources and find in the
shader interface where it was located in the descriptor set. Ignoring
resources that were not used by the shader. But also making it hard
to determine if descriptor sets actually changed. Previous implementation
assumed descriptor sets always changed.

When descriptor set changed a new descriptor set needed to be allocated.
Most drivers this is a fast operation, but on Intel/Mesa this was measurable
slow. Using an allocation pool doesn't fit the Vulkan API as you are only
able to reuse when the layout matches exactly. Of course doable, but requires
another structure to keep track of the actual layouts.

**Solution**

By using the shader interface as entry point we can:
1. Keep track if there are any changes in the state manager. If not and the
   layout is the same, the previous shader can be reused.
2. In stead of looping over each bound resource, we loop over bind points.

**Future extensions**

Bundle all descriptor set uploads just before use. This would be more
in line with how 'modern' Vulkan should be implemented. This PR already
separates the uploading from the updating and technically allows to upload
more than one descriptor set.

Instead of looking 1 set back we should measure if we can handle multiple
or keep track of the different layouts resources to improve the performance
even further.

Optional use `VK_KHR_descriptor_buffer` when available.

Pull Request: https://projects.blender.org/blender/blender/pulls/128068
2024-09-26 10:59:45 +02:00
Sybren A. Stüvel
9eae533e89 Fix #127908: Layered Action - slot users doesn't include action constraint
Use the `foreach_action_slot_use(id, callback)` iterator function to find
all action/slot uses of an ID. That already handles the action constraint,
and thus solves the issue.

Pull Request: https://projects.blender.org/blender/blender/pulls/128090
2024-09-26 10:54:16 +02:00
George Mavroeidis
ceaa064b97 Cleanup: Grease Pencil: Correct stroke outline tooltip description
Replaced "Convert stroke to **perimeter**" with "Convert stroke to **outline**"
in the outline tooltip description.

It was suggested that the description is not accurate and could be misleading
between the two terms. Thus, I simply just replaced the word across all tooltip
descriptions to keep it consistent and easily understood.

Resolves #126814.

Pull Request: https://projects.blender.org/blender/blender/pulls/127990
2024-09-26 10:39:33 +02:00
Christoph Lendenfeld
fae19d7c92 Anim: Eyedropper for bone properties
This adds an eyedropper button to properties where you can choose a bone.

Clicking it activates the modal operation and you can pick:
* Bones from the Outliner
* Bones from the 3D Viewport if the Armature is in Pose Mode or Edit Mode

## Limitation

Picking from the 3D viewport while in Object Mode doesn't work due to technical reasons.
The selection buffer is only filled with pose bones if the armature is in pose mode.
Using the picker while in object mode gives you the Armature object, not its bones.

So you cannot use the bone picker to constrain an object to a bone.
UNLESS you pin the panel with the object, go to pose mode and then pick.

There is a warning printed for those cases to tell the user why this hasn't worked.

Pull Request: https://projects.blender.org/blender/blender/pulls/121523
2024-09-26 10:05:09 +02:00
Aras Pranckevicius
70247df9b9 Fix: VSE tonemap effect is_point_inside_quad check was wrong
+0.5 should be added to integer pixel coordinate (sampling at pixel
center). This is only really visible in very specific scenarios, but
is more correct.
2024-09-26 10:17:31 +03:00
Campbell Barton
32c6f9bbd0 Cleanup: use PyModule_AddObjectRef where appropriate 2024-09-26 17:08:34 +10:00
Aras Pranckevicius
596067ea35 Fix #125446: Video decoding artifacts with some video widths
Previous fix (b17734598d) tried to fix this, but it seems that
depending on CPU and video width, ffmpeg might need at least 64
byte alignment, even if CPU we're running on is only AVX2 (32 byte
alignment). That is because some other parts of ffmpeg code
statically pick 64 or 32 byte alignment internally, depending on whether
AVX512 support is even compiled in (even if CPU might not have it).

I have checked whether this does not negatively affect a platform where
SIMD alignment is always 16 (Mac), and it does not, everything works as
expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/128107
2024-09-26 08:50:48 +02:00
Campbell Barton
473bd60164 Cleanup: clarify arguments using const or r_ prefixed return args 2024-09-26 15:03:24 +10:00
Campbell Barton
60e96e40b9 Cleanup: various non-functional changes 2024-09-26 14:05:33 +10:00
Campbell Barton
c8b6b0c8d8 Cleanup: access the object mode directly in poll functions 2024-09-26 12:07:55 +10:00
Campbell Barton
c6782f53b7 Docs: add note to avoid incorrect use of XRAY_ENABLED
Avoid issues similar to #128074 happening in the future.
2024-09-26 11:50:28 +10:00
Germano Cavalcante
b0d37b4267 Fix #128074: Edit Mesh being occluded for snapping even in Xray
Caused by 1c77779160

That commit removed the part that created the skip_occlusion_plane
variable for edit meshes. Therefore, restore that part of the code.
2024-09-25 22:42:24 -03:00
Campbell Barton
36edfe04e0 Refactor: move blenlib tempfile to C++ 2024-09-26 09:39:35 +10:00
Habib Gahbiche
aac0c2cc5f Fix #127051: Compositing using multiple Levels nodes freezes Blender
Multiple levels nodes in a row causes blender to freeze when combined with other constant operations. Also, current results of standard deviation are wrong.

The problem was that constant folding optimized constant operations away, which caused a cyclic node graph, and therefore the freeze during node graph evaluation. Preventing such optimizations solves the problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/127316
2024-09-26 01:37:23 +02:00
Sean Kim
d80011d11a Cleanup: Fix missing-declarations warning
Missed in 16550f78ea

Pull Request: https://projects.blender.org/blender/blender/pulls/128140
2024-09-25 23:13:33 +02:00
Hans Goudey
18c59d02a3 Fix: Lite build error after recent VSE commit
b4e5412a28
2024-09-25 16:04:38 -04:00
Sean Kim
16550f78ea Cleanup: Sculpt: Consolidate Flatten, Fill, and Scrape brushes
These brushes all share the same code except for a single line which
adds an optional extra filter on the factors when performing the brush
stroke and a single inversion of the offset for the scrape brush.

Pull Request: https://projects.blender.org/blender/blender/pulls/128048
2024-09-25 21:54:16 +02:00
notrudyyy
76d4686987 Cleanup: Fix mesh face corner next/prev function descriptions
Swaps the descriptions of face_corner_prev and face_corner_next to be correct.

Pull Request: https://projects.blender.org/blender/blender/pulls/128137
2024-09-25 21:52:11 +02:00
Pratik Borhade
f90e1b506f Fix: Hide id operator for menus in context menu
Continuation of !126927.  Do not show some items on the button context
menu when not appropriate. Handle the case of MenuType buttons.

Pull Request: https://projects.blender.org/blender/blender/pulls/128070
2024-09-25 21:43:41 +02:00
Hans Goudey
90ec79992f Fix: Potential crash in mesh comparison tests with mismatched attributes
Currently we allow the before/after meshes to have different
sets of attributes. But then we compare all attributes in each
mesh anyway, regardless of whether they exist or not.
2024-09-25 15:22:19 -04:00
Germano Cavalcante
504c1506b2 Fix: Snap to Grid with constraint limited to floor level
Caused by 1180a25c23

The `use_init_co` member can vary after a transformation.
It indicates whether to use the ground level or the 3D grid.
2024-09-25 16:06:21 -03:00
Miguel Pozo
2223d995fc Fix: Draw: Bounds usage
The first commit ensures IsectBoxes are not set up unless
they are valid.

The second commit renames
`drw_bounds_are_valid` to `drw_bounds_corners_are_valid`,
and `drw_bounds_culling_enabled` to `drw_bounds_are_valid`
so it's harder to set up an invalid `IsectBox` by mistake.

(Continuation of #127807)

Pull Request: https://projects.blender.org/blender/blender/pulls/128125
2024-09-25 19:58:38 +02:00
Sean Kim
df251784cd Fix: Avoid accessing face set with invalid index
When the PBVH is rebuilt, the `active_face_index` and
`active_grid_index` fields are initialized to -1. This results in a
possible segmentation fault if the `active_face_set_get` method is
called without these fields being populated.

This commit switches the raw `int` usage for `std::optional` to
better communicate the intent of these fields.

Pull Request: https://projects.blender.org/blender/blender/pulls/127959
2024-09-25 19:19:21 +02:00
Jonas Holzman
5cfe733f84 UI: Color Picker layout rework
Refactoring of the color picker popup. This simplifies code, removes
cruft, and adds new features. The Hex input is removed from its own
tab and placed at the bottom of the layout. The picker circle is made
just a bit smaller. "#" added to the hex values.

Pull Request: https://projects.blender.org/blender/blender/pulls/125675
2024-09-25 18:56:32 +02:00
Sebastian Parborg
b4e5412a28 VSE: Unwanted offset when adding a sound strip
When adding sound strips, it would in some cases be offset
from the desired start position.

This was because some sound files had a start time that was not 0
even if they didn't have any video file associated with them.
Only try to shift the sound strip around if it is added with a video
strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/127256
2024-09-25 18:53:55 +02:00
Bastien Montagne
22477956e2 Refactor: Move BPY main/public extern headers to proper C++ ones.
Pull Request: https://projects.blender.org/blender/blender/pulls/128081
2024-09-25 18:04:33 +02:00
Bastien Montagne
6c0c53161e Refactor: Move BPY bmesh headers to proper C++ ones. 2024-09-25 18:04:27 +02:00
Bastien Montagne
c3247aa4f0 Refactor: Move BPY generic headers to proper C++ ones.
NOTE: `bgl.h` was left unchanged, as it is deprecated code anyway, and
its conversion to C++ does not seem immediately trivial.
2024-09-25 18:04:27 +02:00
Bastien Montagne
4fac7828e4 Refactor: Move BPY mathutils headers to proper C++ ones.
This module actually was confusing, since only a few headers were
effectively still C ones (using the `extern "C"` blocks)...
2024-09-25 18:04:27 +02:00
Bastien Montagne
4dd11465bc Refactor: Move BPY intern remaining headers to proper C++ ones. 2024-09-25 18:04:27 +02:00