Commit Graph

100710 Commits

Author SHA1 Message Date
Campbell Barton
baa8450fbf License headers: add SPDX-FileCopyrightText 2023-06-24 19:03:06 +10:00
Campbell Barton
b810fd75a4 Cleanup: use _exec suffix for operator callbacks
This was already the case for all but a few places.
2023-06-24 18:56:25 +10:00
Campbell Barton
b9bf639ba4 BLI_string: remove BLI_strcpy_rlen
Avoid BLI_strcpy_rlen use as this has the same problems as strcpy
(it just returned the length which is useful at times).
Use memcpy instead when the size is calculated immediately beforehand.

Other uses of have been replaced by BLI_string_join_array that prevents
buffer overruns by taking the destination buffer length.
2023-06-24 18:49:29 +10:00
Germano Cavalcante
9876ff183f Merge branch 'blender-v3.6-release' into main 2023-06-23 18:26:53 -03:00
Germano Cavalcante
f2fb22b94b Fix snap normal not in world-space
The algorithm that transforms space from local normal to world space was incorrect.

The problem is only observed with Align Rotation to Target on objects
with shear transformation.
2023-06-23 18:23:31 -03:00
Germano Cavalcante
1ef9c16218 Cleanup: Rename SCE_SNAP_MODE_ to SCE_SNAP_TO_
Also rename:
- `SCE_SNAP_MODE_FACE_NEAREST` to `SCE_SNAP_INDIVIDUAL_NEAREST`
- `SCE_SNAP_MODE_FACE_RAYCAST` to `SCE_SNAP_INDIVIDUAL_PROJECT`

And arrange the enums in numerical order.
2023-06-23 17:16:10 -03:00
Hans Goudey
e570f13616 Cleanup: Move NOD_geometry.h to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/109306
2023-06-23 22:15:42 +02:00
Hans Goudey
9b708c8650 Revert "Fix: Revert changes in Mesh to Volume node and modifier to Blender 3.6"
This reverts commit 0b0a5d21ac.

The breaking changes in that commit have been postponed to 4.0.
2023-06-23 14:14:17 -04:00
Jacques Lucke
537fdbbfa2 Fix: Revert changes in Mesh to Volume node and modifier to Blender 3.6
This brings back the `Fill Volume` and `Exterior Bandwidth` inputs in
the Mesh to Volume node and modifier. Those existed in Blender 3.5 but
were removed in 700d168a5c because the way they were
implemented did not use the openvdb api in the right way.

While it's rare that people turned off the `Fill Volume` option, the
exterior bandwidth was used more and can have significant impact on
the result. Furthermore, there is no clear replacement for the
functionality.

Therefore, we decided to roll back the changes in 3.6 to avoid breaking
compatibility. We intend to keep the changes in 4.0 for now, but need
to work on a more clear short term replacement for the removed
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/109297
2023-06-23 14:14:17 -04:00
Brecht Van Lommel
16739b92ca Realtime Compositor: cache GPU context for repeated executions
Pull Request: https://projects.blender.org/blender/blender/pulls/108909
2023-06-23 20:13:25 +02:00
Brecht Van Lommel
711fb3e386 Realtime Compositor: cache render compositor for repeated executions
This is cached in Render, and gets cleared along with render pass GPU
textures when there is no editor open using it, or a new final render is
started.

The context and texture pool are cached. But the evaluator is re-created
every time as this only runs on compositing node changes, which require
recreating it anyway (unlike the viewport where e.g. camera navigation
does not need a new evaluator).

Pull Request: https://projects.blender.org/blender/blender/pulls/108909
2023-06-23 20:13:21 +02:00
Jacques Lucke
0b0a5d21ac Fix: Revert changes in Mesh to Volume node and modifier to Blender 3.6
This brings back the `Fill Volume` and `Exterior Bandwidth` inputs in
the Mesh to Volume node and modifier. Those existed in Blender 3.5 but
were removed in 700d168a5c because the way they were
implemented did not use the openvdb api in the right way.

While it's rare that people turned off the `Fill Volume` option, the
exterior bandwidth was used more and can have significant impact on
the result. Furthermore, there is no clear replacement for the
functionality.

Therefore, we decided to roll back the changes in 3.6 to avoid breaking
compatibility. We intend to keep the changes in 4.0 for now, but need
to work on a more clear short term replacement for the removed
functionality.

Pull Request: https://projects.blender.org/blender/blender/pulls/109297
2023-06-23 20:12:17 +02:00
Brecht Van Lommel
7a3a4b58e6 Fix realtime compositor not correctly handling multiple scene render layers
Pull Request: https://projects.blender.org/blender/blender/pulls/108909
2023-06-23 20:00:28 +02:00
Iliya Katueshenock
25c48782e1 Geometry Nodes: Avoid index lookup from index mask
Recent `IndexMask` refactors introduced log(N) complexity for `mask[i]`.
The greater the fragmentation of the mask, the greater the complexity.
Also, new `IndexMask` implementation has new iterators represented
both real index, and position (`index = mask[position]`).
This PR simply replace manual loops by new methods for iterating.
Added `optimized` in some place as slightly speed up.

