When renaming a layer to a (long) name that was already taken
by another layer, Blender would crash.
This was because the memory for the unique string was held by
`std::string` which cannot grow.
The solution is to use `char unique_name[MAX_NAME]`.
Note: Initially committed as 7705e49bcd, but got reverted with
1f0520034a. Note includes fixes for unit tests.
If an asset library was pointing to the same path as the current file is saved
in, the assets from this library wouldn't be loaded. This is because the asset
library service assumed the absolute library root path is a way to uniquely
identify an asset library.
Instead, identify the asset library using both the root path and the library
type.
Blender was writing out color attributes on USDPreviewSurface as
float3 instead of the more accurate color3f. While this is somewhat
technically okay, since color3f is a role alias for float3, it does cause
issues in applications that are correctly expecting color3f.
The material writer code actually expects color3f in other
sections, but was using float3 in this section erroneously.
Co-authored-by: Dhruv Govil <dgovil2@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113695
Of the two overloaded functions clang chose the non-span version with
only a single item in the initializer list. Resolve that by not using an
intializer list in that case.
wmJob's shared data (with their worker threads), #wmJobWorkerStatus, now
also contains a #ReportList pointer.
Job worker code is now expected to use `BKE_report` APIs to populate this
new shared reportlist, instead of calling the (absolutely) not
thread-safe `WM_reports` API. This will be tackled in later commits.
Note that since commit 9859622a66, #ReportList and `BKE_report` API
is now thread-safe, so no further handling for this is required in the
wmJob code itself.
The periodic wmJob update handling (done through timers currently)
takes care of moving reports from the job data to the WM data.
Implements #112537.
Pull Request: #113548.
There was already such a `wm_add_reports` function, but it was private.
It is now available in the public API, and renamed to
`WM_reports_from_reports_move`.
It was set to none, which draws as a dot instead of the already familiar
UV Map icon used in the UV Maps list and other places.
Affects:
* UV Map
* Tangent
* Normal Map
Following !113793 efforts to unify icons.
Currently the active attribute is stored as an index. This should be
changed to a string, but until then, adding or removing an attribute
changes the indeices. The workaround is to store the name and fix
the active attribute after the change.
Caused by a1cc621e1e. The "is_hair_length" value needs to be
set before `attr_input_name` is called because it uses the value to set
the attribute name with the "l" alias.
This node allows splitting up a geometry into groups. A group is defined as all
elements with the same group id. The output contains an instance per group.
The `Group ID` output can be used for further deterministic processing.
The node supports meshes, curves, point clouds and instances. It only works
on the top-level geometry, so it does not go into nested instances because it
also generates new instances.
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/113083
Note: At the moment the node only supports
non-Grease Pencil materials.
But if the material socket is connected to the
modifier a Grease Pencil material can be used.
Part of #113602.
Ref !113816.
The complaint illustrates how text measurement can be broken by a
drawing callback. This is because overlays are setting global_font_size
value, which is used by subsequent drawing, but does not explicitly set
size on the global_font_default font, which is needed for measurement.
Pull Request: https://projects.blender.org/blender/blender/pulls/113868
The actual selection needs to be evaluated on the right domain, not
necessarily the domain from the field context. It's interpolated as
a separate step.
Also reuse the attribute accessor already assigned to a local variable.
Introduced during snap code refactoring.
It seemed wrong to overwrite the calculated nearest distance based only
on the original distance.
But this is intentional, (the code could be improved since there are
unnecessary tests to detect the closest object).
Note: At the moment the node only supports non-Grease Pencil materials.
But if the material socket is connected to the modifier a Grease Pencil
material can be used.
Part of #113602.
Co-authored-by: Hans Goudey <hans@blender.org>
Ref !113818.
Avoid the need to iterate over every curve, and only iterate over the
cyclic attribute if it exists. This removes the check that avoided
creating cyclic segments for curves with only two points. If that
was necessary, some of the complexity would return, but the
new `array_utils` function wouldn't be necessary.
Pull Request: https://projects.blender.org/blender/blender/pulls/113814
Previously, Grease Pencil used a radius convention where
1 "px" = 0.001 units. This "px" was the brush size which would be
stored in the stroke thickness and then scaled by the point pressure
factor. Finally, the render engine would divide this thickness value by
2000 (we're going from a thickness to a radius, hence the factor of
two) to convert back into blender units.
Store the radius now directly in blender units. This makes it
consistent with how hair curves handle the radius.
* Removes the scaling in the render engine.
* Makes sure the grease pencil primitives use the correct radii
* Changes the drawing tool to work with screen space radius
* Draws the drawing tool cursor in screen space
* Makes sure the scaling is done when converting from legacy
grease pencil objects
* Makes sure the scaling is done when loading previous files
Consequences for the draw tool:
* Since the tool has a radius input in pixels, it now works in screen space. This is a pretty big change to how it works by default before, so a new option will have to be added that allows the brush to be in "Scene" space. This is similar to how it works in sculpt mode. But this is a bigger change, so I would like to split that into a separate PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/113770