Commit Graph

135620 Commits

Author SHA1 Message Date
Jacques Lucke
d588bfdb5e Geometry Nodes: improve naming and code deduplication
On this level it makes sense to have a single `add_item` function
because the operator does not take any parameters. It's also
mostly the same for different kinds of socket items except
for one line.
2024-04-29 22:45:16 +02:00
Jacques Lucke
6bd1d5de54 Fix: assert when removing element from empty array 2024-04-29 22:45:15 +02:00
Hans Goudey
76a151b9d6 Refactor: Store PBVH in unique_ptr
This requires adding a destructor and deleting move and copy assignment
for SculptSession, because (for now at least) we want to keep the PBVH
as an opaque type (though with one exception for including pbvh_intern.hh
in paint.cc for the SculptSession destructor).

Pull Request: https://projects.blender.org/blender/blender/pulls/121227
2024-04-29 22:21:24 +02:00
Hans Goudey
7c56e16e44 Cleanup: Use references for sculpt PBVH variables 2024-04-29 22:21:23 +02:00
Jacques Lucke
9c153a58c0 Fix: missing null check 2024-04-29 22:15:31 +02:00
Jesse Yurkovich
ff8261ff6a USD: Small wording and layout changes for custom properties options
Make the recently added option descriptions a bit more consistent with
each other.

Small layout change to not have so much spacing between the 2 related
export options and move them under the existing options.

Pull Request: https://projects.blender.org/blender/blender/pulls/121198
2024-04-29 21:56:32 +02:00
Jacques Lucke
0c585a1b8a Geometry Nodes: move socket items ui and operators from Python to C++
This has some benefits:
* Nodes with dynamic socket amounts can remain more self-contained
  (2 fewer files to edit with this patch).
* It's easier to reuse existing C++ code, reducing redundancy.

One new thing I'm doing here is to define operators in node files. It seems
reasonable to register operators that belong to a node together with that
node. Without this, code spreads out further than necessary without any real benefit.

This patch affects the simulation zone, repeat zone, bake node and index switch node.

The UI is slightly affected too. Since we had the UI defined in Python before,
it wasn't possible to integrate it into the node properties panel. That is possible
now and looks better anyway. The previous UI was an artifact of technical limitations.

Pull Request: https://projects.blender.org/blender/blender/pulls/121178
2024-04-29 19:50:11 +02:00
Aras Pranckevicius
3847cf4dc1 VSE: Revert strip text color to white
PR #118581 changed strip text color to be the same as active strip
theme outline, which been widely regarded as a bad move. Revert
text color to white just like it was before.
2024-04-29 20:45:34 +03:00
Frederick Solano
6e0c3231eb Anim: add bone length property to Bone Properties Panel
The Bone 'length' property is not shown in the Bone Properties Panel in Edit Mode, but it is shown in the N-Panel. This PR exposes it in Bone Properties Panel as well for UI consistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/120815
2024-04-29 18:39:28 +02:00
Nathan Vegdahl
bd3518946e Anim: implement "Copy Driver to Selected" operator
This allows the user to copy the driver(s) of a property to other selected items (e.g. objects, nodes, etc.) via the right-click menu.  The implementation is based on the "Copy to Selected" operator, and generally behaves the same except for copying drivers instead of values.

Resolves #120518
2024-04-29 18:34:57 +02:00
Clément Foucault
760a641023 EEVEE-Next: Remove slope and quantization biases
This avoid self intersection during tracing which expect
unbiased depth. We compensate by adding a 1.5 shadow pixel
offset in the normal direction which is enough to fix
most remaining self shadowing. But another bias parameter
will likely need to be added anyway.

Fixes #121194
2024-04-29 17:05:07 +02:00
Clément Foucault
387df16755 Fix: EEVEE-Next: Missing factor for PCF radius size
Oversight inside #121167
2024-04-29 17:05:07 +02:00
Hans Goudey
a63e32fabf Fix #121187: Sculpt dynamic topology crash with empty mesh
Mistake in b3aca5b28f. Some sculpt PBVH code has null checks
so I must have assumed a null PBVH was an expected situation. It turns
out those null checks are very inconsistent. We would probably be better
off removing them and ensuring the PBVH always exists.
2024-04-29 10:57:00 -04:00
Hans Goudey
d97f4493dc Cleanup: Remove unnecessary template specification in Color class
This gave a very noisy warning in GCC 14.
2024-04-29 10:57:00 -04:00
Bastien Montagne
9e94ff0d2d Fix (unreported) broken wavefront IO test in debug builds.
`face_verts` parameter of `fixup_invalid_face()` was shadowed by a local
variable, leading to asserting on the wrong data.
2024-04-29 16:54:14 +02:00
Michael Jones
9b833fdeba Cycles: Use more accurate GPU counter timestamps for profiling in Metal
This PR replaces the existing CPU wall-clock based profiling mechanism with more precise GPU counter based timestamps. As before, it is enabled by setting the env var `CYCLES_METAL_PROFILING=1`. Original implementation by Morteza Mostajabodaveh.

