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
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
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
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
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
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
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.
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
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.
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.
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
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