Math tests failing in Metal due to non-zero-initialized values
and shader compilation error caused by mutli-component
boolean being implicitly evaluated.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/108758
Bug in Metal when gl_FragDepth is used but not written to by a shader
causing depth-based navigation to fail. Patch ensures gl_FragDepth
is assigned a default value at the current depth from the vertex
shader to catch all edge-cases of this.
Authored by Apple: Michael Parkin-White
Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/108453
When unlinking IDs like GN tree, materials, etc. undo step is not created.
To fix this, assign `undo_push_label` a string value for registering an
undo-step (with the help of `ED_undo_push`)
Pull Request: https://projects.blender.org/blender/blender/pulls/108452
Pinning information was accidentally skipped inside of the
UV packing engine because of their ordering.
This was most noticeable when using the "Bounding Box" shape
method, causing some pinned islands to be moved when they
should have been locked in place.
Fixes#108730
The call to `CustomData_interp` also interpolated the face corner
topology attributes, which broke the mesh completely. To fix this,
avoid relying on the CustomData API and move the attribute
interpolation to use the attribute API instead. This change also
makes it trivial to support all attribute types in the future.
Also, only retrieve the closest vertex once, instead of doing it
again for every attribute. Combined with building the topology
maps in parallel this approximately doubled the performance
of color attribute propagation in a test with 2 million vertices
and 8 color attributes on both domains (63 to 34 ms).
Pull Request: https://projects.blender.org/blender/blender/pulls/108773
Ensure buffer read operations wait for pending GPU work to
complete. This is only required for unit tests, but required to
ensure correct results in all cases. Also adds support for staging
buffer if GPU memory type is private.
Buffer clearing routine added to support values above 1 byte.
The previous buffer clearing functionality using fillBuffer writes
values to each byte, rather than the full 32 bit uint used by the
GPU API.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/108757
The graph editor has the function to hide the display of FCurves and to only draw keyframes on selected curves.
Both options were not respected when executing the frame jump operator,
meaning it would jump to potentially hidden keyframes.
This patch adds a new operator that is specific to the Graph Editor and that respects those features.
The only possible issue that could arise from this is a slight confusion for the user
why they behave differently between editors.
Especially with only the Graph Editor and the 3D view open.
In general I think it's an improvement and follows the "you can only modify what you see" mantra in blender
Also
Resolves#97701
Pull Request: https://projects.blender.org/blender/blender/pulls/108549
Issue here was that Quick Favorites use a property's **identifier** when
adding [which is the bare name without brackets etc. from id properties]
but when spawning the actual menu, `RNA_struct_find_property` expects
the identifier to already include the brackets to know these are id
properties (later on in `screen_user_menu_draw`).
So to solve this, now include the needed syntax when storing the
`bUserMenuItem_Prop` identfier.
Seems the quickest way to append the needed characters is using
`RNA_path_property_py` (not sure if there are better ways to do this).
Also note that we (need to) ignore the actual array index constructing
the string [always pass -1 here] since the index is handled separately [I
tested boolean arrays and these work].
Pull Request: https://projects.blender.org/blender/blender/pulls/108713
During uv unwrapping and uv packing, certain floating point algorithms
have extreme sensitivity to round-off errors. These can produce very
different layouts even when given inputs which are only slightly different.
The root cause is that the two main types of CPUs used to run Blender,
namely x86 and Apple Silicon, produce slightly different results on some
math functions, including `sinf()`, `cosf()` and `atan2f()`.
* sinf(0.8960554599761962890625) = 0.780868828296661376953125 (Intel i7)
* sinf(0.8960554599761962890625) = 0.78086888790130615234375 (Apple M1)
This fix, and others that came before it [0], improve accuracy by using
double-precision to hide the differences between the CPUs.
[0] e.g. 0eba9e41bf
[1] See also #107829
Caused by 98bfa8d458
Occlusion must consider several factors:
- The `Viewport Display` > `Display As` setting of the object.
- The X-Ray mode of the scene.
- Whether only Snap to Face is being used.
- Whether Snap is set to Cage (always transparent) in edit mode.
- Whether the object is hidden.
In the case of Cage, the final geometry should be utilized for occlusion.
However, to prevent excessive and risky modifications, it was followed
the same approach as before and verified the `Display As` setting of
the object.
In particular, the root was not sticking to mesh with hair dynamics.
Reason for this is missing HairKey weight upon conversion (everything
had zero weight). This then can not be corrected (since weight tool does
not allow to paint on roots).
So now, give the hair a default 1.0 to 0.0 weight gradient upon
conversion [which is in line with the default weight distribution for a
hair particle system].
Pull Request: https://projects.blender.org/blender/blender/pulls/108651
Part of the checks to see if translating a UI string is allowed or not
is that current thread is the main one. This was a requirement years ago
of the Boost backend for translations.
Not sure whether this can be removed or not now, but it needs to be
carefully checked, done it as its own commit, and not in a beta release
branch. ;)
Sorry for the noise, totally missed this during the patch review
yesterday.
Pasting numerical array buttons happens with `Ctrl + Alt + V`.
Holding `Alt` also triggers uiSelectContext, so having other nodes/
objects etc. selected while doing this would try to copy the pasted
values back to other objects (possibly to the ones you pasted from) and
that happens relative to the original value, so the value actually
changes.
NOTE: the `Ctrl + Alt + V` shortcut can also be used on non-array buttons, so was an issue for them as well.
To prevent the "copy-to-selected" behavior, refine the `IS_ALLSELECT_EVENT` macro to be more specific.
Pull Request: https://projects.blender.org/blender/blender/pulls/108270
References to data-blocks in a material were stored in-memory and could
crash if the data-blocks referenced by the material no longer existed
when pasting.
Resolve by using a blend-file for material copy/paste, matching how the
clipboard works in the 3D view-port.
Currently there is no support for including indirectly linked
data-blocks when pasting the material. Instead, data-blocks are restored
by name, by inspecting the current file.
This also fixes a crash where the `SpaceNode::nodetree` could point to
freed memory when pasting a material.
Ref !108496.
Includes contributions by @mont29.
---
Fix back-ported to main [0], including fix [1].
[0]: 5177e2f20b
[1]: 64aa96d421
`hair_out_mesh` and `hair_in_mesh` implicitly share edges.
In `hair_create_input_mesh()`, edge data of `hair_in_mesh` needs to be
updated and therefore are copied to a new location. In the subsequent
frames, `psys->clmd->clothObject->edges` won't be updated and point to
freed memory block. Therefore, Blender crashes.
By freeing `hair_out_mesh` first,
1. in `hair_create_input_mesh(),` at least edge data copying is avoided
2. `psys->clmd->clothObject->edges` always points to correct memory
However, since it's possible that similar situation will happen again
by adding another strong user to the same `CustomData` in the future,
it is safer to update `psys->clmd->clothObject->edges` for every frame.
Pull Request: https://projects.blender.org/blender/blender/pulls/108480
The "Fill" message can be either a noun or a verb. This commit
disambiguates the verb usages for translation through various
translation contexts.
The more involved change is in the generation of keymaps from paint
modes. By default, the enums defining brush names are in the default
context, but this commit changes the ones including a "Fill" item to
"Brush". In order to get the same contexts in the keymap, we introduce
a specific function in `paint.cc` to return the appropriate context
depending on the tool.
Issue reported by Gabriel Gazzán (@GabrielGazzan) in #43295.
Pull Request: https://projects.blender.org/blender/blender/pulls/108561
This came up in #108096
Reason this fails is the `ui_but_has_array_value` check [which depends
on a property subtype that supports arrays]. The default `VectorBuilder`
has a `PropertySubType` of `PROP_NONE` though, so one possibility
would be to change this to `PROP_XYZ`.
However, RNA should know much better which RNA property buttons
have arrays than the UI code, so use RNA_property_array_check now
(instead of checking particular UI property subtypes).
Pull Request: https://projects.blender.org/blender/blender/pulls/108349
When adding a texture paint slot to an object, the object could have no
material, this patch handles that by checking the material first in
`default_paint_slot_color_get`, if material is null, then it will return a
fallback default color so the operator can proceed normally.
Pull Request: https://projects.blender.org/blender/blender/pulls/108592
- Paste flipped created invalid paths when the size of the name changed
left -> right: lost the 't' in right.
right -> left: lost the entire end of the RNA path.
- Correct the fixed buffer size as it may include escaped characters.
Fix a mistake in commit 2ce5fc4a3e that caused a crash when detaching
node links from input sockets.
When a link is detached from an input socket, `nodeRemLink` nulls the
`link` pointer of the socket.
So before the next update inputs are linked but don't have a valid `link`
pointer causing the crash, when trying to access the link in
`std_node_socket_draw`.
The introduced check avoids the crash and is more correct since it
doesn't just check one link for multi-input sockets.
Pull Request: https://projects.blender.org/blender/blender/pulls/108623
- "Invalid" in transformation messages.
- For three messages, translation occured after a string
- concatenation, so the full message was not found.
Instead, translate a format pattern and format it afterwards.
- Alembic errors when there is an import type mismatch.
Pull Request: https://projects.blender.org/blender/blender/pulls/108212
Code was plainfully buggy, early-out check in
`BKE_undosys_stack_limit_steps_and_memory` was plainfully wrong.
Also added some more logging for memory limiting code.
Produce optimal layouts for `n` squares, where n == 11, 18, 19 and 26.
With thanks:
* Walter Trump
* Pertti Hamalainen
* Robert Wainwright
* Erich Friedman
Prevent make links operator from creating links to sockets that are
already linked to a muted link.
The `SOCK_IS_LINKED` flag is used to check if there already is a link
connecting to the socket but when the link is muted, the flag wasn't set
leading to issues in parts of the code that used the flag to check
for any type of connected link.
This commit now also sets `SOCK_IS_LINKED` when links are muted and
adds an additional check in places where different behavior is expected
for muted links.
Pull Request: https://projects.blender.org/blender/blender/pulls/108375
Fix node link insertion during transform not working properly for
rotation and scale.
Inserting nodes by rotating or scaling...
* ...didn't offset the attached nodes.
* ...could lead to unfreed memory.
This commit fixes that by always calling the `NODE_OT_insert_offset`
operator at the end of the node transform operator rather than having
to explicitly append it into a macro operator for each transform
operator.
Pull Request: https://projects.blender.org/blender/blender/pulls/107460
The solution using `reverse_index_array` didn't work because it lost the
order that the corners were processed in (the order around the vertex).
This is important when setting custom normals because the process
sets sharp edges when the normal of the current and previous corner
is too different.
Because of how the Clip Editor managed region state for different view
modes before region polls were introduced (fa0f295b53), regions could be
written to files in a state that's not valid for displaying them. State
for clip editors written to files is corrected with versioning now.
The user count decrement and unassigning the action were split
between two different conditionals, which weren't guaranteed
to both execute/not-execute together.
Objects were excluded from the ID operation, as originally they had
their own entry in their own menu. Joys of nightmare tools handling in
the Outliner...
Painting weights in Grease Pencil with the auto-normalize option enabled,
gave unpredictable results when vertex groups with a weight of zero
were involved.
This patch resolves the issue. Vertex weights of zero are excluded from
auto-normalization. Which is a better fit for the Grease Pencil workflow,
where weights are mostly painted from scratch since the 'parent to
armature with automatic weights' operator doesn't give good results.
Pull Request: https://projects.blender.org/blender/blender/pulls/108524