Pull Request: https://projects.blender.org/blender/blender/pulls/121208
2024-04-29 15:25:32 +02:00
Bastien Montagne
3ff90cb2d5 Analysis tool: LSAN suppression list: Add *libOpenColorIO*.
LSAN on builds with clang reports a lot of leaks in that library now...
2024-04-29 15:23:59 +02:00
Pablo Vazquez
6d435570de UI: Add missing icon to Move to Bone Collection
Add the "plus" icon to the "New Bone Collection" operator,
and the separator line before the list of bone collections.

It now matches the object's "Move to Collection" operator, and
Grease Pencil's "Move to Layer" operator.
2024-04-29 15:22:37 +02:00
Brecht Van Lommel
4832abf108 Cleanup: Compiler warning when building without OSL 2024-04-29 15:22:21 +02:00
Clément Foucault
e401d996aa Fix: EEVEE-Next: Wrong LOD tagging for punctual shadow maps
The root issue is that `shadow_punctual_footprint_ratio` was not
fed with Z distance but by radial distances to camera and
light.

This commit cleans up this computation by only precomputing the
film pixel radius on CPU. This allow the LOD computation to be
more local and easier to read.

Fix #119725

Pull Request: https://projects.blender.org/blender/blender/pulls/121167
2024-04-29 15:19:49 +02:00
Pratik Borhade
6e137f957f GPv3: Layer properties in dopesheet n-panel
Display layer properties in n-panel of dopesheet (grease pencil mode).
Draw code is moved inside separate classes then inherit them in actual panel drawing
class to avoid copy pasting the code in two places (in layer properties
panel and dopesheet side panel).

Part of #110056

Pull Request: https://projects.blender.org/blender/blender/pulls/120606
2024-04-29 15:14:31 +02:00
Bastien Montagne
9041eef0b8 Cleanup: Remove unused variable. 2024-04-29 14:49:50 +02:00
Bartosz Kosiorek
d655e63044 UI: Add tooltips with description of compositing nodes
As already existed for shader and geometry nodes.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121038
2024-04-29 14:48:43 +02:00
Hans Goudey
205683477f Fix #121209: Menu switch missing matrix socket 2024-04-29 08:36:25 -04:00
Omar Emara
0eacf3cfef Cleanup: Clarify variable names in Fast Gaussian 2024-04-29 15:15:37 +03:00
Sean Kim
55fc1066ac Sculpt: Polyline hide operator
This PR adds a polyline hide operator for sculpt mode as well as the
necessary generic callback code to allow using this gesture in other
selection tools.

Added features include:
* *Polyline Hide* operator
* `WM_gesture_polyline_*` callback functions for other operators
* Status bar text while using the polyline modal
* Common *Gesture Polyline* keymap for usage with the modal

Unlike the *Box Hide* and *Lasso Hide* operators, the *Polyline Hide*
operator does not provide a simple shortcut to click and show all
hidden elements in a mesh. This is because the existing operators
operate on a click-drag action while the new operator is invoked by
just a click.

Design Task: #119353

Pull Request: https://projects.blender.org/blender/blender/pulls/119483
2024-04-29 14:04:16 +02:00
Omar Emara
3d2a2a9bd2 Cleanup: Remove unused FastGaussianBlurValueOperation 2024-04-29 14:52:18 +03:00
Pratik Borhade
69ae834ce8 Cleanup: Use existing function to check region-space types
Use existing function `screen_animation_region_supports_time_follow` in
`areas_do_frame_follow` to check region-space types in case of: follow current
frame is enabled and playback is moved with arrow keys

Noticed this while checking #110620

Pull Request: https://projects.blender.org/blender/blender/pulls/120056
2024-04-29 13:26:22 +02:00
Brecht Van Lommel
d174d63866 Cleanup: make format 2024-04-29 12:43:09 +02:00
David Murmann
ee51f643b0 Cycles: Ray Portal BSDF
Transport rays that enter to another location in the scene, with
specified ray position and normal. This may be used to render portals
for visual effects, and other production rendering tricks.

This acts much like a Transparent BSDF. Render passes are passed
through, and this is affected by light path max transparent bounces.

Pull Request: https://projects.blender.org/blender/blender/pulls/114386
2024-04-29 12:37:51 +02:00
Bastien Montagne
12f0f56350 Fix clang warning: a class with a final destructor should also be final. 2024-04-29 12:20:10 +02:00
Philipp Oeser
7d70942a84 Fix #121201: Crash using scroll wheel in Movie clip editor
Crash could could happen if `Clip Display` > `Render Undistorted` was
enabled on a clip, but the clip then unlinked (code was accessing the
clips `MovieTracking` for garbage memory then).

