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