Unwrapping warned that a non 0/1 boolean value was being set.
Initialize all members of PVert since they would be accessed
when duplicating a PVert causing the uninitialized memory to be read.
It was difficult to notice, but we weren't making use of the
`USDPrimReader::valid()` API calls during import.
In many(all?) cases this was fine as we would check the validity during
`read_object_data` or similar anyhow. Rather than just removing the API
entirely, this patch attempts to use it and has the following design:
- Where ever and whenever a reader is created, in addition to checking
null, we should now also check for `valid()` This happens in
`usd_capi_import` and `usd_reader_stage`.
- The `valid()` call is intended to check just the USD object status.
Blender object checks are handled elsewhere (same as they are
currently) since these objects are often not available at the time of
the call to `valid()`
This has the benefit that we at least know that USD is valid before our
heavy reading code ever starts executing. Some duplicate checks are now
removed.
Pull Request: https://projects.blender.org/blender/blender/pulls/129181
This "update object for edit" call is incorrect because it retrieves the
evaluated state for the object that the undo itself invalidates. The
object/modifiers must reevaluate before we rebuild the deformation
matrix array (which is the operation causing the crash).
Pull Request: https://projects.blender.org/blender/blender/pulls/129474
All sculpt and paint modes should have the brush selector asset shelf
popup in the tool settings header. For curves sculpt mode this was
missing. There's no good reason for this, probably just an oversight.
All sculpt and paint modes should bring up the brush selector asset
shelf popup on Shift+Spacebar. For grease pencil vertex paint mode the
shortcut was missing. I think it was added earlier, but only for the
grease pencil v2 keymap, the v3 one got merged later only.
The Cryptomatte node produces a bad output when the viewport is in
camera view. That's because compositing is limited to the camera region
in that case, but the node assumes the full viewport size. To fix this,
only consider the compositing region instead of the full viewport.
The enums for the Distance Mate node had wrong values that weren't
inline with RNA values. This patch corrects them and uses the enum in
RNA to be more robust in the future. The wrong values weren't used
directly, so this had no effect on the end user.
De-duplicate low level logic that reads the clipboard in a thread.
Instead, expand the utility function for reading from the clipboard
with arguments so it can be used for images & text.
Introduced in 853269aeb0
Prior to this commit, the PBVH partitioning process did not work
correctly for multires meshes with materials. Specifically, it failed
upon mapping the partitioned faces into their corresponding corners.
The rough process here is as follows:
* Flatten out the array of face indices into an array of corner indices.
* Sum up each `GridsNode` `prim_indices` corner count into an array.
* Create an `OffsetIndices` from these sums
* Use the `OffsetIndices` to slice the array created at the beginning
to assign to each node.
However, this process requires that the main PBVH array of corner
indices has the same order as iterating over the nodes, which the
partitioning algorithm does not do.
To solve this, this commit iterates over the Node `prim_indices` `Span`s
in the same order that the nodes are stored when flatting out the
corner data, ensuring a correct mapping.
Pull Request: https://projects.blender.org/blender/blender/pulls/129392
The length checking wasn't accounting for null bytes within multi-byte
sequences and could step over the null bytes.
For BLI_strlen_utf8 this could result in an out of bounds read.
In practice most UTF8 data is validated so the extra checks
are mainly to prevent errors on invalid or corrupt UTF8 text.