Commit Graph

120055 Commits

Author SHA1 Message Date
Falk David
ff625b79f6 GPv3: Expose "Use Lights" option in the object data properties
Adds a `use_lights` option to the layer in RNA and
exposes the setting in the object data properties under
the layer opacity.
2024-04-12 13:19:05 +02:00
Aras Pranckevicius
dc9d2d41f5 Fix #120499: OBJ MTL with Ni=0 are displayed as gray
Some files out there have index of refraction 0.0, which is
not quite valid. Ignore these and keep default IOR in the imported
material.
2024-04-12 14:16:46 +03:00
Christoph Lendenfeld
3eda9619f9 Anim: precalculate bounding indices for key drawing in the Graph Editor
While the drawing code already skipped drawing any key points that are not in view,
it did that with an `if` check within the `for` loop. This can be speed up quite a bit
by calculating the bounding indices beforehand and only iterating that range.

| - | Before | After |
| - | - | - |
| `draw_fcurve_selected_keyframe_vertices` | 44850ns | 3194ns |
| `graph_main_region_draw` | 32ms | 21ms |

Test file used
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend

Pull Request: https://projects.blender.org/blender/blender/pulls/120521
2024-04-12 12:41:45 +02:00
Jeroen Bakker
4ae9948f3a GPU: Improve push constants tests
- Expected results should come before actual result.
- Add test case for 8192 bytes as apple has a push constants size of 4096.
- Add more variation to the first order test data.

Improvements detected when working on vulkan backend and validated they
work on metal and opengl as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/120557
2024-04-12 12:26:26 +02:00
Christoph Lendenfeld
0157fede80 Anim: don't include handles when calculating FCurve bounds in Graph Editor
On heavy scenes, the function `get_graph_keyframe_extents`
takes up a considerable amount of the time (~50%) it takes to draw the Graph Editor.
This function is called to set the `View2D` extents which makes the scrollbars work properly.
I'd argue that level of precision isn't needed just to display scrollbars.
Passing the flag as `false` speeds up the drawing  code by 22%.

Timings for `graph_main_region_draw`
| Before | After |
| - | - |
| 32ms | 25ms |

Timings for `get_graph_keyframe_extents`

| Before | After |
| - | - |
| ~16ms | ~8ms |

Test file used
https://download.blender.org/ftp/sybren/animation-rigging/heavy_mocap_test.blend

Pull Request: https://projects.blender.org/blender/blender/pulls/120519
2024-04-12 11:27:36 +02:00
Bastien Montagne
b56457aa5e Core: ID Management: Make 'Purge' operation always recursive by default.
Inherited from previous versions of this feature, by default the Purge
operation from the Outliner would remove all unused IDs, recursively.
The same operation invoked from the File -> Clean Up main menu would by
default only delete directly unused IDs.

Now both will by default remove all (directly or indirectly) unused data.
2024-04-12 11:25:00 +02:00
Sybren A. Stüvel
d47e0c8ab9 Refactor: extract common code from make_new_animlistelem()
Replace copy-pasted code with a function call. This will make the intro-
duction of the `Animation` data-block much easier later on.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/120533
2024-04-12 11:17:13 +02:00
Campbell Barton
5b1a0a80fa STL: sanitize object name before using in a path
Object names can contain "/" & "\" and aren't safe to use in paths,
use BLI_path_make_safe_filename to ensure the name can be used in a
path.

Ref !120515
2024-04-12 17:07:52 +10:00
Campbell Barton
78413ff4e2 Fix error resetting the theme which would add a new theme
Regression caused by [0], also correct memcpy calls that overwrite
listbase link variables and the theme name, note that this is more a
code-correctness issue as it wouldn't cause user visible bugs.

[0]: adbec9eea9
2024-04-12 16:54:57 +10:00
Campbell Barton
0bb6317035 Theme: store the last loaded preset as a filepath
This is needed so we can reliably know which extension is associated
with a theme, so a theme can be refreshed on update and cleared when
uninstalled, needed to resolve !120289.
2024-04-12 13:23:09 +10:00
Aaron Carlisle
f5bae8924d UI: Rename "QT rle / QT Animation" to "QuickTime Animation"
This is in accordance of the Human interface guidelines.
2024-04-11 23:03:36 -04:00
Hans Goudey
52cff75ce0 Geometry Nodes: Avoid repeated node tools lookup when empty
Currently the node tools asset tree for extending 3D view headers is
rebuilt whenever it's cleared, which is done by clearing the tree's storage.
That means the data is rebuilt on every redraw if there are no node tools
and the tree storage is empty. With larger asset libraries that can be
quite expensive.

