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
This commit converts existing callbacks into virtual methods and moves
their associated members from the base class to custom implementations
in subclasses.
These callbacks, (previously used within the main struct), have been
replaced by pure virtual methods in the `Nearest2dUserData` class.
As a result, specific subclasses can now provide their own customized
implementations for these methods.
- Ensure a trailing slash in BKE_blendfile_userdef_from_defaults
instead of in-line platform specific checks.
- Take a buffer size argument for the directory.
- Use the documented size for SHGetSpecialFolderPathW wchar_t argument.
- Remove use of unsafe `wcscat` on WIN32
- By default on Linux the directory would be "/usr/share/" with
"fonts" as the filename, now fonts is always treated as a directory.
- Correct the path for linked library fonts using a relative path.
In order to better identify which is the normal of the point
(see #108711), it is interesting to identify which is the closest bone.
So, instead of testing the snap at each point and then each bone line,
test the bone lines first and after identifying the closest one, test
its points.
With the nearest bone identified, we can use its normal instead.
`sctx` can be accessed internally.
And `clip_planes_enable` makes it clearer what this method does.
Also note that this function had been accidentally removed for Cameras.