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.
This node splits all faces to duplicate each time. Corner edges and
vertices are just ordered sequences of indices. Most likely, due to
historical reasons, this was overlooked and as a result the code became
so complex with potential simplicity. The problem was found in a
benchmark of #109174. The code in the lambda could not be optimized.
Timings improved by about 30%, from 154 to 120 ms.
Pull Request: https://projects.blender.org/blender/blender/pulls/109222
Since 4a3b6bfeac, there should be a loading/wait icon while the previews
are being loaded. However when initially loading the file list, the big
document icon we use when no preview was found showed up for a short
moment. This is because preview loading is only triggered after the file
list is fully loaded, and so the preview loading tag isn't set yet. But
we only checked for this tag. Now the waiting icon is displayed when
either the file list or the preview is still loading.
Current poll functions allows to use these operator only in edit mode.
Correct function would be `active_grease_pencil_poll` (check for active grease
pencil object instead of the context mode)
Pull Request: https://projects.blender.org/blender/blender/pulls/109238
The reference count computation for shader operation outputs is wrong,
because it considers internal links as references to the result, which
is not the case.
This patch fixes that by only consider external links.
Adds a new UI template to view the current layer tree of the active Grease Pencil object.
This UI tree view implements the following features (for now):
- Displaying all the layers with their names and highlighting the active layer.
- Changing the active layer by clicking on an item.
- Adding new layers (using a new operator).
- Removing the active layer (using a new operator).
- Renaming a layer.
Pull Request: https://projects.blender.org/blender/blender/pulls/109197