Now, instead of clearing the map, use a new dirty tag to store whether
the asset tree is out of date compared to the assets.

This should resolve #120494
2024-04-11 17:26:08 -04:00
Hans Goudey
ed8a97131f Fix: Typo in asset report message 2024-04-11 15:28:40 -04:00
Sean Kim
f7d5ec8661 Refactor: Remove trim variables from SculptSession
This PR moves the three sculpt trim gesture variables from
`SculptSession` into the `TrimOperation` `struct` to reduce
the size of the former and make it less likely that the data
is depended on in other operators.

Pull Request: https://projects.blender.org/blender/blender/pulls/120504
2024-04-11 20:55:11 +02:00
Ray Molenkamp
8b9743eb40 CMake: Change build flags to use SSE42 if available
This cleans up our `TEST_SSE_SUPPORT` macro to only test
for SSE42 and passes the flags to the CMAKE_C/CXX_FLAGS

the cpu check module needed to move to its own folder since
the flags at the end of a CMakeLists.txt appear to be used
for all targets inside a CMakeLists file and cpu_check cannot
be build with sse42 flags.

This only affects Mac/Linux since MSVC has no buildflags
to target SSE42

Pull Request: https://projects.blender.org/blender/blender/pulls/118468
2024-04-11 20:46:14 +02:00
Iliya Katueshenock
0bd6279504 Nodes: Display node label for tooltips on a free reroute
It is not so informative to display `Input` (name of input socket)
tooltip for free reroute node. Instead, use label for this.

Pull Request: https://projects.blender.org/blender/blender/pulls/120534
2024-04-11 19:16:07 +02:00
Jacques Lucke
248dafef74 Geometry Nodes: use rotation socket in Curve to Points node
Looks like this was forgotten before. Other similar sockets have been converted already.

Pull Request: https://projects.blender.org/blender/blender/pulls/120526
2024-04-11 19:05:22 +02:00
Falk David
0f72f67d56 Fix: GPv3: Crash after conversion because of strokes with no points
In GPv2 strokes could technically have zero points.
`CurvesGeometry` doesn't allow this, so we need to make
sure to explicitly skip over strokes with no points.

Pull Request: https://projects.blender.org/blender/blender/pulls/120536
2024-04-11 19:03:34 +02:00
Jacques Lucke
486947398f Geometry Nodes: add invertable boolean output to invert matrix node
Not all matrices are invertable (e.g. when a transformation matrix is has
a scale of zero), and it's sometimes important when a matrix is.

This also better specifies the behavior when the matrix is not invertable:
the identity matrix is returned.

Pull Request: https://projects.blender.org/blender/blender/pulls/120530
2024-04-11 18:28:57 +02:00
Jason Fielder
5f86faf3a5 Metal: Fix write-only qualifier on shader generation
A small logic issue caused all write-only image resources
to be tagged as read-write in all cases. This caused
correctness issues on Intel and AMD GPUs which
are resolved through this change.

Change also yields a small performance uplift
due to enabling improved non-dependent workload
scheduling.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/120528
2024-04-11 18:17:40 +02:00
Sean Kim
2582664f67 Refactor: Organize and fixup functions in sculpt_trim.cc
This PR performs the following refactors in sculpt_trim.cc:

* Remove `depth_front` and `depth_back` as `struct` properties, as they
  are only used for generating the Mesh
* Moves the `calculate_depth` call into the `generate_geometry` step as
  the latter is dependent on data from the former already
* Reorganize the methods so the overall file reads better.
* Minor comment nits and additions

Pull Request: https://projects.blender.org/blender/blender/pulls/120331
2024-04-11 17:53:46 +02:00
Iliya Katueshenock
9f89cc5072 Refactor: Nodes: Generate socket tooltips in more generic way
Split code to separate functions depending on the source of info for
socket inspection. Each function retrieves some optional string.
Collecting of result string is just loop.

Pull Request: https://projects.blender.org/blender/blender/pulls/120496
2024-04-11 17:52:59 +02:00
Jacques Lucke
9a78d523b0 Fix: matrices were printed in transposed order in some tooltips 2024-04-11 17:27:24 +02:00
Jeroen Bakker
9c1cba528b OpenGL: Remove Apple specific workarounds
This PR removes apple specific OpenGL workarounds. OpenGL on Apple isn't supported
so they can be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/120522
2024-04-11 17:25:21 +02:00
Michael Kowalski
65748260f9 Fix: USD: animated primvar import
Fixed bug preventing update of time varying attribute values when
reading USD meshes with the mesh sequence cache modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/120500
2024-04-11 17:22:44 +02:00
Jacques Lucke
f771f83029 Geometry Nodes: better support for tiny triangles in reverse uv sampling
The reverse uv sampling operation generally fails when there the sample position
is within more than one uv triangle. Unfortunately, the combination of limited
floating point accuracy and very small triangle areas caused this case
sometimes, even if the triangles don't actually overlap. This happens relatively
rarely, but if it does, it causes annoying artifacts. The solution is to only
detect these kinds of overlapping triangles if they have a certain minimum size
and to be more relaxed otherwise.

