Commit Graph

100732 Commits

Author SHA1 Message Date
Falk David
befe6cb95c Fix: Unlinking GP layer from layer group
The `unlink_layer` function did not clear the parent pointer of the
layer itself.
2023-06-26 12:20:58 +02:00
Falk David
36b6b11d7d Cleanup: Remove unused function
The `bke::greasepencil::LayerGroup::remove_child` function was not used.
2023-06-26 12:20:58 +02:00
Philipp Oeser
f8981b6492 Pyhon API: Add animation playback pre/post handlers
Since d8388ef36a, the "frame_change_post" handler could not be used
anymore to detect when animation playback stopped.

This functionality is needed by certain addons though and is generally
usefull to have, so this is now added.

Related reports : #109168, #109218

Pull Request: https://projects.blender.org/blender/blender/pulls/109232
2023-06-26 12:11:25 +02:00
Miguel Pozo
b14b67db40 Workbench Next: Sculpt Support
Add Sculpt support for the new Draw Manager
and implement Sculpt rendering in Workbench Next.
Instead of using a callback approach, it's now possible to
retrieve a vector of GPUBatches and their material index,
so engines can use them as they see fit.

Pull Request: https://projects.blender.org/blender/blender/pulls/109294
2023-06-26 11:56:10 +02:00
Colin Basnett
7797fcc3c9 Nodes: Don't allow animation for node mute property
Discussions on https://projects.blender.org/blender/blender/pulls/108634 pointed to the idea that the mute property probably shouldn't have been animateable to begin with because of performance concerns.

This simply removes the ability to animate the property.

Pull Request: https://projects.blender.org/blender/blender/pulls/108849
2023-06-26 11:40:12 +02:00
Falk David
c5a8a74f9e Refactor: Convert several animation editor files to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/109251
2023-06-26 11:27:25 +02:00
Falk David
32be07845f Curves: Mask function for end points
This essentially replaces the `ed::curves::select_ends` function by using a new masking function (`ed::curves::end_points`) and manipulating the selection attribute directly in the operators.

Pull Request: https://projects.blender.org/blender/blender/pulls/109293
2023-06-26 11:21:16 +02:00
Harley Acheson
4a80d0b6d5 Refactor: UTF-8 Character Defines
Use defined UTF-8 Universal character names in place of byte escape
sequences and literals.

Pull Request: https://projects.blender.org/blender/blender/pulls/109163
2023-06-26 06:05:18 +02:00
Campbell Barton
54e346f1d5 Cleanup: move run-time VFont enum out of DNA 2023-06-26 13:09:06 +10:00
Iliya Katueshenock
39386175e1 Fix: Incorrect rotation socket hiding in raycast node
The typo was made in 63dae2a105.

Pull Request: https://projects.blender.org/blender/blender/pulls/109352
2023-06-26 03:27:34 +02:00
Campbell Barton
82d9eb09db Cleanup: use term SIZE instead of LEN for defines for buffer sizes
Reserve "LEN" for lengths that don't include the null byte.
2023-06-26 10:09:57 +10:00
Germano Cavalcante
9cbe156d6a Fix snap to origin of objects made behind camera
The clip plane start was being ignored in this case.
2023-06-25 10:30:16 -03:00
Campbell Barton
9a4e823f3f Cleanup: minor changes to string join logic
- When string join truncates, break out of the outer loop too.
- Use BLI_string_len_array when calculating the array size for
  BLI_string_join_array_by_sep_charN.
- Add tests.
2023-06-25 16:45:02 +10:00
Campbell Barton
2c214d5bb5 Fix error in recent removal of BLI_strcpy_rlen
Mistake in caused [0] the string not to be nil terminated.

[0]: b9bf639ba4
2023-06-25 15:25:54 +10:00
Campbell Barton
f4a65cfe5d BLI_string: remove potentially unsafe BLI_sprintf
Replace by BLI_snprintf or string joining.

See #108917.
2023-06-25 13:34:31 +10:00
Campbell Barton
85029da289 Cleanup: compiler warnings 2023-06-25 11:39:25 +10:00
Habib Gahbiche
c8f434e685 Compositor: improve edge detection of Kuwahara filter
Compute edges of image once based on luminance instead of all 3 channels.

This also gives a modest performance improvement of 8%. Measured on intel i9 CPU using a 1920 x 3199 image.

Pull Request: https://projects.blender.org/blender/blender/pulls/108858
2023-06-24 21:39:07 +02:00
Hans Goudey
c1292b4a80 Revert "Fix: Revert changes in Mesh to Volume node and modifier to Blender 3.6"
This reverts commit 537fdbbfa2.

Somehow the revert in 9b708c8650
was undone by the next merge from the 3.6 branch,
9876ff183f.
2023-06-24 14:11:17 -04:00
Weizhen Huang
d4830d711e Cleanup: remove comments regarding Cycles versioning 2023-06-24 19:51:37 +02:00
Pratik Borhade
51a5be8913 GPv3: Change poll function of select alternate operator
This operator is only supported in point selection mode.
2023-06-24 17:58:53 +05:30
Omar Emara
c9e6399fe1 Realtime Compositor: Implement Keying node
This patch implements the Keying node for the realtime compositor. To
ease the implementation, some morphological operators were moved into
algorithms and a mechanism to steal data between results was added to
the Result class.

Pull Request: https://projects.blender.org/blender/blender/pulls/108393
2023-06-24 13:02:33 +02:00
Campbell Barton
ec428c3f7f CMake: sort file lists, add missing header 2023-06-24 19:05:09 +10:00
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