Commit Graph

131118 Commits

Author SHA1 Message Date
Campbell Barton
42e7d9fc3c GHOST/Wayland: unbreak build without threaded event handling 2023-12-14 13:53:17 +11:00
Campbell Barton
4f609a4f96 Cleanup: typo in internal ghost/wayland prefix 2023-12-14 13:53:16 +11:00
Campbell Barton
410e202e2d Cleanup: quiet parentheses warning 2023-12-14 13:52:31 +11:00
Hans Goudey
e5cb2b2798 Fix #116141: Missing task isolation when storing sculpt undo node
We shouldn't use parallelism internally for each node, but it snuck in
with recent changes to use `array_utils::gather`. That's a nice change,
but we need a better way to turn off parallelism for that sort of
function. Until that's decided on, add a quick fix to fix the deadlock.
2023-12-13 21:46:32 -05:00
Campbell Barton
3241db35cd Docs: correct code comment for LaplacianSystem::tris
Also use doxygen doc-strings as they more easily allow comments to be
expanded on.
2023-12-14 12:51:21 +11:00
Campbell Barton
bff5ffc09b Cleanup: use naming for the size of a looptris array 2023-12-14 12:51:20 +11:00
Campbell Barton
664b49c2ef Cleanup: replace C expressions with plain text in cloth errors
Also remove the print as BKE_modifier_set_error prints a warning.
2023-12-14 12:51:19 +11:00
Campbell Barton
0d9acf84c6 Cleanup: match argument naming for headers/source 2023-12-14 12:51:18 +11:00
Campbell Barton
944e0483a6 Cleanup: clarify naming for MLoopTri
The term `looptri` was used ambiguously for both single & arrays.
The term `tri` was also used, causing `tri->tri`.

Use terms:

- `looptris` for an array or when dealing with multiple items.
- `looptri` is used when dealing with a single item.
- `lt` for a single MLoopTri variables & arguments.

This was already a convention but not followed closely.
2023-12-14 12:32:11 +11:00
Campbell Barton
931b2554e2 Refactor: move BEZKEYTYPE define to DNA
Recently this was inlined [0] however the purpose of this define is to
allow for the method of setting the value to be changed.
It also means the hack doesn't have to be explained whenever it's used.

Move the BEZKEYTYPE to DNA, update it's doc-string and restore the
original comment.

[0]: fd3629b80a
2023-12-14 11:20:27 +11:00
Campbell Barton
d8ffa648eb Cleanup: merge doc-strings, correct comments in WM_api.hh 2023-12-14 11:18:06 +11:00
Campbell Barton
a4af406b81 Clenaup: spelling in comments 2023-12-14 11:14:50 +11:00
Campbell Barton
adb74ad0f3 Cleanup: follow convention for naming array lengths
In the context of meshes `totface` reads as if its the number of faces
in the mesh. This was infact the number of looptris however as this
is converted into a "bodyface" array, use that as the prefix.
2023-12-14 11:10:33 +11:00
Campbell Barton
173a4dfbb6 Fix invalid size of allocated looptris array
Regression in [0], moving to C++ types.

[0]: 321c1af26e
2023-12-14 11:08:35 +11:00
Hans Goudey
cdb2f1e1ba Fix #116140: GPU subdivision ignores completely smooth shading
Extraction of data is done in a different order for GPU subdivision
drawing. The necessary normals domain of the mesh has to be
retrieved before that.
2023-12-13 18:59:28 -05:00
Harley Acheson
463dc4dbec Fix #116137: Overflow causing event time false positive warnings
The intent of `ghost_event_proc_timestamp_warning` is to give a console
warning when an event time is outside of an expected 5 second window
around the last time. However if an event happens within the first 5
seconds we get an overflow in a calculation and we get warnings for
normal times within the range.

Pull Request: https://projects.blender.org/blender/blender/pulls/116164
2023-12-13 22:45:50 +01:00
Brecht Van Lommel
ac753fe9ae Fix: Cycles assert with CPU denoiser 2023-12-13 22:27:46 +01:00
rajveermalviya
639de68aaa Fix eyedropper outside blender on mac
Support for picking colors from outside of the blender window on macOS

