`collection_collect_data_to_edit` blocks the tree_traverse once a
valid selected collection is found. This prevents delete operation
from deleting child collection when selected. To fix this, introduce a
new boolean `is_recursive`. When this is true, callback function will
return `TRAVERSE_CONTINUE` to continue the walk to children.
Pull Request: https://projects.blender.org/blender/blender/pulls/126883
This patch optimizes `IndexMask::from_bits` by making use of the fact that many
bits can be processed at once and one does not have to look at every bit
individual in many cases. Bits are stored as array of `BitInt` (aka `uint64_t`).
So we can process at least 64 bits at a time. On some platforms we can also make
use of SIMD and process up to 128 bits at once. This can significantly improve
performance if all bits are set/unset.
As a byproduct, this patch also optimizes `IndexMask::from_bools` which is now
implemented in terms of `IndexMask::from_bits`. The conversion from bools to
bits has been optimized significantly too by using SIMD intrinsics.
Pull Request: https://projects.blender.org/blender/blender/pulls/126888
Investigation into #126306 showed that the texture tab shown would actually be
for the active image paint brush, but people used it to set up a texture for
the fluid modifier settings anyway. Now properly register the texture user for
the UI, so the texture properties tab will always be displayed when there is a
fluid modifier with a "Flow" fluid type.
Main issue is that fluid modifiers weren't handled by the
`BKE_modifiers_foreach_tex_link()` iterator.
While this could be handled as another special case in
`buttons_texture_modifier_foreach()`, I updated the texture-link iterators to
support texture properties that are not directly stored in the modifier, but in
some nested data. Seems like this should be supported generally. It's enabled
here by passing a pointer-property pair, rather than just a property name.
Pull Request: https://projects.blender.org/blender/blender/pulls/126893
Fix an issue that was caused by common code used for both these flows:
- 'ensure a slot exists for an ID so keys for it can be inserted' and
- 'assign an Action to an ID'
Both flows search for suitable slots for the ID, but should do so in
subtly different ways. Most importantly, the first case should _not_
search a slot by name (when an Action is already assigned but not a
slot). This is relevant in the following flow:
- Assign an Action to an Object. This auto-selects the most appropriate
slot (by name).
- Un-assign the slot (for whatever reason it's not desired).
- Insert a key.
- This should create a new slot, and not re-assign the slot just
un-assigned above.
Pull Request: https://projects.blender.org/blender/blender/pulls/126850
When 'really' large buffers are allocated the incorrect clamping
function was used and the actual buffer allocated was smaller than
expected.
This was detected during investigation of #126863.
Pull Request: https://projects.blender.org/blender/blender/pulls/126915
Implementing part of design outlined in #126087.
- VSE thumbnail cache has a new implementation, hopefully simpler
and easier to understand.
- Instead of cache key being a VSE strip, frame index, plus
complicated logic for cache items linking etc.,
- The cache is keyed by media file path (if multiple strips
use the same input file, they will share cache entries), frame
index within media file, and any extra data (e.g. steam index
for multi-steam videos)
- Much reduced cache flickering and strange/weird thumbnail choices.
- Likewise, thumbnails no longer disappear-and-reload on operations
like Undo, dragging new video strip into timeline, or F12 render.
- Thumbnails now load faster.
- Images use dedicated/faster thumbnail loading routines when a
format can do that (e.g. JPG and EXR can).
- Movies reuse ffmpeg decoding context for neighboring strips
that use the same file (as often happens when cutting footage)
- Thumbnail requests are processed on several threads now too.
Images and more detail in PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/126405
When unsibdivide ran with quads that share shared two edges,
only one of the loops attached to the vertex would have its grid
initialized (multiple times), skipping the other loops grid calculation
and leaking memory.
Hidden geometry caused an eternal loop in the un-subdivide internal
logic.
Also fix the un-subdivide operator leaving an invalid selection,
where faces where unselected while all their edges were selected.
Docking uses window overlays during feedback and these have to be
stopped and changed if you move the target from window to window.
The logic of changing the window that gets the overlay will sometimes
fail when the target window is null and old window was null - it
gets stopped (because they are equal) but not started again. This PR
just adds a check for null window.
Pull Request: https://projects.blender.org/blender/blender/pulls/126906
The resulting location was incorrect because the offset didn't account
for multi-byte characters and the logic had not been updated to use the
TXT_LINE_HEIGHT macro.
Also removes use of `goto` in favor of early return.
Ref !126720.
Brushes that were verified to be impacted by this:
* Clay
* Smooth
* Cloth
Brushes that were verified to not be impacted:
* Draw
* Blob
There is some dependency within the brush code that expects that the
`ss.deform_cos` variable is not updated during the middle of the stroke.
This commit only deals with fixing the immediate user-facing issue, for
a longer-term or more comprehensive fix, it is likely that these values
should not be touched at all inside the `sculpt_update_object` function
but should instead be initialized somewhere else so that the lifecycle
is more obvious and maintainable.
Pull Request: https://projects.blender.org/blender/blender/pulls/126803
ID usages of embedded data would be refcounted twice when copying their
owner ID.
Also did cleanup on naming, since proper names of these IDs is
'embedded', not the old 'private' one.
This replaces the plain texture selector with a proper TemplateID,
resulting in buttons to add a new texture if none is there yet, and if
there is one, there will be the usual conveniece buttons to add a fake
user, create single user copies, ..., as well as the button to go to the
textures tab in the Properties Editor for more fine-grained control over
the texture.
Fixes#126856
Pull Request: https://projects.blender.org/blender/blender/pulls/126890
In order to make per-BVH-node overhead smaller and also to improve
type safety and code clarity, split the `pbvh::Node` struct into four classes:
a base class, and a class for each sculpt geometry type.
The size of a mesh BVH node changes from 408 to 176 bytes. For multires
the nodes are smaller at 96 bytes. This gives us leeway to make nodes smaller
to benefit more from spacial locality, etc. It also just reduces memory usage.
Using a `std::variant` makes the change quite simple actually. For the few
places that actually need to process the node types separately given their
different types, we use `std::visit`. Elsewhere we use `IndexMask` to retrieve
selections of nodes from the vector instead, though most code will be
refactored to that pattern separately. The new function `search_nodes`
is the equivalent of the existing `gather_nodes` that returns an `IndexMask`
instead of a vector of node pointers.
Part of #118145.
Pull Request: https://projects.blender.org/blender/blender/pulls/126873
The type of an RNA types "bl_rna" should be `bpy.types.Struct`,
it was being set to the type it represented so:
`type(bpy.types.Object.bl_rna) == bpy.types.Object`
which wasn't correct.
Ref !126877
Co-authored-by: Bastien Montagne <bastien@blender.org>
Grease Pencil v3 was using the same shader as particle strands, this leads
to sharing edit overlay color as particle strands. This patch fixes this
behaviour by adding a grease pencil toggle in the shader so grease pencil
overlay will use appropriate color and point sizes specified in the theme.
Pull Request: https://projects.blender.org/blender/blender/pulls/125689
When docking to very narrow areas it is only possible to dock to a
subset of three zones. This PR corrects mistakes in that code so that
you can correctly dock to tiny areas.
Pull Request: https://projects.blender.org/blender/blender/pulls/126868
If the Timeline is sized too short to show any of the scrubbing area,
then the scrollbars obscure the time line and current frame marker.
This PR hides the scrollbars in this case. Also for similar cases with
Dope Sheet, Graph Editor, and the embedded Graph Editor/DopeSheet in
Movie Clip Editor.
Pull Request: https://projects.blender.org/blender/blender/pulls/126806
Assigning an Action slot changes two RNA properties on the `AnimData` struct:
- `action_slot`: pointer property used for the selector in the UI, and
- `action_slot_handle`: int property that's the ground truth of the assigned slot.
With this commit, there will only be an override operation stored for the
`action_slot_handle` property, and the pointer property will be ignored.
This also cleans up some other library overrides related things:
- Disallow overriding slot properties (like the slot name).
- Properly handle slot assignment in the case where the library did not have an `AnimData` at the time of the creation of the override, but when it does when applying the override (in `rna_AnimaData_override_apply()`).
Fixes#125978
Pull Request: https://projects.blender.org/blender/blender/pulls/126828
Add Metallic BSDF Node to the shader editor.
This node can primarily be used to create more realistic looking
metallic materials than the existing Glossy BSDF node.
This commit does not add any new closures to Cycles, it simply exposes
existing closures that were previous hard to access on their own.
- Exposes the F82 fresnel type that is currently used by the
metallic component of the Principled BSDF. Results should match
between the Metallic BSDF and Principled BSDF when using the same
settings.
- Exposes the Physical Conductor fresnel type that was previously
limited to custom OSL scripts. The Conductor fresnel type accepts
IOR and Extinction coefficients to define the appearance of the
material based off real life measurements.
EEVEE only supports the F82 fresnel type with internal code to convert
the the physical conductor inputs in to a colour format for F82,
which can lead to noticeable rendering differences with
some configurations.
Pull Request: https://projects.blender.org/blender/blender/pulls/114958
The issue was that the forward compatibility saving code was setting the
group's `channels` listbase to point at the forward-compatible fcurve
listbase, but the `channels` listbase wasn't later getting cleared when
loading the groups as part of a layered action. In fact, the listbase
pointers were being completely ignored in that case because they aren't
relevant to groups on layered actions, and therefore weren't getting
remapped to the new correct memory addresses of the fcurves.
The end result was that after loading, the group's `channels` listbase
would be non-null and pointing to invalid memory, and there are some
code paths that then try to use that listbase, resulting in a segfault.
This commit fixes the issue by ensuring that the groups' `channels`
listbases are cleared when loading them as part of a layered action.
Additionally, we now also clear them after they're set during
forward-compatibly saving, the lack of which wasn't immediately
causing problems but was nevertheless incorrect.
Pull Request: https://projects.blender.org/blender/blender/pulls/126834
Part of #118145.
In order to reduce the purview of the sculpt BVH tree and clarify its
responsibility, replace the geometry back pointer with just passing
the BMesh pointer as an argument where necessary or retrieving it
from the object instead.
True for both `Graph` and `Dopesheet` views in the MCE.
For all other time-based editors, the main region (`RGN_TYPE_WINDOW`) is
of interest to be tagged for syncing `V2D_VIEWSYNC_SCREEN_TIME`. In the
case of the Movie Clip Editor however, the `Graph` and `Dopesheet`
regions in question are of type `RGN_TYPE_PREVIEW`.
So to resolve, we have to take this into account in view2d_sync RNA code
NOTE: this PR does not add versioning code, so any "falsely" tagged
`Graph` and `Dopesheet` view will "loose" the setting (will have to be
enabled again on the "right" region), this could be added though -- it
would be impossible to tell **which** view exactly, so on each
`RGN_TYPE_WINDOW` encountered, we'd have to then tag **both** `Graph`
and `Dopesheet` afaict
Pull Request: https://projects.blender.org/blender/blender/pulls/126785
The manifest was not linked, leading blender-launcher not to look in
the blender.crt folder for the vcruntime140.dll. Causing issues for
systems where this binary was not available elsewhere (like pristine
windows installs)
When orcos are not available in the geometry data it is bound with
a default buffer. This buffer was initialized with only zeros. But
orcos required to read the 0, 0, 0, 1.
Fixes `render/shader/tex_voronoi.blend` render test.
Pull Request: https://projects.blender.org/blender/blender/pulls/126838