Pull Request: https://projects.blender.org/blender/blender/pulls/120408
2024-04-11 17:15:55 +02:00
Aras Pranckevicius
dfb774213d Fix #120488: PLY importer crashes on degenerate (1 or 2 vertex) faces
Make it match behavior of the previous Python importer: it was
accepting such faces, and then always calling mesh validation function
that got rid of them. Instead of doing the whole validation cost,
just do not add such faces in the first place.
2024-04-11 17:21:33 +03:00
Hans Goudey
3d1bf4eb74 Fix: Properly free/allocate non-trivial shrinkwrap cache struct
Mistake in 0b80d5e755

Pull Request: https://projects.blender.org/blender/blender/pulls/120527
2024-04-11 16:15:18 +02:00
Ray molenkamp
db875033f3 makesdna/rna: cleanup duplicated translation units
Historically makesdna/rna did not link bf_guardedalloc for
some reason, but during one of my cmake cleanups have picked up
this dependency anyhow. To prevent duplicate symbols, remove the
now duplicated translation units as linking bf_guardedalloc has
seemingly not caused any issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/120490
2024-04-11 16:08:50 +02:00
Sybren A. Stüvel
f9890fd98d Anim: fix animation paths when renaming bone collections
Bone collections are drawn in the new tree view by accessing properties
from `armature.collections_all[...]`, which means that drivers and
fcurves also target those. This is now taken into account when updating
the bone collection name.

For context: in Blender 4.0 the UIList used `.collections[...]` instead,
for which renaming was already handled properly.

Pull Request: https://projects.blender.org/blender/blender/pulls/120517
2024-04-11 15:40:59 +02:00
Sybren A. Stüvel
ded8c5d6e6 Fix #120447: Anim/Drivers on Bone Collections created in 4.0 break in 4.1
Use versioning code to change Drivers & F-Curves targeting
`armature.collections[...` to target `armature.collections_all[...`
instead. The former contains the root collections only, whereas the
latter contains all of them in a flat list. Not only does this fix the
tree view (it binds to properties via the `.collections_all` RNA path),
but also this makes the drivers & animation of the properties work even
when the hierarchy changes.

Note that both `.collections` and `.collections_all` give access to all
bone collections. The former just requires iterating hierarchically,
that is, via `some_collection.children`.

Pull Request: https://projects.blender.org/blender/blender/pulls/120514
2024-04-11 15:26:47 +02:00
Jason Fielder
be32bc5b72 Metal: Add AMD support for subpass transition
Adds support for subpass transition for AMD/Intel IMR
GPUs. This enables correct functioning of EEVEE Next
deferred lighting pass on AMD platforms.

The emulation is consistent with the OpenGL approach
of generating additional texture bindings in the shader
for subpass inputs, and splitting render passes across
sub-pass boundaries.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119784
2024-04-11 15:23:53 +02:00
Iliya Katueshenock
4049309071 Fix: Geometry Nodes: GP3 component in tooltip without experimental option ON
Do not display this GP component in tooltip for some nodes which is support this.

Pull Request: https://projects.blender.org/blender/blender/pulls/120525
2024-04-11 15:21:04 +02:00
YimingWu
e7e3767056 Fix #120457: interpolating curves ignores cyclic attributes
`interpolate_curve_attributes()` did not transfer `cyclic` attribute to
target curves. This fixes the the problem and allows Interpolate
Curves node to interpolate cyclic curves and also work between a cyclic
curve and a non-cyclic curve.

Pull Request: https://projects.blender.org/blender/blender/pulls/120460
2024-04-11 15:12:13 +02:00
Jacques Lucke
549d02637a Curves: add menu to add some primitive curves in edit mode
This adds operators to add a bezier and circle primitive in curves
edit mode. The operators support the same settings as in the
legacy curve edit mode. The `shift+A` shortcut is added as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/120513
2024-04-11 15:11:02 +02:00
Iliya Katueshenock
a03c3d16d8 Fix: Ensure null terminator for TIP_ string
Make sure TIP_ function will be called for string with null terminator.