Pull Request: https://projects.blender.org/blender/blender/pulls/115187
2023-12-13 22:02:56 +01:00
Stefan Werner
fd8bb41224 Cycles: Enable HIP devices for OpenImageDenoise
This enables the HIP backend of OpenImageDenoise on supported devices.

Co-authored-by: Werner, Stefan <stefan.werner@intel.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115854
2023-12-13 21:38:19 +01:00
Richard Antalik
f372ac6f61 VSE: Keep exiting retiming when changing speed
Add "Preserve Current Retiming" option to set speed operator. This
option is enabled by default. When changing speed of retiming segment,
the strip changes length instead of changing next segment speed.

Ref: #112343
2023-12-13 20:45:49 +01:00
Richard Antalik
5092fe60e6 VSE: implement selection of "linked" retiming keys
This feature improves workflow, where it is necessary to select all
retiming keys after one that is selected in order to change speed of
only 1 segment.

The feature is reusing `sequencer.select` "linked time" feature and
mapped Ctrl key.

Ref: #112343
2023-12-13 20:45:16 +01:00
Miguel Pozo
8e9ce4d03d Fix: EEEVEE-Next: Volume lighting
Fix socket_not_white and socket_not_black logic.
(Volume lighting would be disabled if any scatter channel was 0)
Remove unnecesary clamps.
2023-12-13 19:49:31 +01:00
Miguel Pozo
937c4ed2c4 Fix: from_up_axis sign
Same as 6c40adcc36
Fixes the case where up.z == 0
2023-12-13 19:27:30 +01:00
Bastien Montagne
60a9c8ee25 Fix #115486: Linked scenes disappear after reopening file.
Caused by 133dde41bb, it is expected behavior now for linked ID in
general, see also #105786 and #106321.

However, Scenes are a special case here, since they are almost never
(and should not be) indirectly linked by other data, and have (almost)
never any real user, unless they are active in one of the open main
windows.

So this commit essentially reverts the new behavior implemented
in #106321, for linked scenes only.

Should be backported to a potential bugfix release of 4.0.
2023-12-13 18:50:07 +01:00
Bastien Montagne
b840ba1f59 Fix (unreported) crash when trying to link/append while a linked scene is active.
Link/append code sets the scene pointer to `null` when the active
scene is a linked one, to avoid attempt to instantiate linked data
(objects or collections) into a linked scene, which is forbidden.

However, code was still calling some functions expecting a valid scene
pointer, leading to crash.

It is unclear when exactly this issue was introduced code wise. From a
user perspective, it seems to have been revealed between 3.6 and 4.0
release (bisect points at 00a36cbf24, which does not seem to be
directly related...).

In any case, the fix is trivial and safe, so should we do another 4.0
bugfix release, this commit should be backported.
2023-12-13 18:34:13 +01:00
Germano Cavalcante
f83180370a Fix #115590: UV window menus disappearing
Due to lack of forward compatibility, tool_settings.snap_uv_element
could return empty if a 4.0 file is opened in 3.6.

This causes a Python error when trying to identify the element's icon.

Avoid this python error.
2023-12-13 13:54:18 -03:00
Miguel Pozo
6c40adcc36 Fix: GPU: from_up_axis
glsl sign can return 0.
Fixes surfels display when normal.z == 0.
2023-12-13 17:47:48 +01:00
Jacques Lucke
f7383cfe9b Geometry Nodes: use dynamic declaration for switch node
Follow up for 8149678d5e. Significantly reduce boilerplate
required for each type in the switch node.Forward compatibility in 4.0
provided by 0ea193bdb3.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/113413
2023-12-13 17:33:25 +01:00
Hans Goudey
65252564ee Fix #116025: Uninitialized value when versioning old node trees
Usually we expect new DNA values do be zeroed when we add them. But the
conversion to the interface format for 4.0 didn't clear the memory, so
behavior was different when updating old files. Fix that by using
`calloc` instead of `malloc`.
2023-12-13 11:24:39 -05:00
Miguel Pozo
7e4c2b2649 Fix: EEVEE-Next: DeferredProbelLayer emissive materials 2023-12-13 17:02:05 +01:00
Iliya Katueshenock
51bb3247b4 Fix #116144: Tag update relations for Active Camera node
Missed part of 75f160ee96