The Attribute Statistic became 5 times better, due to multithreading.
The Extrude (Faces Individual) has average changed 42 ms -> 36 ms.
Duplicate Elements (Faces) has average changed 220 ms -> 150 ms.
Transform Instances has average changed 12 ms -> 8 ms.
Other nodes have approximately similar improvement numbers.
All tests use Random(50%) selection as mask.

Pull Request: https://projects.blender.org/blender/blender/pulls/109174
2023-06-23 19:20:24 +02:00
Hans Goudey
cd6a428259 Cleanup: Use newer IndexMask implementation in split edges node
Use a utility added in 2cfcb8b0b8.
2023-06-23 13:06:40 -04:00
Omar Emara
c2361381cd Realtime Compositor: Add node previews for shader operations
This patch adds support for node previews for shader operations, making
node previews fully supported.

The patch was started as an effort to refactor the compositor compiler
to split the shader operators when node previews increase past hardware
limits. However, I realized that the better approach would be to remove
those limits altogether by using texture arrays instead of individual
textures for operation results, then use texture views to slice that
array. This is not implemented in this patch and will require some
prerequisites, namely adding target conversion to GPU texture views as
well as support texture arrays in the DRW texture pool.

Pull Request: https://projects.blender.org/blender/blender/pulls/109250
2023-06-23 18:46:18 +02:00
Omar Emara
c6e5be9a36 Nodes: Compute logically linked sockets to outputs
The `logically_linked_sockets` runtime data of sockets is only initialized
for inputs. This patch also initializes it for output sockets through
the inversion the inputs logically_linked_sockets structure.

Pull Request: https://projects.blender.org/blender/blender/pulls/109249
2023-06-23 18:31:49 +02:00
Hans Goudey
eff0f54e44 Merge branch 'blender-v3.6-release' 2023-06-23 12:13:43 -04:00
Hans Goudey
c9a8b1f13f Fix #109231: Python defined socket type switching broken
The dynamic declarations introduced by 7026096099 didn't
work properly for custom node socket types yet since changes weren't
detected and new sockets in group nodes or group inputs/outputs weren't
created correctly. The fix is simple, we just copy the pattern from the other
socket types.

Pull Request: https://projects.blender.org/blender/blender/pulls/109298
2023-06-23 17:47:37 +02:00
Hans Goudey
b1d83e9bef Cleanup: Remove redundant name copying when building dynamic sockets
The new names are copied to the new socket by the (single) caller of
`update_or_build`, so it doesn't need to be done in each function.
2023-06-23 11:45:44 -04:00
Sergey Sharybin
9e346a4892 Cleanup: Strict compiler warning
warning: a function declaration without a prototype is deprecated
in all versions of C [-Wstrict-prototypes]
2023-06-23 17:24:30 +02:00
Hoshinova
f7589751f1 Cleanup: Use defines in Voronoi GLSL implementation
Use defines in Voronoi GLSL implementation instead of magic numbers.

Pull Request: https://projects.blender.org/blender/blender/pulls/109289
2023-06-23 17:16:53 +02:00
Hans Goudey
b226c115e2 Fix #109236: Split Edges node skips loose edges
With the previous fix to the node, 8a11f0f3a2, the new edge
indices are built with the changed corner vertices from a previous step
in the algorithm. That doesn't work for loose edges though, since they
aren't used by any face corners. The best solution I could come up with
was adding a second loop over the split vertices that adjusts the vertex
indices of loose edges. This can be skipped when there are none.

Pull Request: https://projects.blender.org/blender/blender/pulls/109262
2023-06-23 17:07:05 +02:00
Miguel Pozo
ff2f16db6d Draw: Fix RenderDoc and Nvidia compatibility
Disable deferred shader compilation for RenderDoc sessions on Nvidia GPUs to avoid crashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109214
2023-06-23 16:02:19 +02:00
Hoshinova
3efc63b398 Fix #109253: Voronoi Smooth F1 breaks when Smoothness is 0
The Voronoi Smooth F1 mode breaks when the Smoothness is 0 for OSL. This is
due to a zero division in the shader.

To fix this, standard F1 is used when Smoothness is 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/109255
2023-06-23 15:56:09 +02:00
Sergey Sharybin
d8cc8fcf7f Refactor: Move color space information to ImBuf buffers
Before this change the ImBuf struct had dedicated fields for the
buffer data. Now the color space is stored inside of the struct
which wraps around the buffer information.

This only changes the field placement, without changing the way
it is handled. In the future one might imagine that operations
like stealing buffer data should null-ify the buffer colorspace
pointer. Such changes would need to have more accurate thinking
before implementation.

