Commit Graph

106706 Commits

Author SHA1 Message Date
Harley Acheson
332efa7250 Merge branch 'blender-v4.1-release' 2024-02-12 12:17:45 -08:00
Harley Acheson
d45175c919 UI: Fix Indentation Issue in Asset Browser
Remove extra indentation for non-collapsible icons that have ICON_NONE,
not needed since #117654

Pull Request: https://projects.blender.org/blender/blender/pulls/118159
2024-02-12 21:16:28 +01:00
Damien Picard
1410615079 Nodes: expose multi-input sockets to custom nodes in the Python API
Currently the multi-input sockets are not exposed to the custom nodes
Python API. This makes some features cumbersome to implement if one
wants a node to process an arbitrary number of inputs.
One workaround is to make inputs duplicate themselves when a link is
created, but a proper multi-input would be easier to use for both
add-on developers and users.

This commit exposes a new `use_multi_input` boolean parameter when
creating a new node socket. This makes it possible to declare a
multi-input, while still leaving the existing `is_multi_input`
property read-only so that existing nodes cannot be made unstable.

The parameter is optional so existing scripts stay compatible. It also
raises an error when used on output sockets, since it makes no sense
for those to be multi-input.

The Custom Node Tree Python template was updated to reflect this
change by making one of the inputs of the custom node multi-input.

Pull Request: https://projects.blender.org/blender/blender/pulls/114474
2024-02-12 20:28:56 +01:00
Julian Eisel
4f68fa453f Fix compiling after previous fix in release branch 2024-02-12 19:51:56 +01:00
Julian Eisel
0ffe2d4848 Merge branch 'blender-v4.1-release' 2024-02-12 19:51:40 +01:00
Hans Goudey
d691ed2f3b GPU: Use std::string instead of C strings for code gen output
The benefits are removing unnecessary reallocations of the string data
and unnecessary recalculations of the size, better type safety, and more
automatic memory management.

Pull Request: https://projects.blender.org/blender/blender/pulls/118045
2024-02-12 19:33:44 +01:00
Julian Eisel
d54a1b0364 Fix asset indexer string shortening breaking UTF-8 strings
Would shorten the string without ensuring the string isn't shortened in
the middle of a multi-byte UTF-8 character.
2024-02-12 19:25:20 +01:00
Harley Acheson
3ac9babe35 Fix #118087: Remove Bad Spacing Introduced With #117310
This reverts to the exact prior spacing values for layout separator
item, so only difference is vertical spacing if vertical bar.

Pull Request: https://projects.blender.org/blender/blender/pulls/118151
2024-02-12 19:10:48 +01:00
Germano Cavalcante
1c77779160 Refactor: Store a 'Mesh' in the editmesh snap cache and use it for snapping
In this commit, a temporary mesh is created representing the edit mesh.
This mesh is then used in the Edit Mesh snapping system instead of the
BMesh.

By using a Mesh object for snapping, we remove a considerable amount of
code and use a more optimized version of snapping.

This simplifies the code and makes it easier to implement new features.

## Performance test: Face + Edge + Vert
|        | Cache     | Gen. Snap |
|--------|-----------|-----------|
| Before | 680.88 ms | 0.1250 ms |
| After  | 489.06 ms | 0.1064 ms |
| Improv | 28.65%    | 14.88%    |

## Performance test: Face
|        | Cache     | Gen. Snap |
|--------|-----------|-----------|
| Before | 293.90 ms | 0.0230 ms |
| After  | 411.92 ms | 0.0256 ms |
| Improv | -40.15%   | -11.30%   |

Pull Request: https://projects.blender.org/blender/blender/pulls/117047
2024-02-12 18:59:13 +01:00
Miguel Pozo
7ca46bb25d Merge branch 'blender-v4.1-release' 2024-02-12 18:35:31 +01:00
Miguel Pozo
1323b9912c Cleanup: Remove outdated comment
gl_InvocationID is always available now.
2024-02-12 18:34:54 +01:00
Miguel Pozo
7821cf068c Fix: Workbench: Shadows
Broken shadows after c0c3565714
GPU_ARB_gpu_shader5 is never defined,
since gl_InvocationID is always available.
2024-02-12 18:34:12 +01:00
Michael Kowalski
e4c45cbce1 Merge branch 'blender-v4.1-release' 2024-02-12 11:58:02 -05:00
Hans Goudey
d434ef6566 Docs: Add comments to node tree runtime struct clarifying design
Currently we have some old code from shader/compositor/texture nodes
that stores runtime data during and after evaluation on the node tree
itself. This is meant to be avoided, since the node tree is just meant
to be evaluation _instructions_.