Pull Request: https://projects.blender.org/blender/blender/pulls/116152
2023-12-13 16:24:25 +01:00
Hans Goudey
96dff1d3ce Fix: Warnings and build error after previous forward declaration commit 2023-12-13 10:16:07 -05:00
Hans Goudey
e657aa2360 Cleanup: Move two mesh functions to C++ header 2023-12-13 09:50:47 -05:00
Hans Goudey
6a1009c9f8 Cleanup: Remove const for Span and by-value types in headers 2023-12-13 09:39:03 -05:00
Hans Goudey
30d95966d5 Cleanup: Forward declare some classes in mesh headers
Aiming to reduce cases of including headers in headers,
when the final definition might be unnecessary.
2023-12-13 09:18:39 -05:00
Hans Goudey
766b0ce820 Fix #116122: Frame Selected/All operators incorrectly frame view
`BKE_object_minmax` is expected to update the min and max, not just set them.
2023-12-13 08:40:21 -05:00
Hans Goudey
4c1817e76f Cleanup: Un-inline mesh data access functions
These shouldn't be called in hot loops at all, and mostly aren't
anymore anyway. Definining them outside of a header allows removing
the `BKE_customdata.hh` include from `BKE_mesh.hh`.
2023-12-13 08:40:21 -05:00
Hans Goudey
b52a071e7a Cleanup: Remove unnecessary Mesh C-API functions
Like mentioned in the docstrings, use the C++ API or access methods
in C++ code.
2023-12-13 08:40:21 -05:00
Philipp Oeser
65274dc096 Fix #116130: Mirrored custom normals broken again
Caused by c53e220aef

Above commit was working on the `mesh` (not the `result`) -- basically a
typo...

