Commit Graph

110076 Commits

Author SHA1 Message Date
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
Miguel Pozo
a249e93ad1 GPU: Add missing virtual destructor to ShaderCompiler 2024-06-06 15:50:09 +02:00
Brecht Van Lommel
5e1812dbb8 Merge branch 'blender-v4.2-release' 2024-06-06 15:29:35 +02:00
Sybren A. Stüvel
e49963c6a7 Refactor: Anim: type conversions for Strip and KeyframeStrip
Two quality-of-life additions to juggle the `Strip` and `KeyframeStrip`
types:

- New function `Layer.strip_add<KeyframeStrip>()` that returns a
  `KeyframeStrip` instead of a `Strip`.
- Implicit conversion operator `operator Strip &()` on `KeyframeStrip`
  so that `KeyframeStrip` can be passed to a parameter of type
  `Strip &`.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/122659
2024-06-06 15:29:05 +02:00
Brecht Van Lommel
f7797a90f6 Core: Make BLENDER_SYSTEM_SCRIPTS always add paths
Originally this would replace scripts that come bundled with Blender,
but it's unclear how this is useful.

Searching for this online mainly leads to people asking how they can
use it to add scripts. For example in a studio environment you might
want to deploy add-ons and startup scripts for all users.

Even if you wanted to use it for replacement though, it wasn't really
doing that and inconsistent for different types of scripts:

* startup: ignored
* modules: replaces bundled scripts
* presets: adds to bundled scripts
* addons (in 4.1): ignored
* addons_core (in 4.2): ignored
* startup/bl_app_templates_system: replaces bundled scripts

This change makes it add scripts from this path for all. This is a
breaking change, though arguably this feature was just broken to
begin with and not used much in practice because of that.

The alternative would be add a new set of environment variables to
avoid breaking existing behavior. But that also means keeping around the
broken behavior or fixing it in another way.

Supporting multiple paths may be used too, but for now just support
a single one as doing this for all BLENDER_SYSTEM variables is
non-trivial. The main use case for that would be add-ons anyway, and
those will mainly be handled through upcoming
BLENDER_SYSTEM_EXTENSIONS instead.

Ref #122512

Pull Request: https://projects.blender.org/blender/blender/pulls/122689
2024-06-06 15:28:44 +02:00
Julian Eisel
e425faf696 Cleanup: Replace term "radial" with "pie menu" in UI code
Code was often referring to pie menus using the term "radial" which just
obfuscates that it relates to pie menus. Just call it what it is
directly.

Doesn't replace usages of the term for names that are not strictly tied
to pie menus. Also doesn't change instances of the term in the Python
API to keep compatibility, noted in #110461.

Pull Request: https://projects.blender.org/blender/blender/pulls/122825
2024-06-06 14:55:23 +02:00
Julian Eisel
6a14cca1de Cleanup: Avoid spacial UI list lookup when not necessary
This lookup is only necessary for certain events and if not done in a
pie menu, so it can easily be avoided in many cases. Also reduces
variable scope.
2024-06-06 11:33:47 +02:00
Philipp Oeser
7e73f10f79 Merge branch 'blender-v4.2-release' 2024-06-06 11:10:24 +02:00
Philipp Oeser
9b1d81eec2 Fix #122526: Pie menu executes the active as well as the shortcut button
A bit on shaky ground here, but it looks like we actually dont want to
execute the hovered buttons value/op if we chose another item in the pie
menu. This can be achieved by using the **onfree** arg to
`button_activate_exit` called on the active(hovered) button.