Should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109291
2023-06-23 15:55:42 +02:00
Falk David
62e7ed0da5 Cleanup: remove unused variable 2023-06-23 15:45:29 +02:00
Falk David
0d6fda3b26 Fix: GPv3 layer operators missing undo flag 2023-06-23 14:12:40 +02:00
Guillermo Venegas
3f26bdf840 Cleanup: simplify keyword recognition in text editor
Arrays are used to eliminate the use of many nested if else's that
compare a string value against to many other strings.

These arrays are sorted to be able to perform binary searches on these
string literals arrays.

ref !108775.
2023-06-23 20:11:52 +10:00
lolloz98
fdc0402a50 GPv3: Select Alternate
Adds a "Select Alternate" operator for the new Grease Pencil data type.
This replaces the previous `gpencil.select_alternate`.

Resolves #109204.

Pull Request: https://projects.blender.org/blender/blender/pulls/109240
2023-06-23 11:34:00 +02:00
Falk David
fae170ed7a Fix: Assert in gpencil next engine
The `GPENCIL_NEXT` was no longer defined, so the shader is split and only loaded for gpencil next.

Pull Request: https://projects.blender.org/blender/blender/pulls/109010
2023-06-23 11:18:30 +02:00
Campbell Barton
4eca65f7f8 Cleanup: format 2023-06-23 18:05:01 +10:00
Clément Foucault
ddd88c00b4 EEVEE-Next: Irradiance Cache: Initial Implementation
This is a full rewrite of the irradiance volume baking.
The baking is much faster and doesn't scale linearly with the number
of irradiance samples in the volumes.

Ref #105643

Pull Request: https://projects.blender.org/blender/blender/pulls/108639
2023-06-23 08:39:46 +02:00
Germano Cavalcante
cd08a55a68 Fix compiler error caused by 9383d06688
`prop_snap_source` does not exist.
2023-06-23 00:12:51 -03:00
Germano Cavalcante
9383d06688 Fix measure tool snapping to perpendicular while not dragging 2023-06-22 23:21:46 -03:00
Germano Cavalcante
f1fa2ecbf5 Fix 'Set Snap Base' not working with 'Face Project' or 'Face Nearest' 2023-06-22 22:54:47 -03:00
Hans Goudey
eeecc24014 Cleanup: BLI: Deduplicate bounds merging
Also declare variables and arguments consta
2023-06-22 21:24:48 -04:00
Campbell Barton
fa9a513bc2 BLI_bpath: don't change paths when making absolute/relative fails
Technically this is a foundational change, although from a user
level it's not expected behavior that failing to make a path
absolute/relative would perform some other change to it.
2023-06-23 10:09:03 +10:00
Campbell Barton
1a04a231ec Fix buffer overflow in BKE_bpath_foreach_path_fixed_process
It was assumed destination buffers were at least 1024 bytes which could
overflow by 256 bytes for sequencer directories. Resolve by passing the
destination buffer size to BKE_bpath_foreach_path_fixed_process.

Also remove strcpy use in foreach_path_clean_cb.
2023-06-23 10:09:01 +10:00
Campbell Barton
06cb4ca376 Fix potential buffer overflow in text to object conversion
BLI_strlen_utf8_ex was used to calculate the array size
while strlen was used to fill it which could exceed the utf8 size
if invalid utf8 sequences exist in the text.
2023-06-23 10:09:00 +10:00
Campbell Barton
b06afe575e UI: resolve inconsistency with modifier labels while assigning shortcuts
Reuse WM_keymap_item_to_string to ensure labels match
(would show Cmd on Linux, then refresh to OS once set).
2023-06-23 10:08:58 +10:00
Hans Goudey
dc5b99fa49 Merge branch 'blender-v3.6-release' 2023-06-22 17:29:51 -04:00
Clément Foucault
8d2d2d4620 GPU: Math: Add safe_rcp and safe_normalize to math libs 2023-06-22 22:51:23 +02:00
Hans Goudey
fa1121765d Fix: Mistakenly duplicated code in previous split edges fix 2023-06-22 16:19:16 -04:00
Julian Eisel
b1f7c87b99 Cleanup: Use const for UI coordinate conversion functions 2023-06-22 20:30:46 +02:00
Harley Acheson
e1d227c5fc Refactor: Simplify vfontdata_freetype.c
Simplification of the functions related to the conversion of FreeType
font glyph outlines into curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/109224
2023-06-22 20:29:14 +02:00
Richard Antalik
c1e7c02f14 Fix #109213: Retime tool value slider crash blender
Crash caused by reading beyond boundary of allocated memory.
2023-06-22 19:19:34 +02:00
Harley Acheson
080a00bda2 UI: Fix Scrollbar overlaps sidebar on zoom
When zooming an area with panel category tabs, ensure that the vertical
scroll bar is repositioned to not overlap the tabs.

Pull Request: https://projects.blender.org/blender/blender/pulls/108295
2023-06-22 18:56:29 +02:00
Julian Eisel
9e8bc1d579 Fix unused variable warning 2023-06-22 15:20:54 +02:00
Almaz Shinbay
888cfd29c3 Outliner: Port object elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new tree-element class for object IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/109162
2023-06-22 15:04:53 +02:00