Commit Graph

129446 Commits

Author SHA1 Message Date
Pablo Vazquez
9f2d32c154 UI: Use proper icon for nodes with UV Maps picker
It was set to none, which draws as a dot instead of the already familiar
UV Map icon used in the UV Maps list and other places.

Affects:
* UV Map
* Tangent
* Normal Map

Following !113793 efforts to unify icons.
2023-10-18 12:36:25 +02:00
Falk David
a89bb7632a GPv3: Separate/Delete Geometry node
This implements deleting a selection of layers on a grease pencil geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/113828
2023-10-18 11:54:56 +02:00
Falk David
080823f93c Fix: GPv3: Memory leak in set_name
The `set_name` function was not freeing the previously
allocated string and would leak the memory.
2023-10-18 11:50:41 +02:00
Hans Goudey
95201c6cbf Merge branch 'blender-v4.0-release' 2023-10-18 11:32:04 +02:00
Hans Goudey
b2fe1bf624 Fix #113824: Setting curves select mode changes active attribute
Currently the active attribute is stored as an index. This should be
changed to a string, but until then, adding or removing an attribute
changes the indeices. The workaround is to store the name and fix
the active attribute after the change.
2023-10-18 11:31:34 +02:00
Falk David
bc0e5cf8bd Cleanup: GPv3: Use helper to duplicate drawings 2023-10-18 11:27:01 +02:00
Falk David
74facf9841 GPv3: Add wrapper class for DrawingReference
Adds a simple C++ wrapper so we don't have to use
`MEM_dupallocN`, `MEM_freeN` etc.
2023-10-18 11:27:01 +02:00
Hans Goudey
b3460a6b2c Merge branch 'blender-v4.0-release' 2023-10-18 11:14:11 +02:00
Hans Goudey
cdae07dccf Fix #113842: Curves Info node length output always zero
Caused by a1cc621e1e. The "is_hair_length" value needs to be
set before `attr_input_name` is called because it uses the value to set
the attribute name with the "l" alias.
2023-10-18 11:13:38 +02:00
Jacques Lucke
5bee6bcedc Geometry Nodes: new Split to Instances node
This node allows splitting up a geometry into groups. A group is defined as all
elements with the same group id. The output contains an instance per group.
The `Group ID` output can be used for further deterministic processing.

The node supports meshes, curves, point clouds and instances. It only works
on the top-level geometry, so it does not go into nested instances because it
also generates new instances.

Co-authored-by: Hans Goudey <hans@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/113083
2023-10-18 10:26:23 +02:00
Jacques Lucke
9c56a19640 Merge branch 'blender-v4.0-release' 2023-10-18 10:18:04 +02:00
Jacques Lucke
969dd7b985 Geometry Nodes: add forward compatibility for map range socket identifiers
Also see 0ea193bdb3.
2023-10-18 10:17:43 +02:00
Jacques Lucke
fa1e65f554 Geometry Nodes: show grease pencil materials in material socket
This is only done when the experimental grease pencil option is
turned on for now.
2023-10-18 10:04:04 +02:00
Jacques Lucke
6e35e30ba8 Merge branch 'blender-v4.0-release' 2023-10-18 09:57:26 +02:00
Jacques Lucke
4f3262a128 Fix: update curve types before using them 2023-10-18 09:56:22 +02:00
Dalai Felinto
9a967d26fd GPv3: Set Material node
Note: At the moment the node only supports
non-Grease Pencil materials.

But if the material socket is connected to the
modifier a Grease Pencil material can be used.

Part of #113602.

Ref !113816.
2023-10-18 08:58:02 +02:00
Campbell Barton
d288b73062 Merge branch 'blender-v4.0-release' 2023-10-18 14:40:42 +11:00
Campbell Barton
df6cedeee1 Merge branch 'blender-v4.0-release' 2023-10-18 14:40:39 +11:00
Campbell Barton
176218fce1 Merge branch 'blender-v4.0-release' 2023-10-18 14:40:34 +11:00
Campbell Barton
d35dd83701 Merge branch 'blender-v4.0-release' 2023-10-18 14:40:31 +11:00
Campbell Barton
3eda5a114f Fix Wayland/LIBDECOR window size on startup without a hack
The USE_LIBDECOR_FRACTIONAL_SCALE_HACK worked on my system but made
window size issues worse in older versions of GNOME, see: #109194.