Not sure if this is the correct solution tbh (but maybe it demonstrates
where the bug of #122526 can be located).
I have tested pie menus with this patch and they seems to behave
normally (even nested ones).

Pull Request: https://projects.blender.org/blender/blender/pulls/122567
2024-06-06 11:09:35 +02:00
Campbell Barton
846f86d1ad Cleanup: spelling in comments 2024-06-06 11:35:00 +10:00
Campbell Barton
0f5e816a7d Merge branch 'blender-v4.2-release' 2024-06-06 11:28:06 +10:00
Campbell Barton
949dfbfaa8 Cleanup: Python script formatting
- Double quotes for strings.
- Trailing commas when wrapped lines.
2024-06-06 11:26:28 +10:00
Hans Goudey
b99d98e826 Cleanup: Sculpt: Adjust naming of undo step struct
Change `UndoSculpt` to `StepData` and `usculpt` to `step-data`.
Previously it wasn't clear that the struct contained the data for a
single undo step and wasn't some more general thing.
2024-06-05 21:04:44 -04:00
Hans Goudey
5b73bc5db2 Cleanup: Sculpt: Avoid unnecessary function prefixes in undo code
These are redundant with the `sculpt_paint::undo` namespace.
2024-06-05 21:04:44 -04:00
Hans Goudey
0eb4981674 Cleanup: Sculpt: Avoid separate declarations for retrieving undo nodes 2024-06-05 21:04:44 -04:00
Hans Goudey
0365e7f2d7 Cleanup: Remove unused context pointer in sculpt undo step 2024-06-05 21:04:44 -04:00
Hans Goudey
b3506feaf9 Refactor: Sculpt: Avoid pushing undo node to retrieve original data
It's semantically wrong to "create" undo system data just to retrieve
it as original data. This is similar to 28f2383477 which
already made this change in a few places.
2024-06-05 21:04:44 -04:00
Campbell Barton
d98a7a7756 Merge branch 'blender-v4.2-release' 2024-06-06 10:23:16 +10:00
Campbell Barton
7f7648c6ed Cleanup: spelling in code comments & minor edits
- Use uppercase NOTE: tags.
- Correct bNote -> bNode.
- Use colon after parameters.
- Use doxy-style doc-strings.
2024-06-06 09:55:13 +10:00
Richard Antalik
941146212b Merge branch 'blender-v4.2-release' 2024-06-06 01:37:05 +02:00
Richard Antalik
702948c592 Fix effect strips can not be selected
Caused by excluding effects from selection candidates.
Exclude effects in `get_strip_handle_under_cursor()` instead.
2024-06-06 01:33:45 +02:00
Richard Antalik
aa39d5ca83 VSE: Copy strip opacity when adding effect
Blend mode was already copied from effect strip input. It is reasonable
to copy opeacity as well.
2024-06-06 01:07:28 +02:00
Lukas Stockner
db991d8ac0 Cycles: Only store per-pixel seed for vertex color baking
Currently, during baking each pixel stores a seed input that comes from the
Blender side. This is only needed for vertex color baking, however -
for regular image baking, we can just as well hash the pixel coordinates.

Therefore, we can save some memory (4 byte per pixel) by splitting the seed
info out into a separate pass and only storing it when needed.

Pull Request: https://projects.blender.org/blender/blender/pulls/122806
2024-06-06 00:45:38 +02:00
Lukas Stockner
c38b711c48 Merge branch 'blender-v4.2-release' 2024-06-05 23:18:48 +02:00
Sergey Sharybin
15b5651712 Fix/workaround linker issues of blender_test on Linux
Seems to be dependent on specific compiler/cmake version.

Is a typical mixture of missing dependencies between libraries,
object files which do not get referenced from other files in the
target, and whole-archive linking of the blender_test target.

Pull Request: https://projects.blender.org/blender/blender/pulls/122801
2024-06-05 21:46:13 +02:00
Jesse Yurkovich
e114467a54 Merge branch 'blender-v4.2-release' 2024-06-05 12:23:01 -07:00
Guillermo Venegas
5e9d19d58b IO: Import multiple Alembic files at once
Allows to import multiple alembic files in single operator call.

When importing multiple alembic files as background job, import progress
will be divided by all files, so if `5` files are imported, each file
will make progress of `20%`. This can be improved if the job text can be
customized to display for example `Import Alembic 1/5` and using 100%
progress status display for each file, but that is out of the scope of
this pr.

The Scene min and max frame are set based on the minimum/maximum frame
ranges detected from all files.

Pull Request: https://projects.blender.org/blender/blender/pulls/121492
2024-06-05 21:20:25 +02:00
Brecht Van Lommel
181faaa51b Merge branch 'blender-v4.2-release' 2024-06-05 20:46:03 +02:00
Michael B Johnson
f913fb6159 USD: Add MaterialX shader export
This change adds the ability to export MaterialX networks into the resulting
USD layer.

Details:

A new export option has been added to the USD export to enable MaterialX
export. It is off by default currently due to reasons in the caveats
section.

When enabled, it exports the MaterialX shading network alongside the
UsdPreviewSurface network, on the same USD Material. This allows the same
material to be used by renderers that don't support MaterialX, using the
USDPreviewSurface as a fallback. This is similar to setups in other DCC
packages, and matches the format we've used in our Reality Composer Pro
asset library.

It uses the existing MaterialX framework used to generate MaterialX
documents for rendering, to act as the basis for the USD graph. In this
process it also re-uses the existing texture export code as well if provided
and necessary.

Once the MaterialX document is created, use usdMtlx to generate a USD
shading network. Unfortunately, usdMtlx generates a graph that is unlike
what other DCCs that support MaterialX-embedded-in-USD generates. It
generates several extra prim hierarchies, and externalizes all shader
inputs, making them difficult to edit in other MaterialX graph editors.

To workaround this, generate the MaterialX shading network onto a
temporary stage, where we then run various pre-processing steps to prevent
prim collisions and to reflow the paths once they're converted.

The PrimSpecs are then copied over to their new path. The resulting prim
hierarchy matches what many artists we've worked with prefer to work with.

Caveats:

The Export MaterialX check is off by default. When using the Principled
BSDF, the resulting graph is very usable. However, when using some of the
other BSDFs, the shading networks generated by the existing MaterialX
framework in Blender generate some shading graphs that are difficult for
usdview and other DCC's to understand. The graph is still correct, but
because we're trying to prioritize compatibility, the default is off.

In future PRs we can aim to make the graphs for those other BSDFs play
better with other DCCs.

Other Implementation Details:

As part of this commit we've also done the following:

* Place some of the materialx graphs inside a passthrough nodegraph to
  avoid node conflicts.
* Better handle some shader output types , and better handle some
  conflict cases.
* Moved the ExportTextureFunction to materials.h due to some difficult
  to resolve header ordering issues. This has no effect on any runtime code.
* There is a test for the MaterialX export that does some basic checking to
  make sure we get an export out the other end that matches our expectations

Authored by Apple: Dhruv Govil

This PR is based on an earlier implementation by Brecht van Lommel , as well
as Brian Savery and his teams' work at AMD to implement the general
MaterialX framework within Blender.

Pull Request: https://projects.blender.org/blender/blender/pulls/122575
2024-06-05 20:43:44 +02:00
Lukas Stockner
5891a73785 Merge branch 'blender-v4.2-release' 2024-06-05 20:25:50 +02:00