Nodes are sorted based on the selection. In some cases (even depending
on processor speed, nodes can be selected and reordered, and another
operation can run before the next redraw). That gives a window where
operators mapped to the same input as selection can run with invalid
socket locations (which aren't updated after the nodes are reordered,
since they are stored in a separate array).
To fix this, move the socket locations from the node editor runtime
data to the node tree, tag them as invalid when the nodes are
reordered, and check for that status in a few more places.
A better longer term solution is not reordering nodes based on
UI status and instead storing the UI drawing order separately.
Pull Request #104420
This patch fixes hanging unit tests when MetalRT is enabled. It simplifies and fixes the kernel selection logic by baking the MetalRT-specific options into `kernels_md5` rather than expanding out and testing MetalRT bit flags explicitly.
Pull Request #105270
When an RNA type was registered, any existing dynamic types with the
same name were unregistered. This didn't account for built-in types
which cannot be unregistered in (most cases) allowing duplicate
operators for e.g. to be registered with the same name as existing
built-in operators (asserting with debug builds with GHash duplicates).
In practice the newly registered operator would be called unless
adding operators caused the GHash to be resized which could cause the
original operator to be used.
As registered RNA type identifiers are meant to be unique, don't allow
duplicate names in the first place. Now all dynamically registerable
RNA types prevent this situation, raising an error when scripts
attempt to register a type with an identifier matching the name of a
type that could not be removed.
Shortened in [0], increase to 1024 with the following changes:
- Use BKE_ST_MAXNAME for translation_context.
- Use OP_MAX_TYPENAME for wmOperatorType.name.
Both these limits were already used elsewhere but happened to use
RNA_DYN_DESCR_MAX (incorrectly).
[0]: f403d9a2b1128565c503755668c7bc001ecb2eb3
Exiting curves edit mode (going to object mode) would not update the
screen.
The fix adds a case to `ED_object_editmode_load_free_ex` for CURVES
to make sure the function returns properly. This then correctly adds the
notifier in `ED_object_editmode_exit_ex` to update the screen.
Pull Request #105252
- "Value" in the sense of color lightness is not the same word in
Japanese as other usages. See #105113.
- "Double" as a data type vs. a value.
Also extract "Custom Color Presets" in the tracking UI.
Run clang-format as well.
Pull Request #105187
This adds some simple null checks to avoid the crash. It might still
be good to improve the error message, but also does not seem as
important as avoiding the crash. Typically, users should not run into
this issue because the assets are shipped with Blender.
When using multiple compositor output nodes, compositing would fail
, showing a completely black output as it doesn't respect the active
node.
This patch will equalize the implementation with the viewer nodes.
Patch created by @OmarEmaraDev
Fixes: #86836
Pull Request #105235
Similar to recent issues with gl_shader_interface,
ShaderInput lists need to be sorted to ensure correct
and efficient uniform lookup by name.
Authored by Apple: Michael Parkin-White
Ref #96261
Pull Request #105239
This commit adds the default .usdz export capability.
The importer already supports usdz so no change is required other than updating the text in menu to match the updated exporter text.
On export, a .usd/a/c file has to be created first, and then converted to .usdz. A weird change of directory is required because of a quirk with the USD conversion to usdz. If an absolute filepath is passed into the `UsdUtilsCreateNewUsdzPackage` function, the usd files inside the usdz archive will have the same directory structure, i.e. if one tries to create a file at `C:\code\BlenderProjects\file.usdz`, when the usdz file is created, inside it will have the structure `\code\BlenderProjects\file.usdc`.
This is counteracted by setting the current working directory to the temporary session directory where both the usdc and usdz files are created, and just passing the file name to `UsdUtilsCreateNewUsdzPackage` without any filepath. Once the usdz file is created it is moved to the intended directory.
There is a separate `UsdUtilsCreateNewARKitUsdzPackage` capability for exporting usdz for iOS devices that will be implemented in a follow up patch as it will require some more small UI changes.
Co-authored-by: Charles Wardlaw (@CharlesWardlaw)
Co-authored-by: Sonny Campbell (@SonnyCampbell_Unity)
Co-authored-by: Bastien Montagne (@mont29)
Pull Request #105185, based on #104556.
Pull Request #105223
While some implementations of `getcwd` may return an allocated string
instead of the given char buffer in some cases, this is not the expected
behavior of the BLI wrapper. Not to mention the danger of returning a
pointer to a static char buffer...
Improve `ChangeWorkingDirectoryTest` to be more 'full check' regarding
behavior of both `BLI_current_working_dir` and `BLI_change_working_dir`.
Also move call to `BLI_threadapi_init` into proper `SetUp` method (to
have correct symmetry with the call to `BLI_threadapi_exit` in the
`TearDown` one).
Based on investigation by Charles Wardlaw (@CharlesWardlaw).
Pull Request #105220
Add `BLI_change_working_dir(path)` to change the current working directory.
This change is required for adding USDZ support to Blender. When exporting to that format, we are required to do a weird change of directory because of a quirk with the USD library's USDZ functionality. If an absolute filepath is passed into the `UsdUtilsCreateNewUsdzPackage` function, the USDZ archive will store that full path.
macOS uses `NSFileManager` through some new Mac-only wrapper functions.
Ref #99807
Pull Request #104525
Apparently `git checkout -t` is only allowed to happen for new branches.
Added a code which checks whether the branch already exists and it so
uses the `git checkout <branch>`.
Pull Request #105234
e8f4010611e76e0b88cd unified the bounds computation for the new curves
object type and the rest of the curves system used by geometry nodes.
In the process, it made bounds affected by the control point radius.
In theory that makes sense; the bounds are supposed to be the extents
of the visible geometry. But in practice the change wasn't expected,
for a few reasons:
- The radius has never affected the bounds for the legacy curve type
- The default radius of legacy curve objects is absurdly large at 1.0m
- Only the new curve object has visible radius, and only in "strip"
mode or when rendering with Cycles
Currently the bounds are only used for the "Bounding Box" geometry node
and the panel in the 3D viewport sidebar, so there isn't any incentive
to choose less intuitive behavior yet.
Long term, the correct behavior is probably to include the radius in
the bounds, but this commit postpones that change to when it works
better with the rest of the curves system.
Pull Request #105154
Writing to a bitmap from multiple threads causes races when writing to
bits within the same integer. Instead, write to a separate boolean
array while subdividing, then move that to the final mesh bit vector.
Notes:
- The final copy to the bit vector could be replaced by a generic
`copy_from(Span<bool>)` call in the future.
- Theoretically we could entirely replace the `BitVector` with an
`Array<bool>`, but 1/8 the memory use for edges is likely worth it.
Pull Request #105156
GPencil 3D stroke rendering uses a geometry shader.
This is unsupported by the Metal backend, so implement
fix for this failing compilation by shifting geometry shader
logic into the Vertex shader for Metal backend.
Authored by Apple: Michael Parkin-White
Ref #96261
Pull Request #105143
Metal LineLoop emulation path does not correctly apply
when using SSBO vertex fetch mode alongside 3D line
rendering.
Patch moves line emulation above SSBO
vertex fetch setup to ensure the correct emulation
parameters are passed to the shader.
Authored by Apple: Michael Parkin-White
Ref #96261
Pull Request #105142
Resolves issue with nearest filtering on UI Icons. Note that as
Metal does not support LOD bias as a parameter on a sampler
object, the original code has been modified to perform LOD
biasing at the shader level.
As GPU_SAMPLER_ICON is not widely used, it is more
efficient to apply directly to the affected shaders, rather
than workaround passing in the sampler LOD bias as a
separate value e.g. uniform or push constant.
Original PR feedback addressed to also refactor ICON
shaders to use consistent style for single and multi
Icon rendering.
Authored by Apple: Michael Parkin-White
Ref #96261
Pull Request #105145
After 7eda9d8dda, crash occurs when operation search is called and no
active tree element is present. Add missing null check in new poll
function to fix the crash.
Pull Request #105004
After 49ad91b5ab7b7ac8d8c3fcfdb89ca07d0e4f194a, an extra visibility
toggle is being drawn for grease pencil layer in dopesheet. In this PR,
a condition is added to skip drawing of visibility toggle for GPencil
layer. Also, Grease pencil does not support pinning so restore the offset
added to channel for drawing the pin icon.
Pull Request #105080
This is a workaround for [issue #104087](https://projects.blender.org/blender/blender/issues/104087). We encounter crashes when using shader binary archives on AMD, so this disables them while we investigate a proper fix. Kernels will still be cached automatically by the OS file system cache. This cache may occasionally be purged due to external factors, in which case kernels will get compiled again.
Pull Request #105186
If repository has multiple remotes with the same name of branch
checking out to the branch using simple `git checkout branch` exists
with an error: this is because there is ambiguity w.r.t which remote
to track.
Now the code explicitly provides remote to track, preferring to use
"origin" first (which is to be used for Blender style of workflow,
and Github style workflow when there is a fork available), and use
"upstream" if there is no origin.
Pull Request #105176
The preset names were translated before building the UI. This meant
that the translated name was passed to the operator responsible for
deleting the preset file, instead of the original name.
Pull Request #105155
This was actually caused by two problems. The first is that the
code actually deliberately detects if nothing happened and pushed
an undo step, a bugfix for a problem that no longer exists.
The second was that SCULPT_test_location sometimes does a closest
point search instead of ray casting and didn't check the result
against the brush radius.
This might've been a merge error, the result of color mixing
was being overwritten by a simple copy of source to destination
inside of layerCopyValue_propcol.
In 6514bb05ea5a138d8971 I misinterpreted the function's intended
behavior when there was already an existing active layer. The data from
the active layer is just meat to be copied, the function should always
add a new attribute.