Crash is due to accessing higher index of 0 sized array. Fix this by
changing the size of vector.
Missing update seems to be due to wrong PBVH node flags and typo.
Pull Request: https://projects.blender.org/blender/blender/pulls/116935
Regression from porting "Smart UV Project" from Python to C
[0] which removed UV island alignment support.
Restore support by adding X/Y aligned rotation to UV pack. Vertical axis
alignment is the default for smart project matching previous behavior.
Resolves#116355.
[0]: 850234c1b1
The functions for creating bpy vector properties used fixed size
`default_value` arrays on the stack. The array was not large enough to
store all the default values for larger multidimensional properties,
which would write past the end of the array and start corrupting the
stack, leading to crashes.
The maximum total length of a bpy vector property is 32768 (32x32x32)
which is a little large of an array to be putting on the stack, so the
`default_value` array now uses `blender::Array` and allocates additional
memory if the number of `default_value` elements exceeds its inline
buffer size of 64.
To simplify allocating arrays of the correct size,
#bpy_prop_array_length_parse now fills in `array_len_info->len_total`
when parsing a sequence.
Pull Request: https://projects.blender.org/blender/blender/pulls/116811
This function had the exacyt same behavior as the 'UI' operators, make
local invoqued on a linked liboverride would make the data local, but
would not clear the liboverride data from it. User then needs to call
this operation again if they want to remove that liboverride data.
The new `clear_liboverride` parameter to `ID.make_local` forces always
clearing any liboverride data, and allows to make a linked liboverride
fully local with a single call.
This option is kept disabled by default, to ensure default behavior
remains unchanged.
This cleanup changes the `layer` parameter in `get_drawing_at` and `get_editable_drawing_at` to a reference.
This makes it clear that the layer is required for this function.
When loading an unknown node type from a newer Blender version, the node
storage data cannot be properly loaded. Re-saving the file will then
crash if saving with the same node type idname, since new Blender
versions cannot find the expected storage data.
Loading in older versions should replace unknown node types with a dummy
"Undefined" node that will get loaded as NodeTypeUndefined in newer
versions as well. Custom node types are exempted from this since they
store all data as generic ID properties and can always be fully
serialized.
This is a revised version of the initial attempt in #114803.
Doing the node type fix in the after-linking stage ensures that
versioning code can change outdated node types which might otherwise get
removed by this type check.
Pull Request: https://projects.blender.org/blender/blender/pulls/116908
This simplifies the code that creates the zone socket mappings at the cost of
slightly more memory per zone, which is not significant.
Previously, `IndexRange` was used where it now uses `Vector<int>`.
Pull Request: https://projects.blender.org/blender/blender/pulls/116939
Adds a header that defines the same constants as the C++ 20
<numbers> header.
Benefits:
- Decouple our C++ and C math APIs
- Avoid using macros everywhere, nicer syntax
- Less header parsing during compilation
- Can be replaced by `std::numbers` with C++ 20
Downsides:
- There are fewer numbers defined in the C++ standard header
- Maybe we should just wait until we can use C++ 20
Pull Request: https://projects.blender.org/blender/blender/pulls/116805
The last element of each 2048-element section was being skipped because
the size of an `IndexRange` was being calculated like
`range.last() - range.start()`, but it should have been like
`range.one_after_last() - range.start()`. For example, the `IndexRange`
starting at `0` with a size of `3` contains the values `0`, `1` and `2`,
so `.start() == 0`, `.last() == 2` and `.one_after_last() == 3`.
False positives could occur because the entirety of the `values` array
was always being checked, even when only the first few elements were
initialized. An end iterator matching the end of the initialized
elements is now used instead of the end of the array itself.
The `value` argument was ignored by some code paths, which instead
always checked for `true`. This didn't cause any issues currently,
because all uses of #contains are searching for `true`, but this may not
be the case in the future.
Pull Request: https://projects.blender.org/blender/blender/pulls/116834
Update the documentation of `CONSTRAINT_DISABLE` and `CONSTRAINT_OFF`
flags to clearly distinguish them from each other.
- `CONSTRAINT_OFF`: The eye icon in the interface. Managed by the user,
maybe indirectly via the animation system or drivers. Maps to both the
`mute` (positive) and `enabled` (negative) properties in RNA.
- `CONSTRAINT_DISABLE`: The red color in the interface that indicates
invalid settings. Set by Blender when a constraint is considered to be
invalid, for example a 'Copy Location' constraint without a target.
Maps to `is_valid` (negative) in RNA.
No functional changes.
The Specialization Shader workaround generated code that wasn't Vulkan
GLSL compliant. The uintBitsToFloat cannot be used during global const
initialization.
This is a temporary work around until we implement the Specialization
Constants for Vulkan.
Pull Request: https://projects.blender.org/blender/blender/pulls/116942
This was caused by 74dd1e044b.
The fix implemented here disables socket picking in the header region of
non-collapsed nodes. This way, resizing always works when on the left
and right side of the header.
Remove the `BoneCollectionItem::supports_collapsing()` method, as the
parent class already does exactly the same thing. No need to override that.
No functional changes.
Explicitly use `std::abs()` instead of `abs()`, so that it returns
`float` when its argument is `float`.
Clang was warning: using integer absolute value function 'abs' when
argument is of floating point type.
Support tracking the `bone_collection.is_visible` property via library
overrides.
This requires an RNA change. Instead of exposing all bone collections as
`armature.collections.all` (i.e. a sub-property of `.collections`) it is
now exposed as `armature.collections_all` (an armature property).
There is still the limitation that insertion operations are only
supported on `armature.collections`, so only new roots + their sub-trees
can be added via library overrides.
Overrides on `armature.collections_all` are limited to overriding
property values. The `parent`, `index`, and `child_number` properties
are excluded from this, as reorganising the hierarchy itself via
overrides is not possible.
Now, such links are treated similar to muted links. Links coming from dangling
reroutes are not added to the set or border links anymore. They should be
ignored by evaluation systems.
Even though the brush rotation is computed as a 2D angle (based on the mouse
movement), it currently gets applied by rotating the projected X direction
around the the normal in 3D.
This patch ensures that rotation gets applied first, and only then does the
motion direction get projected into the tangent plane. A potential issue with
the current approach is that the random perturbations will also be applied in
2D, but this seems to be fine from discussions with @JulienKaspar and @Sergey.
Also, there was an error where the location should probably be converted *to*
world coordinates.
All these changes seem to fix the issue described in #116418.
I also noticed some minor "inconsistencies" with how the rotation is applied:
For curve strokes, the direction of the curve corresponded to the upward
direction of the brush. For view plane, area plane mapping and anchored strokes,
the mouse motion indicated the downward direction of the brush.
For compatibility, I tried my best to enforce the latter conventions throughout,
but I'm not so confident about oversights.
Pull Request: https://projects.blender.org/blender/blender/pulls/116539