Pull Request: https://projects.blender.org/blender/blender/pulls/116134
2023-12-13 13:51:56 +01:00
Jacques Lucke
5519a48702 Cleanup: remove unnecessary alias 2023-12-13 13:46:21 +01:00
Jacques Lucke
3370228ae8 Geometry Nodes: rename ValueOrField to SocketValueVariant
Doing this in preparation for also supporting volume
grids in the same type (#115270).

At some point we could also actually use an `std::variant` in this
type, but that would change behavior without futher changes.
2023-12-13 13:40:40 +01:00
Jacques Lucke
1a4f4104d1 Cleanup: rename dynamic paint specific volume grid
Doing this to avoid name clashes with the more used `VolumeGrid` type.
2023-12-13 13:13:15 +01:00
Bastien Montagne
f01bc93bcf Cleanup: Move BKE_blendfile headers to CPP. 2023-12-13 12:36:45 +01:00
Bastien Montagne
fb8bf8b0c8 LibOverride: Modify automatic handling of which IDs to override in a hierarchy.
The previous behavior, fairly rough, was simply considering all
Collections and IDs found as part of the root's hierarchy as to be
overridden.

The new behavior is based on a specific tag added to some ID usages.
Currently, these are only the links from a Collection to its Objects
and children Collections, and the link from an Object to its parent.

The goal of this huge reduction of the 'automatically overridden' set of
data in a hierarchy is to avoid creating liboverrides for 'utils' data,
e.g. a collection used as source of data by a GeometryNode generating
some parametric geometry (Blender Studio use-case: some form of LOD
handling).

In general, it means that only Collections and objects part of the
collection hierarchy of the root collection are now overridden.

This should not change in the typical recommended use-case so far (where
there is a clear root collection to the whole overridden hierarchy, and
it contains all related collections and objects).

But this should allow much less overhead (and viewport pollution, due to
the current principle that local (and therefore liboverridden) objects
have to be instanciated in a Scene) for more complex setups.

Note that the initial idea/change is fairly simple and easy to
implement, but it creates some additional complexity in the partial
resync code, since now some linked data may not be detected as needing
a liboverride anymore when processing a sub-hierarchy, while it would
require it when processing the whole hierarchy.

This required adding some more processing to the util functions which
define which ID should be overridden. It essentially creates a
'reference set' of all reference IDs that should be overridden when
the whole hierarchy is considered, and use this as additional input to
decide which ID to override when processing a sub-hierarchy for the
partial resync.

Pull Request: https://projects.blender.org/blender/blender/pulls/115853
2023-12-13 11:58:54 +01:00
Omar Emara
048f70e7c2 GPU: Add function for setting float array uniforms 2023-12-13 12:52:49 +02:00
Omar Emara
123da3412b Cleanup: Move Cryptomatte node defines into enums 2023-12-13 12:40:34 +02:00
Omar Emara
931c188ce5 Compositor: Refactor File Output node
This patches refactors the compositor File Output mechanism and
implements the file output node for the Realtime Compositor. The
refactor was done for the following reasons:

1. The existing file output mechanism relied on a global EXR image
   resource where the result of each compositor execution for each
   view was accumulated and stored in the global resource, until the
   last view is executed, when the EXR is finally saved. Aside from
   relying on global resources, this can cause effective memory leaks
   since the compositor can be interrupted before the EXR is written and
   closed.
2. We need common code to share between all compositors since we now
   have multiple compositor implementations.
3. We needed to take the opportunity to fix some of the issues with the
   existing implementation, like lossy compression of data passes,
   and inability to save single values passes.

The refactor first introduced a new structure called the Compositor
Render Context. This context stores compositor information related to
the render pipeline and is persistent across all compositor executions
of all views. Its extended lifetime relative to a single compositor
execution lends itself well to store data that is accumulated across
views. The context currently has a map of File Output objects. Those
objects wrap a Render Result structure and can be used to construct
multi-view images which can then be saved after all views are executed
using the existing BKE_image_render_write function.

Minor adjustments were made to the BKE and RE modules to allow saving
using the BKE_image_render_write function. Namely, the function now
allows the use of a source image format for saving as well as the
ability to not save the render result as a render by introducing two new
default arguments. Further, for multi-layer EXR saving, the existent of
a single unnamed render layer will omit the layer name from the EXR
channel full name, and only the pass, view, and channel ID will remain.
Finally, the Render Result to Image Buffer conversion now take he number
of channels into account, instead of always assuming color channels.

The patch implements the File Output node in the Realtime Compositor
using the aforementioned mechanisms, replaces the implementation of the
CPU compositor using the same Realtime Compositor implementation, and
setup the necessary logic in the render pipeline code.

Pull Request: https://projects.blender.org/blender/blender/pulls/113982
2023-12-13 11:08:03 +01:00
Philipp Oeser
105db1a06e Fix #115907: Select similar edge direction skips opposite direction
As I dont quite get the logic of "enforcing a positive quadrant" from
b38be90515 (which broke the previous behavior of 2.79 which was
capable of handling reversed edges as well -- there might be ways to
make that work though), now use the alternative approach of storing the
flipped direction in the kdtree as well.

This has a slight performance hit (only noticable at ~500k edges), but I
believe correctness beats performance here.

Pull Request: https://projects.blender.org/blender/blender/pulls/115951
2023-12-13 10:30:48 +01:00
Kenzie
3f485c8bf3 Geometry Nodes: add support for blackbody shader node
This adds the existing Blackbody shader node to geometry nodes, with the
same functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/114768
2023-12-13 10:10:06 +01:00
Omar Emara
23df139aaf IMB: Read single-layer XYZ channels as a combined image
Currently, the OpenEXR reader can't read single-layer XYZ images as a
combined image. Single-view images will only read the X channel, while
multi-view images will interpret the Z as a depth image and the Y and Z
channels will be treated as float passes.

This patch allows the reading of XYZ channels as combined images. For
single-view images, we just extend the RGB-like channel names we match
to contain XYZ. For multi-view images we only treat the Z channel as a
Depth one if no X and Y channels exists, since the Z in this case is
part of the XYZ image.

Pull Request: https://projects.blender.org/blender/blender/pulls/115290
2023-12-13 10:01:10 +01:00