To resolve, just check the clip prior.

NOTE: there are similar other checks (e.g. in `spline_under_mouse_get`)
that actually check the clip prior.

Pull Request: https://projects.blender.org/blender/blender/pulls/121203
2024-04-29 11:32:29 +02:00
Alaska
f8c0050a25 Shaders: Add Roughness to Subsurface Scattering Node
Matching the Principled BSDF.

Pull Request: https://projects.blender.org/blender/blender/pulls/114499
2024-04-29 10:54:29 +02:00
Lukas Tönne
f6f8006b90 GPv3: Fix initial selection mask of the grab sculpt tool
The initial mouse sample has a pressure of zero, which excludes all
points from the selection when the grab tool starts. Use a pressure of
1 to ensure all points are included.

Pull Request: https://projects.blender.org/blender/blender/pulls/121183
2024-04-29 10:46:09 +02:00
Bastien Montagne
04b907bc4e I18N: Updated UI translations from git/weblate repository (0aa94c791de0e). 2024-04-29 09:35:26 +02:00
Campbell Barton
3a5389d5ab Fix hang on startup under Wayland with the WayFire compositor
Use XDG_CURRENT_DESKTOP to check if GNOME is running.

Previously the existence of a `gtk_shell*` interface was used however
the WAYFIRE compositor provides this interface which made GHOST require
LIBDECOR.

Initializing LIBDECOR was hanging as the initial configuration was
never seen. From a quick check it doesn't seem like a bug in Blender's
LIBDECOR use, the issue may be in either LIBDECOR or WAYFIRE.
Whatever the case, LIBDECOR isn't needed so workaround the bug by
changing how GNOME is detected.
2024-04-29 12:32:22 +10:00
Hans Goudey
65803f262f Node Tools: Basic support for data-block inputs
Currently support for data-block inputs is disabled because pointer
properties in operator properties aren't properly handled in Blender
(for more info, see 871c717c6e). This commit brings basic
support for them by storing strings (data-block names) in the operator
properties instead. The main downside of using strings compared other
theoretical solutions is that data-blocks from different library files
can have the same name. This solution won't work well for those cases.
However, it still brings a lot of utility to node tools for a relatively
simple code change.

I investigated two other solutions for this that didn't work out. Using
the recently added enum custom property support didn't work because
the data-block names would still have to be unique. Plus generating an
enum would require a bunch of boilerplate code. Extending the existing
button search code to handle integer session UID backed data-blocks was
much trickier than I expected. The code there is already quite spagetti-
like, and things got out of hand quickly. That's still valid future work
though. The implementation can be changed without breaking
compatibility of files.

Pull Request: https://projects.blender.org/blender/blender/pulls/121148
2024-04-29 03:47:33 +02:00
Campbell Barton
29c7be1516 Tools: fixes and updates to duplicate header checker
Since moving to "tools/" the suggested command would modify
headers *outside* Blender's source directory (now prevented).

Since "#pragma once" was used - the duplicate header check
needed to be moved from the end to the start of the header.

Other changes:

- Add type hints.
- Exclude headers intended to be included multiple times.
- Use `argparse` for argument parsing.
- Use str.format.
2024-04-29 09:39:43 +10:00
Campbell Barton
4ec93f73a5 Cleanup: spelling in comments 2024-04-29 09:09:44 +10:00
Campbell Barton
c9dba4d31f Cleanup: use const variables & argument, remove duplicate include 2024-04-29 09:09:44 +10:00
Campbell Barton
4156a925ef Cleanup: avoid str.format when adding the strings is sufficient 2024-04-29 08:55:41 +10:00
Bastien Montagne
e5a921ad9b Fix #120103: Copy/Paste of nodes is not handling ID references properly.
This commit fixes several critical issues with previous code:
* It only covered a (very small) subset of potential ID references in a
  node (namely, just the `bNode::id` pointer).
* It completely ignored linked data case.
* It would modify ID pointers in the clipboard itself.

The new code stores ID reference info in a separate mapping. It uses the
new 'sub-data' foreach_id feature from `BKE_lib_query` to reliably and
generically process all ID pointers of a node.

The paste handling of ID pointers is split in two steps:
* All knowns ID references are searched for in current Main data-base,
  and the result (current valid ID pointer or null if not found) is
  stored temporarily in the ID references mapping.
* Once a node has been duplicated from the clipboard into the paste
  destination nodetree, its ID pointers are updated accordingly.

This allows to keep the 'reference ID' data in the clipboard always
valid, regardless of which IDs are currently existing in Main (i.e. to
keep all available data, even when opening new blendfiles, or doing
undo/redo that would affect the existing IDs).