Pull Request: https://projects.blender.org/blender/blender/pulls/118056
2024-02-12 17:44:12 +01:00
Hans Goudey
b0b6bc86ab Cleanup: Use more standard face corner naming in mesh normals code
Mostly replace "ml" with "corner"
2024-02-12 11:15:01 -05:00
Hans Goudey
f3c55b9f9c Cleanup: Remove unused DerivedMesh function 2024-02-12 10:45:02 -05:00
Hans Goudey
e9b8460ebe Cleanup: Use blender::int2 instead of vec2i 2024-02-12 10:45:02 -05:00
Lukas Tönne
a4051b31d5 Fix #118135: Make sure the new active index is always valid
When deleting all the segments the active index is generally 0. Adding a
new segment increments the active index, which pushes it out of range.
The code should not expect active index to be inside the current range.

Pull Request: https://projects.blender.org/blender/blender/pulls/118143
2024-02-12 16:44:28 +01:00
Michael Kowalski
5dd48265bb USD: Fix duplicate shader nodes on import
Fixed duplicate nodes when converting texture scale/bias and
channel names on material import.  This required extending
the node caching to handle cases where a USD shader is converted
to multiple Blender nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118002
2024-02-12 16:42:26 +01:00
Omar Emara
98c0802ab0 Merge branch 'blender-v4.1-release' 2024-02-12 17:01:33 +02:00
Omar Emara
50d7f5a30f Fix #118096: Compositor Displace node produce NaN pixels
The GPU compositor Displace node produces NaN pixels if connected to the
Image node. That's because the Displace node access the MIP levels of
the texture produces by the Image node, but those levels were never
initialized, so fix this by completing the levels.
2024-02-12 16:58:23 +02:00
Clément Foucault
16c1e84c6c Fix: GPU: Fix shader builder option not building
This was caused by the recent change in DNA headers
making all extern data C++.
2024-02-12 15:04:53 +01:00
Campbell Barton
fb81bbaa60 Tests: disable BLI_convexhull_2d_test which fails on macOS 2024-02-13 00:34:44 +11:00
Germano Cavalcante
4618db7f5a Merge branch 'blender-v4.1-release' 2024-02-12 09:52:54 -03:00
Campbell Barton
ee0c5e28ad Cleanup: resolve missing declaration warning 2024-02-12 23:26:39 +11:00
Sergey Sharybin
18b594075c Fix #118034: Cycles: Driven View Layer property not considered in realtime
The issue was caused by Cycles doing dependency tracking on its
side, relying on the fact that view layer needs to be tagged as
modified when its properties change.

This was not the case when custom property on the a view layer is
modified via a driver.

Now the dependency graph will tag IDs which generic properties did
change as ID_RECALC_PARAMETERS, giving it a chance to render engines
to react to it.

Since this is quite generic code which might have unforeseen side
effects the change is not targeted to the current release branch.

Note that this chaneg does not fix the #103140, as the issue there
is use of RNA path to another data-block, without the node tree
registering relation to that data-block.

Pull Request: https://projects.blender.org/blender/blender/pulls/118134
2024-02-12 12:52:43 +01:00
Sean Kim
a2d96b0879 Sculpt: Disable sculpt sample detail size on invisible objects
Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118075
2024-02-12 12:27:53 +01:00
Sean Kim
ca6b75b106 Sculpt: Disable sculpt trim operators on invisible objects
Disables trim lasso and box gesture operators and the following
tools when attempting to operate on invisible objects:
* Lasso Trim
* Box Trim

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118072
2024-02-12 12:27:05 +01:00
Sean Kim
be4a8e5a48 Sculpt: Disable sculpt expand operator on invisible objects
Affects:
* Expand Mask by Topology
* Expand Mask by Normals
* Expand Face Set by Topology
* Expand Active Face Set

Addresses part of #112371