Pull Request: https://projects.blender.org/blender/blender/pulls/120524
2024-04-11 14:59:57 +02:00
Philipp Oeser
2f67c45b65 Fix: renaming an ID does not properly update actions in the NLA
`BKE_animdata_fix_paths_rename` would tag the owner ID itself
(`ID_RECALC_SYNC_TO_EVAL`) upon renaming when a corresponding fcurve was
found/fixed, however the action itself wasnt tagged. "The action is an
own datablock, meaning, changes to f-curves need to copy those changes
to all evaluated versions of the action datablock" (wording from
4045730d58).

(this is also the reason the action would "fix" itself after entering
tweakmode on it in the NLA, since that ripples down to
`ANIM_list_elem_update` -- which does the tagging on the action then).

Part of #104055

Pull Request: https://projects.blender.org/blender/blender/pulls/120292
2024-04-11 14:32:14 +02:00
Sergey Sharybin
168f3beb16 Fix #120463: Slow evaluation of disabled modifier pointing to a collection
Collections which were pointed by a modifier used to follow visibility of the
current object, and this visibility is static throughout the lifetime of the
dependency graph.

Change the code so that collections pointed by modifiers rely on the visibility
flushing, allowing to be optimized out from evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/120516
2024-04-11 14:20:31 +02:00
Pratik Borhade
a656ce5c16 UI: Remove active vertex theme option for 3d view and UV editor
`editmesh_active` theme is used to for active mesh element.
`vertex_active` is unused here (only used in graph editor) so remove it
from the 3d viewport and UV editor theme.

Found this in #119640

Pull Request: https://projects.blender.org/blender/blender/pulls/119649
2024-04-11 13:19:06 +02:00
Pratik Borhade
341af348d9 Fix #120461: Outliner: Clicking Collection icon does not switch Properties tab
This is due to missing case for layer collection in `outliner_set_properties_tab`

Pull Request: https://projects.blender.org/blender/blender/pulls/120464
2024-04-11 13:00:13 +02:00
Campbell Barton
3a8cceee7d Cleanup: remove redundant checks & assignments 2024-04-11 20:47:07 +10:00
Campbell Barton
271aedffbe Cleanup: quiet missing-declarations warning 2024-04-11 20:19:01 +10:00
Campbell Barton
7e5a6d8dd5 Cleanup: correct argument order & naming
Correct swapped arguments, no functional changes.
2024-04-11 20:19:01 +10:00
Clément Foucault
00f4c9cbec Fix: EEVEE-Next: GLSL Compilation missing saturate declaration 2024-04-11 12:17:49 +02:00
Clément Foucault
b4bc96cc41 Cleanup: EEVEE-Next: Move light clamping out of volume_light 2024-04-11 11:51:58 +02:00
Clément Foucault
969af3e8be Cleanup: EEVEE-Next: Change clamping function to allow negative values
And also simplify the code.
2024-04-11 11:51:58 +02:00
Jacques Lucke
183ac7d2a2 Fix: update auto bezier handles after toggling cyclic 2024-04-11 11:50:35 +02:00
Christoph Lendenfeld
fb22ee6f0c Refactor: BeztMap Array to C++ Vector
Instead of using `MEM_callocN` to create an array of `BeztMap`
use a `blender::Vector`. This has the advantage that we don't need to worry about
freeing the memory.
In addition to that it can be passed as a `Span`, removing the need to pass the
length as a separate argument.
Doing that also allows to use the C++ syntax for `for` loops.

This also gives a small performance boost
| Before | After |
| - | - |
| 288ms | 260ms |

Pull Request: https://projects.blender.org/blender/blender/pulls/120507
2024-04-11 11:47:15 +02:00
Jeroen Bakker
c15e5116ab Vulkan: MoltenVK Support for Developers
MoltenVK original intent was to let developers work on a mac system developing
for the vulkan eco-system. MoltenVK doesn't support all the features that we
require and would require additional workarounds to be actually supported.

It is not expected that we will release Blender with MoltenVK for this reason.
But it still has value for shader developers to validate shaders on metal and
vulkan on a single platform.

![image](/attachments/9a4a9904-a5f6-4922-896d-744dfb78244c)

Pull Request: https://projects.blender.org/blender/blender/pulls/117940
2024-04-11 11:04:43 +02:00
Jason Fielder
fc68a05e7e EEVEE Next: Specialize additional film parameters
Specializing other frequently used film parameters
results in an additional ~20% uplift in film pass
performance. Measured on Apple Silicon.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/119736
2024-04-11 10:58:17 +02:00