Pull Request: https://projects.blender.org/blender/blender/pulls/121122
2024-04-28 18:59:42 +02:00
Bastien Montagne
f933dae207 BKE_lib_query: Add a partial ID usage iterator system.
The idea is to allow iterating over e.g. all ID usages of a node from a
whole nodetree, using the same generic handling as existing 'whole ID'
`foreach_id` code.

This is necessary in some cases wher a sub-data needs to processed
independently from any 'owner ID', e.g. in some copy/paste handling.

This is a pre-requirement for proper fix of nodes copy/paste (see
e.g. #120103).

Pull Request: https://projects.blender.org/blender/blender/pulls/121018
2024-04-28 17:35:02 +02:00
Philipp Oeser
0bf4568abd revert 4d49c78e74
revert Fix: weight and vertex paint radial symmetry wrong with mirror

Was causing #121155, will check again on Monday

Both vertexpaint and weightpaint would only apply all of radial symmetry
for the "initial stroke".
When going over the combinations of symmetry axis, some of radial
symmetry would be skipped, e.g. when mirroring from right to left with
`Mirror X` turned ON, a dab on the right would have radial symmetry from
that point, and an additional dab on the left from mirroring (but the
mirrored dab would not have radial symmetry on its own).

This does not lead to symmetric results at all, sculptmode also does not
behave that way (there, radial symmetry is performed on the mirror axis
as well).

Now do the same thing as in sculptmode to get symmetric results when
using mirror and radial symmetry together.
Also use the utility function to skip invalid symmetry iterations.

Stumbled over this when looking into #120843

Pull Request: https://projects.blender.org/blender/blender/pulls/120931
2024-04-28 11:36:56 +02:00
Jesse Yurkovich
16a29a7a75 USD: Add test to cover export of mesh attributes
Adds a test to validate the export of Mesh attributes for USD.

It tests that all domains and types for a Mesh object are written to the
USD file correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/121180
2024-04-28 03:53:20 +02:00
Richard Antalik
fd96b81821 Fix #120834: Retiming does not work as expected.
This happened, because of lazy initialization of clicked retiming keys.
When the key is moved, the speed changed in respect to strip start, not
(uninitialized, but drawn) key at left handle.

Initialize both keys when any virtual key is selected.
2024-04-28 03:41:52 +02:00
Jesse Yurkovich
4987ef010c Cleanup: STL: Address the ODR violation and tidy up processing
Remove the one-definition-rule violation due to two `Triangle` types
being used inside the same `blender::io::stl` namespace. Make a small
set of non-functional changes in the surrounding code along the way to
use `const` in more places.

STL had 4(!!) triangle types:
- A `class Triangle` : Used for import, contains indices
- A `struct Triangle` : Used for export, contains verts/normals, the ODR
  violation
- A `struct ExportBinaryTriangle` : Used for export but is really the
  same as the above type
- A `struct STLBinaryTriangle` : Used for import but was a duplicate
  of the above type

Now STL has just 2. The `class Triangle` containing indices during
import and a `struct PackedTriangle` containing the verts/normals for
everything else. The duplicated `BINARY_HEADER_SIZE` constant is now
common as well.

Performance remains the same for both import/export and ascii/binary.

Pull Request: https://projects.blender.org/blender/blender/pulls/121179
2024-04-28 03:06:39 +02:00
Jesse Yurkovich
211ad352af USD: Add new test file for mesh/curve attributes 2024-04-27 17:46:32 -07:00
Jacques Lucke
3e814bc702 Tools: gitea utils does not load all pages
The issue is that the default `limit` seems to be 30, and not 50. Due to the
special case for `page == 1` and the `len(result_page) < limit` check, the
`url_json_get_all_pages` function may return before all pages have been loaded.

The fix is to simply remove the `limit` parameter. It wasn't used anyway.
Using it correctly is somewhat tricky if we can't pass in the limit in the
`page == 1` case. This may result in a couple more API requests but it's
probably not a problem in practice. If it becomes a problem, we should
figure out in which cases the `page == 1` special case is actually
required (it was not in the cases that I tested).

Note that the first link returns fewer results than the second link:
* https://projects.blender.org/api/v1/users/jacqueslucke/activities/feeds?only-performed-by=true&date=2024-04-22
* https://projects.blender.org/api/v1/users/jacqueslucke/activities/feeds?only-performed-by=true&date=2024-04-22&limit=50

Pull Request: https://projects.blender.org/blender/blender/pulls/120948
2024-04-28 01:06:51 +02:00
Jacques Lucke
ab1da26e75 Fix: incorrect error message in Object Info node in tool context 2024-04-28 00:38:01 +02:00