Pull Request: https://projects.blender.org/blender/blender/pulls/118070
2024-02-12 12:25:36 +01:00
Bastien Montagne
0bf9b10a93 Merge branch 'blender-v4.1-release' 2024-02-12 12:09:32 +01:00
Bastien Montagne
9b5f01d00e I18N/UI Messages fixes. 2024-02-12 12:01:02 +01:00
Campbell Barton
8f09fffef7 Cleanup: replace qsort with std::sort
Also replace the PointRef struct with an integer array as this was
a workaround for `qsort` not taking additional arguments.
2024-02-12 20:17:21 +11:00
Campbell Barton
f4f97ea979 Cleanup: comments in convexhull_2d, correct variable name
Also remove BLI_ prefix from static function.
2024-02-12 20:17:20 +11:00
Campbell Barton
b91918564d Tests: add tests for convexhull_2d
Move BLI_convexhull_aabb_fit_points_2d to a public function to be able
to compare compare fitting one convex hull with a simple reference
method.

One test is disabled as it exposes an error in convex hull calculation
which needs further investigation.
2024-02-12 20:17:19 +11:00
Thomas Dinges
34feee3499 Cleanup: Remove unused internal FFMPEG presets
Formats like VCD and SVCD are obsolete, others are done via Python.

Pull Request: https://projects.blender.org/blender/blender/pulls/118069
2024-02-12 09:45:13 +01:00
Campbell Barton
835b9a506d Merge branch 'blender-v4.1-release' 2024-02-11 17:19:27 +11:00
Campbell Barton
835651cfdd Fix cross_poly_v2 returning a negated value, add tests
The result of cross_poly_v2 was flipped compared with cross_tri_v2 &
cross_poly_v3 (with the Z values zeroed).

Ensure cross_poly_v2/3, cross_tri_v2/3 return compatible results and
updating the doc-strings noting that a negative Z is for clock-wise
polygons.
2024-02-11 17:16:17 +11:00
Bastien Montagne
5146e118c5 Fix broken MacOS builds after recent refactor.
For some reasons IDE did not search in MTL OSX files...
2024-02-10 19:49:12 +01:00
Bastien Montagne
5aaadebbe4 Cleanup: Make BKE_scene.h a full Cpp header. 2024-02-10 19:16:25 +01:00
Bastien Montagne
29fe777445 Cleanup: Make BKE_report.h a full Cpp header. 2024-02-10 18:34:29 +01:00
Bastien Montagne
54618dbae3 Cleanup: Make BKE_global.h a Cpp header. 2024-02-10 18:25:14 +01:00
Jacques Lucke
c3b7f76e5f BLI: support repeating index masks
This adds two new constructors to `IndexMask`:
* `from_repeating(mask_to_repeat, repetitions, stride, initial_offset, memory)`:
  It allows repeating an existing index mask with a stride.
* `from_every_nth(n, indices_num, initial_offset, memory)`: Creates an index
  mask like `{0, 2, 4, 6, ...}`.

`from_every_nth` is implemented in terms of `from_repeating` which is optimized
to handle this case (and other cases) very efficiently.

Pull Request: https://projects.blender.org/blender/blender/pulls/118084
2024-02-10 16:58:59 +01:00
Iliya Katueshenock
bb5b4b1f2f BLI: add comparison operators for IndexMask
Support `==` and `!=` operators for `IndexMask`.

Pull Request: https://projects.blender.org/blender/blender/pulls/117814
2024-02-10 15:32:36 +01:00
Campbell Barton
3b809ac99b Cleanup: minor changes to convexhull_2d
- Function style casts.
- Use reduce indentation, use continue.
- Replace argument "n" with "points_num".
2024-02-10 23:34:36 +11:00
Campbell Barton
727d47c015 Cleanup: move convexhull_2d to C++ 2024-02-10 22:40:46 +11:00
Campbell Barton
3dbbc013de Cleanup: spelling in comments 2024-02-10 22:35:35 +11:00
Campbell Barton
2df863287f Cleanup: use UV instead of Uv in code-comments 2024-02-10 22:35:33 +11:00
Campbell Barton
37327a5d84 Cleanup: use "value_or" for optional types instead of ternary operators 2024-02-10 22:35:32 +11:00
casey bianco-davis
567a33ab32 BLI: Fix non-square matrix print (cout<<).
The iterations through the rows and columns where flipped.
This would cause invalid memory to be accessed and an assertion
error in debug mode.

Note: This is only fixing an error with non-square matrix printing
and has no effect on square matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/118076
2024-02-10 10:05:59 +01:00
Harley Acheson
48390d018d Merge branch 'blender-v4.1-release' 2024-02-09 12:23:51 -08:00