Commit Graph

120055 Commits

Author SHA1 Message Date
Miguel Pozo
9b4b248f36 EEVEE: Parallel static shader compilation
Use the `GPU_shader_batch` API to compile the EEVEE static shaders in
parallel and without blocking Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/122797
2024-06-07 16:14:46 +02:00
Miguel Pozo
fb98edf322 GPU: Add GPU_material_batch_compile
Add `GPU_material_batch` API.
It uses the new `GPU_shader_batch` from #122232 internally and it
works in the same way.

Note: This doesn't implement parallel material optimizations.

Pull Request: https://projects.blender.org/blender/blender/pulls/122793
2024-06-07 16:11:50 +02:00
Miguel Pozo
ec0dd18de5 GPU: OpenGL: Support parallel geometry and compute shader compilation
Support parallel compilation of geometry and compute shaders when
using the `GPU_shader_batch` API.

Pull Request: https://projects.blender.org/blender/blender/pulls/122792
2024-06-07 16:10:43 +02:00
Sybren A. Stüvel
22d30bc7da Refactor: Anim: use enum type for filter_mode parameter
Use `enum` type for the `filter_mode` parameter of many functions. This
makes debugging easier and just makes the code slightly easier to
understand.

Also make the function parameter `const` wherever possible. Unfortunately,
due to the `BEGIN_ANIMFILTER_SUBCHANNELS` and `END_ANIMFILTER_SUBCHANNELS`
macros (which modify `filter_mode`), this is possible less often than I'd
like.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/122882
2024-06-07 15:22:31 +02:00
Bastien Montagne
f49181d6fc Merge branch 'blender-v4.2-release' 2024-06-07 14:58:21 +02:00
Bastien Montagne
89e790d2a4 Cleanup: Improve/fix some IDProperty comments and TODOs.
Mainly correct/update some comments (e.g. missing reference to Boolean
type), and add some notes essentially about issues with current IDProp
String code (see also #86960 ).

No functional change.
2024-06-07 14:55:40 +02:00
Bastien Montagne
00461991f5 Merge branch 'blender-v4.2-release' 2024-06-07 14:38:10 +02:00
Bastien Montagne
57669600b1 Fix (unreported) GeoNode modifiers keeps 'invalid' IDProps types forever.
In case a 'compatible' old IDProperty exists,
`update_input_properties_from_node_tree` would essentially reuse it
as-is, only keeping the UI data from the freshly new IDProp it created
for the socket.

This commit instead fully re-use the newly created idprop, only copying
(and converting as needed) the value from the old one.

That way, we can be sure that the actual type of the IDProperty is reset
to its expected type, instead of being kept forever in a 'wrong' type.

Having IDProps in a stable, expected type is a sounder behavior in
general, and critical for lower-levels of code to work as expected
(like RNA diffingi, and by extension, Library Overrides e.g.)

NOTE: This is a side-finding from work on #122743 to make some idprops
statically typed, and is a pre-requirement for this to work with the
GeoNodes modifiers case.

Pull Request: https://projects.blender.org/blender/blender/pulls/122876
2024-06-07 14:34:40 +02:00
Falk David
e65981b999 Cleanup: GPv3: Add static assets for sizes of classes
The C++ classes that wrap DNA structs should never store any data.
Runtime data needs to be stored on the runtime classes/structs
and anything else needs to be put into DNA.

This adds static asserts to make sure (at compile time) that these
classes have the same size as the DNA structs (i.e. they don't store
additional data).
2024-06-07 14:22:07 +02:00
Sybren A. Stüvel
53c2ee7e37 Refactor: Anim: make some bAnimListElem fields enum-typed
Change the `bAnimListElem` fields `type`, `update`, and `datatype` from
respectively `int`, `char`, and `short` to their actual `enum` types,
respectively `eAnim_ChannelType`, `eAnim_Update_Flags`, and
`eAnim_KeyType`.

To prevent compiler warnings, all `switch` statements that try to handle
these fields have been expanded with the missing `case`s. This should
help in the future when new channel types are added, as that'll cause
more compiler warnings in those places that need updating.

One `if`/`else if`/`else` chain was converted into a `switch` for
clarity. This was actually the place where my (upcoming) code is hitting
the `BLI_assert_unreachable()`, which was the final straw for this
refactor.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/122874
2024-06-07 13:48:32 +02:00
Sybren A. Stüvel
96a024dede Refactor: Anim: move struct bAnimListElem down in its header file
Move the `bAnimListElem` struct down in its header file, so that it sits
underneath the `enum` types that it uses. This move is necessary for an
upcoming refactor where the struct actually declares its fields to be of
those enum types.

Separating the move from the actual change in type will help with
clarity in the diffs.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/122874
2024-06-07 13:48:32 +02:00
Jacques Lucke
c85b4c1f84 Merge branch 'blender-v4.2-release' 2024-06-07 13:42:14 +02:00
Jacques Lucke
68db2c8328 Fix #122607: connect deactivated viewer causes crash 2024-06-07 13:39:36 +02:00
Jacques Lucke
1573091b48 Merge branch 'blender-v4.2-release' 2024-06-07 13:26:54 +02:00
Nathan Vegdahl
a36599b323 Anim: implement 3D viewport keyframing functionality for layered actions
This modifies the 3D viewport keyframing operators to work with layered
actions.  The functionality is relative basic, and still leaves some things out.
Of particular note:

- Keyframing with keying sets does not yet work.
- User preferences such as the `XYZ to RGB` flag and the keyframe interpolation
  type are not yet used/respected.
- Something not caused by this PR but revealed by it: when the last keyframe of
  an fcurve is deleted in a layered action, the fcurve still sticks around. This
  is different from legacy actions, which delete fcurves when their last key is
  deleted. Since the "Only Insert Available" feature is based on the existence
  of fcurves, that makes the feature appear broken in some circumstances right
  now with layered actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/121661
2024-06-07 13:26:18 +02:00
Jacques Lucke
34588cd933 Fix: invalid data sharing after loading certain .blend files
This fixes a bug that happens when two drawings in the same grease pencil
data-block reference the same array. In this case, the same attribute array
pointer is written to .blend files for both drawings. However, when loading the
.blend file, it was not detected that the data is shared. Instead each drawing
would think that it was the single owner of the array even though it was shared.

The same problem can technically occur for all kinds of shared data, and not
just for grease pencil. However, only grease pencil shows this issue currently,
because it can easily happen that the same attribute is shared between different
`CustomData` within the same data-block. This very rarely happens with meshes or
curves, because different `CustomData` usually have different sizes and don't
share the same arrays.

A previous fix (cc891aa699) solved pretty much the same issues for the case
when two layers in the same `CustomData` share data. This original fix is now
generalized and is integrated with `BLO_read_shared` which makes it less error
prone. For each data-block, the `BlendDataReader` now remembers which shared
data it has loaded before so that it is not loaded again.

In the future this could be extended to support data that is shared between
data-blocks, but that's not as straight forward as one would hope currently. For
various reasons, different data-blocks could store independent data at the same
pointer. I specifically noticed that with a regression test file:
`blender/tests/data/modeling/geometry_nodes/attributes/attribute_statistics.blend`.
To support it, one solution could be to tag `BHead` in .blend files to indicate
that a specific pointer is shared and unique within the entire file. But that's
for another day.

Pull Request: https://projects.blender.org/blender/blender/pulls/122780
2024-06-07 13:22:39 +02:00
Campbell Barton
69e6240587 Merge branch 'blender-v4.2-release' 2024-06-07 16:34:09 +10:00
Campbell Barton
dc0e559cbb Extensions: remove intermediate operators for upgrade and sync
The buttons to upgrade or sync extensions called extension
operators via bpy.app.handlers, requiring awkward glue-code
which didn't show error reports in to the user.

Remove these operators and call the upgrade & sync operators directly.
2024-06-07 16:33:03 +10:00
Jesse Yurkovich
dc521516b8 Merge branch 'blender-v4.2-release' 2024-06-06 21:36:38 -07:00
Jesse Yurkovich
06581bde1b USD: use panels for Import and Export
Instead of using "box" layouts for these import/export operators, use
panels instead. Many choices for the layout and organization has come
from the `universal-scene-description` branch though it's not a 1:1
equivalent.

Motivation for using panels is two fold.

Firstly the use of panels instead of boxes is more consistent with other
parts of Blender and with the other IO features.

Secondly, in the case of an Import invoked from drag-n-drop or Export
configured on a Collection, the large number of options exposed results
in a very long layout. Panels allow us to close some sections by default
and allows the user to open/close panels based on their own needs in
general.

Along the way some effort went into standardizing the layout and wording
used as much as possible.

Pull Request: https://projects.blender.org/blender/blender/pulls/122415
2024-06-07 06:35:27 +02:00
Campbell Barton
bcb00904a8 Merge branch 'blender-v4.2-release' 2024-06-07 12:17:37 +10:00
Campbell Barton
3acff7a8a1 Correct help text for system extensions
Group `--env-system-extensions` with related arguments.
2024-06-07 12:16:21 +10:00
Campbell Barton
333cdfb691 Merge branch 'blender-v4.2-release' 2024-06-07 11:49:05 +10:00
Campbell Barton
715bbbfa0f Docs: clarification for BKE_appdir.hh folder_id
Also add doc-string for bUserExtensionRepo::flag.
2024-06-07 11:46:40 +10:00
Campbell Barton
d8a2517622 Merge branch 'blender-v4.2-release' 2024-06-07 11:37:59 +10:00
Campbell Barton
dc9430c480 Extensions: support system repositories & BLENDER_SYSTEM_EXTENSIONS
Support for "System" extensions as an alternative to the current
"User" extensions repository.

The purpose of this change is to support bundling extensions for
offline work or in environments where users setting up thier own
extensions isn't desirable, see #122512.

Details:

The default "System" repository on Linux will for example use:
- `/usr/share/blender/4.2/extensions/{system}` For system installs.
- `./4.2/extensions/{system}` For portable installs.

- Blender's default startup now has a "System" repository
  which users or administrators may populate.

- Repositories can select between User/System paths,
  setting a custom path overrides overrides this setting.

- Add "BLENDER_SYSTEM_EXTENSIONS" (matching "BLENDER_LOCAL_EXTENSIONS").

Ref !122832
2024-06-07 11:36:20 +10:00
Campbell Barton
c225828aa8 Merge branch 'blender-v4.2-release' 2024-06-07 11:14:09 +10:00
Campbell Barton
f423ec8848 Correct mistake in last commit, accidental declaration included 2024-06-07 11:12:30 +10:00
Campbell Barton
881d83031e Cleanup: minor changes to extension repository handing
- Add a function to initialize all default repositories.
- Rename function for creating extensions.blender.org repo for clarity.

Prepare for !122832.
2024-06-07 11:02:48 +10:00
Jesse Yurkovich
954bd240c8 Merge branch 'blender-v4.2-release' 2024-06-06 17:16:57 -07:00
Guillermo Venegas
26965a0758 Fix #122802: Drag and droping a .vdb file no longer works
Changes in view3d_id_path_drop_copy from 8b6a21c122 assumed that
drag-drop filepaths was handled only with FileHandlers in View3d. This
adds the missing drop-box to FileHandler conversion for .vdb files.

Pull Request: https://projects.blender.org/blender/blender/pulls/122839
2024-06-07 02:15:34 +02:00
noodlebox
b73b663309 Fix: Redundant submenus are created in the Add menu for certain catalog names
A few of the recently added submenus are not included in the list of builtin
menus, so node assets under those catalog names will generate redundant submenus.
Fixes same issue as b49c84276c for newly added nested menus.

Pull Request: https://projects.blender.org/blender/blender/pulls/122855
2024-06-06 23:39:00 +02:00
Hans Goudey
7daf5a9483 Merge branch 'blender-v4.2-release' 2024-06-06 17:19:17 -04:00
Hans Goudey
b5022828d6 Fix #122849: Curve to mesh node crash with non-point builtin attributes
If the mesh has a curve builtin attribute that's not stored on the point domain,
the creation of the attribute will fail and it can't be interpolated. Possibly this
could be supported somehow, by averaging all the values in the curve's points
or so, but for now just avoid the crash.
2024-06-06 17:18:45 -04:00
Hans Goudey
bd5bf4aac4 Cleanup: Sculpt: Resolve todo about const in auto-masking argument
It turns out the undo push is unrelated to this though.
2024-06-06 17:10:53 -04:00
Hans Goudey
5758149546 Cleanup: Sculpt: Remove unnecessary coping in auto mask orig data
The original data is retrieved just for positions below.
2024-06-06 17:06:53 -04:00
Hans Goudey
e4ab6dd8de Fix: Sculpt draw brush doesn't apply positions with deformation
Only the evaluated positions were changed when deform or subsurf
modifiers were active. This was caused by only writing to the
evaluated positions owned by the PBVH and assuming these were
aliased with the mesh positions.

There were also quite a few TODOs in the area related to an extra
positions array that was passed around that was conceptually
unnecessary. Brush deformations should be based on the evaluated
positions, but only the original positions should be written to.

This PR resolves those TODOs while resolving sculpting with deform
modifiers and shape keys. We do this by only writing to the original
mesh positions. For shape keys we use the existing translations from
the brush rather than recomputing them, and only copy the mesh
original positions to the active shape key.

This also makes it easier to remove the PBVH's copy of vertex
positions in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/122842
2024-06-06 23:05:41 +02:00
Hans Goudey
44a1e6a219 Sculpt: Split area and normal sampling per PBVH type
Part of #118145.
Previous commits attempted to reduce the deduplication
associated with this change, though there still is some.
2024-06-06 16:28:15 -04:00
Hans Goudey
313e22091d Cleanup: Sculpt: Extract functions from area sampling
In preparation for splitting the code per PBVH type.
2024-06-06 16:28:15 -04:00
Hans Goudey
46a9296c56 Cleanup: Sculpt: Use C++ types for area center/normal sampling
Also reduce variable scope, and remove an unnecessary `no_s`
variable that was leftover from when normals were stored as shorts.
2024-06-06 16:28:15 -04:00
Hans Goudey
914c400353 Cleanup: Sculpt: Move sampling code to namespace, tweak arguments
Move the code to the proper namespace and change some arguments
from the sculpt paint struct to just the brush.
2024-06-06 16:28:15 -04:00
Sean Kim
b1d2ae7efc Merge branch 'blender-v4.2-release' 2024-06-06 13:16:59 -07:00
Sean Kim
afa4523322 Fix #121008: Paint undo causes uncolored mesh
Update PBVH GPU argument initialization to prefer using the PBVH mesh
attributes instead of the evaluated mesh attributes for color.

The values can be out of sync due to differences with the evaluated
and original mesh data.

Pull Request: https://projects.blender.org/blender/blender/pulls/122850
2024-06-06 22:11:30 +02:00
Jacques Lucke
10984c1461 Geometry Nodes: resimulate current frame if it's the last cached one
The goal is to simplify debugging the "current" simulation step. Previously, when a frame
was cached already, one would have to go back to the beginning to cache everything again.
Now, the last cached simulation step is discarded and simulated again if any property that
affects it is changed.

Pull Request: https://projects.blender.org/blender/blender/pulls/122736
2024-06-06 20:47:17 +02:00
Bartosz Kosiorek
427e8ab881 UI: Add tooltips for texture shader node inputs
Pull Request: https://projects.blender.org/blender/blender/pulls/119641
2024-06-06 20:17:06 +02:00
Brecht Van Lommel
5411ace289 Merge branch 'blender-v4.2-release' 2024-06-06 19:55:53 +02:00
Iliya Katushenock
cdcefa43e3 Fix #119703: Incorrect conversion of identity quaternion to axis angle
Fix of conversion identity quaternion to axis angle. Basically,
if the length of the imaginary part-vector is zero, it is
incorrect to normalize it. Simple identity should be returned.

Pull Request: https://projects.blender.org/blender/blender/pulls/119762
2024-06-06 19:26:40 +02:00
Ray Molenkamp
d761634fb3 Merge remote-tracking branch 'origin/blender-v4.2-release' 2024-06-06 09:11:11 -06:00
Raul Fernandez
a6cfc86469 Fix #86114: Multires Displacement Smear brush + Dyntopo Error
Fixed a crash when dynamic topology is active on multires displacement smear brush

Added a check for this case at the start of the brush stroke, with a user visible error message
and cancels the operator early so no topology is modified either.

Pull Request: https://projects.blender.org/blender/blender/pulls/122453
2024-06-06 16:56:02 +02:00
Miguel Pozo
2864942dc8 Merge branch 'blender-v4.2-release' 2024-06-06 15:50:42 +02:00