Replace the hack with logic to set the window size using frational
scaling information from the output.
2023-10-18 14:37:12 +11:00
Campbell Barton
bafb36f8bc Fix glitches resizing windows on Wayland, LIBDECOR & fractional scaling
When fractional scaling is used, window sizes from LIBDECOR are still
divided by the window-decorations internal buffer scale which doesn't
match the GHOST window (always 1 in the case of fractional scale).

Also resolve glitches caused by recalculating the window size when
no size change was intended. In this case reuse LIBDECOR's internal
size so there are never any changes (caused by rounding for e.g.).
2023-10-18 14:37:11 +11:00
Campbell Barton
3ad21b2169 Fix invalid surface size under Wayland when GHOST set the window size
When the window manager set the window size, there were no checks
the size is a multiple of the buffer scale (a requirement for Wayland).

This meant setting the window size could exit Blender without warning
if an invalid window size was set.
2023-10-18 14:37:09 +11:00
Campbell Barton
46159c131d Cleanup: add rounding utilities for GHOST/Wayland
Prepare for fixes that use add additional rounding.
2023-10-18 14:37:08 +11:00
Richard Antalik
3a230075cc Merge branch 'blender-v4.0-release' 2023-10-18 01:13:26 +02:00
Richard Antalik
01612bacfd Fix #113755: Incorrect speed overlay on retimed strips
Caused by off by 1 error in speed calculation.
2023-10-18 01:11:31 +02:00
Harley Acheson
8b74073383 Merge branch 'blender-v4.0-release' 2023-10-17 15:51:33 -07:00
Harley Acheson
9a3fa4d8cc Fix #113826: Set Explicit Font Size for Overlays
The complaint illustrates how text measurement can be broken by a
drawing callback. This is because overlays are setting global_font_size
value, which is used by subsequent drawing, but does not explicitly set
size on the global_font_default font, which is needed for measurement.

Pull Request: https://projects.blender.org/blender/blender/pulls/113868
2023-10-18 00:50:05 +02:00
Hans Goudey
e84ba67c73 Fix: Material selection node test failure
The actual selection needs to be evaluated on the right domain, not
necessarily the domain from the field context. It's interpolated as
a separate step.

Also reuse the attribute accessor already assigned to a local variable.
2023-10-17 22:46:16 +02:00
Hans Goudey
60e7e89bfa Cleanup: Retrieve virtual array single value in one call 2023-10-17 22:43:38 +02:00
Hans Goudey
4c7fe8b583 Cleanup: Remove unnecessary parentheses in switch cases
Also remove unnececessary checks that can be combined with the switch,
and use `.index_range()` instead of `IndexRange(.size())`.
2023-10-17 22:28:47 +02:00
Dalai Felinto
e773cc2967 GPv3: Set Material Index node
Part of #113602.

Pull Request: https://projects.blender.org/blender/blender/pulls/113821
2023-10-17 20:20:40 +02:00
Miguel Pozo
4f9d85fc96 Fix: UI: Revert unintended change
Unintended change from #113362
2023-10-17 20:02:07 +02:00
Germano Cavalcante
6b001ea76c Merge branch 'blender-v4.0-release' into main 2023-10-17 14:53:45 -03:00
Dalai Felinto
42f71c9dca GPv3: Material Selection node
Part of #113602.

Pull Request: https://projects.blender.org/blender/blender/pulls/113827
2023-10-17 19:52:46 +02:00
Germano Cavalcante
934c2c894b Fix 'Snap Mode' versioning
NEAREST and PROJECT were swapped.
2023-10-17 14:52:42 -03:00
Germano Cavalcante
6bbad6c428 Fix #113801: "Snap to Same Target" don't work as expected
Introduced during snap code refactoring.

