Commit Graph

129459 Commits

Author SHA1 Message Date
Falk David
37d2eaee4e Fix: GPv3: Crash renaming a layer
When renaming a layer to a (long) name that was already taken
by another layer, Blender would crash.
This was because the memory for the unique string was held by
`std::string` which cannot grow.
The solution is to use `char unique_name[MAX_NAME]`.
2023-10-18 17:01:25 +02:00
Julian Eisel
236e9ee6cb Merge branch 'blender-v4.0-release' 2023-10-18 16:11:35 +02:00
Julian Eisel
f622b4ce96 Fix #113201: Assets in same folder as current file ignored in All library
Note: Initially committed as 7705e49bcd, but got reverted with
1f0520034a. Note includes fixes for unit tests.

If an asset library was pointing to the same path as the current file is saved
in, the assets from this library wouldn't be loaded. This is because the asset
library service assumed the absolute library root path is a way to uniquely
identify an asset library.

Instead, identify the asset library using both the root path and the library
type.
2023-10-18 16:10:42 +02:00
Michael Kowalski
d96b137188 Merge branch 'blender-v4.0-release' 2023-10-18 09:37:49 -04:00
Michael B Johnson
686487ca17 Fix: USD: Use color3f for color nodes
Blender was writing out color attributes on USDPreviewSurface as
float3 instead of the more accurate color3f.  While this is somewhat
technically okay, since color3f is a role alias for float3, it does cause
issues in applications that are correctly expecting color3f.

The material writer code actually expects color3f in other
sections, but was using float3 in this section erroneously.

Co-authored-by: Dhruv Govil <dgovil2@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113695
2023-10-18 14:52:06 +02:00
Hans Goudey
5b108ae522 Cleanup: Resolve clang compile warnings
Of the two overloaded functions clang chose the non-span version with
only a single item in the initializer list. Resolve that by not using an
intializer list in that case.
2023-10-18 14:23:57 +02:00
Philipp Oeser
9752ef5187 Merge branch 'blender-v4.0-release' 2023-10-18 14:21:49 +02:00
Philipp Oeser
ad0b9dbdd2 Fix #113763: Float2 attributes on curves not rendering in Cycles
Regression from 2fac2228d0.

Above commit was missing an AttributeConverter for `blender::float2`,
now added.

Pull Request: https://projects.blender.org/blender/blender/pulls/113884
2023-10-18 14:21:09 +02:00
Campbell Barton
6ed3b4a5a6 Cleanup: format, quiet unused argument warning 2023-10-18 22:09:27 +11:00
Campbell Barton
3e26a1a39c Cleanup: set WITH_INPUT_IME=OFF when unsupported
This avoids having to do platform checks before checking WITH_INPUT_IME.
2023-10-18 22:04:25 +11:00
Pratik Borhade
2a5c499585 GPv3: Assign material
Assign active material to selected strokes. This is similar to legacy GP
operator `GPENCIL_OT_stroke_change_color`.
Implements #113481

Pull Request: https://projects.blender.org/blender/blender/pulls/113573
2023-10-18 12:57:57 +02:00
Bastien Montagne
c5a408f5a1 WM Jobs: Add job's own reporting mechanism.
wmJob's shared data (with their worker threads), #wmJobWorkerStatus, now
also contains a #ReportList pointer.

Job worker code is now expected to use `BKE_report` APIs to populate this
new shared reportlist, instead of calling the (absolutely) not
thread-safe `WM_reports` API. This will be tackled in later commits.

Note that since commit 9859622a66, #ReportList and `BKE_report` API
is now thread-safe, so no further handling for this is required in the
wmJob code itself.

The periodic wmJob update handling (done through timers currently)
takes care of moving reports from the job data to the WM data.

Implements #112537.

Pull Request: #113548.
2023-10-18 12:48:52 +02:00
Bastien Montagne
9727373821 WM Reports: Add public API to move reports from a ReportList to WM one.
There was already such a `wm_add_reports` function, but it was private.
It is now available in the public API, and renamed to
`WM_reports_from_reports_move`.
2023-10-18 12:48:52 +02:00
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