It seemed wrong to overwrite the calculated nearest distance based only
on the original distance.

But this is intentional, (the code could be improved since there are
unnecessary tests to detect the closest object).
2023-10-17 14:31:49 -03:00
Falk David
ed124d23d1 Fix: GPv3: Crash when storing deformed points
The issue was that the optional array was not correctly initialized.

Ref !113858
2023-10-17 19:29:52 +02:00
Dalai Felinto
c5ed37a5c0 GPv3: Replace Material node
Note: At the moment the node only supports non-Grease Pencil materials.

But if the material socket is connected to the modifier a Grease Pencil
material can be used.

Part of #113602.

Co-authored-by: Hans Goudey <hans@blender.org>
Ref !113818.
2023-10-17 18:51:47 +02:00
Falk David
78cb2776bb Fix #113740: Crash adding layer into empty group
This crash was cause by some mismatch in the indices.
We need to make sure to clamp the insertion index to the size of the
span of the layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/113852
2023-10-17 18:34:42 +02:00
Dalai Felinto
f54d5df2fc GPv3: Fillet Curve node
Part of #113602.

Pull Request: https://projects.blender.org/blender/blender/pulls/113850
2023-10-17 18:30:38 +02:00
Hans Goudey
e1fd7a8a7b Cleanup: Simplify grease pencil line overlay size counting
Avoid the need to iterate over every curve, and only iterate over the
cyclic attribute if it exists. This removes the check that avoided
creating cyclic segments for curves with only two points. If that
was necessary, some of the complexity would return, but the
new `array_utils` function wouldn't be necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/113814
2023-10-17 18:29:17 +02:00
Falk David
48e60dcbff Fix: GPv3: Compile error 2023-10-17 17:13:13 +02:00
Falk David
07749b389d GPv3: Convert radius to blender units
Previously, Grease Pencil used a radius convention where
1 "px" = 0.001 units. This "px" was the brush size which would be
stored in the stroke thickness and then scaled by the point pressure
factor. Finally, the render engine would divide this thickness value by
2000 (we're going from a thickness to a radius, hence the factor of
two) to convert back into blender units.

Store the radius now directly in blender units. This makes it
consistent with how hair curves handle the radius.

* Removes the scaling in the render engine.
* Makes sure the grease pencil primitives use the correct radii
* Changes the drawing tool to work with screen space radius
* Draws the drawing tool cursor in screen space
* Makes sure the scaling is done when converting from legacy
grease pencil objects
* Makes sure the scaling is done when loading previous files

Consequences for the draw tool:
* Since the tool has a radius input in pixels, it now works in screen space. This is a pretty big change to how it works by default before, so a new option will have to be added that allows the brush to be in "Scene" space. This is similar to how it works in sculpt mode. But this is a bigger change, so I would like to split that into a separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/113770
2023-10-17 17:00:35 +02:00
Germano Cavalcante
5139a3a09f Merge branch 'blender-v4.0-release' into main 2023-10-17 11:46:45 -03:00
Germano Cavalcante
6ecef4d176 Fix crash when Transform Extend multiple NLA strips
`tdn` was being incremented even though it wasn't used, which led to
changes in memory outside the HEAP limits.
2023-10-17 11:46:10 -03:00
Miguel Pozo
6f125661e6 GPU: Add Texture::debug_clear
Clear uninitialized textures to NaN/debug values.
Enabled for `--debug-gpu` only.

Pull Request: https://projects.blender.org/blender/blender/pulls/113781
2023-10-17 15:54:09 +02:00
Miguel Pozo
25c2b17266 Merge branch 'blender-v4.0-release' 2023-10-17 15:46:32 +02:00
Miguel Pozo
405a618d88 Cleanup: Workbench: Remove no longer used properties 2023-10-17 15:45:59 +02:00
Falk David
f59827de74 GPv3: Add API to copy and add a layer
This adds a core API to add a new layer by copying a source layer.
2023-10-17 15:41:50 +02:00