The issue crash was caused by non-safe cast from a bare C array
float[4][4] to float4x4*. Such cast is not safe because it might
break alignment.
Modified the code so that the transform matrices are passed by
value.
Technically it could mean higher memory usage, but odds that the
actual geometry which is a part of boolean operation consumes much
more memory. Additionally, avoiding indirection could potentially
lead to better performance.
Pull Request: https://projects.blender.org/blender/blender/pulls/114421
Adding strips or changing filepaths caused thatde movie files were loaded,
but memory was only released after new frame was rendered. Since FFmpeg
can take a lot of memory per strip, this can cause crash.
Free memory for each strip immediately after it is not needed after
these operations.
Pull Request: https://projects.blender.org/blender/blender/pulls/114381
When trying to sculpt a Grease Pencil object with a line art modifier
(other modifiers probably also casue issues), Blender would crash.
I wasn't able to track down the exact issue but it's related to how
the update-cache stores pointers to original data.
This reverts part of e2befa425a to not make use of the update
cache while sculpting. Combined with modifiers, this approach
is just too unstable right now.
Pull Request: https://projects.blender.org/blender/blender/pulls/114410
Issue was reported with a 3.6 file crashing 3.3LTS, but the underlying
problem still exists in current codebase, and could also potentially be
caused by other edge-cases.
Pull Request: https://projects.blender.org/blender/blender/pulls/114397
Previous fix partially fixed the issue, there were still some left over
issues where that alpha channel wasn't loaded correctly and therefore
could lead to fully transparent stick bones.
Previous fix: 3da63377fc
Pull Request: https://projects.blender.org/blender/blender/pulls/114393
Blender 4.0 added new socket types that get written into legacy node
group interfaces by forward compatibility code. Such unsupported socket
types have to be handled by the socket declaration system and ignored
during execution.
Ported blender-v3.6-release fix#114056
Pull Request: https://projects.blender.org/blender/blender/pulls/114401
When there is a non-sculpt mode undo step before the operation,
redoing the node tool operation doesn't work correctly-- the undo
that happens before repeating the operator doesn't work.
The fix is using the sculpt geometry undo step system. Theoretically
this should be cheap because implicit sharing will avoid copying most
of the attribute layers. However in the future it would be good to avoid
a PBVH rebuild after the operation in some cases.
This is a last-minute patch to address #113898.
There are two remaining known limitations, which are accepted for now:
- Drivers/keyframes don't transfer to the extra nodes in automatic conversion setups (such as for Subsurface Color)
- Drivers/keyframes on Sheen Tint/Specular Tint only apply to the R channel, since they were changed to color inputs in 4.0
Pull Request: https://projects.blender.org/blender/blender/pulls/114300
Property `speed_factor` was used before retiming. It was kept for
potential versioning code for complex speed animation, that was
possible with even older `pitch` property.
Strips, where `speed_factor` is set to static value are already
correctly converted.
Such versioning code would be quite complex, possibly slow and maybe
could corrupt files. This is due to multiple factors:
- Sound seeking was broken, so conversion would have to ignore all
keyframes before strip starts to map frames properly.
- Because some animation was effectively ignored, it may cause
inconsistencies when doing conversion.
- It would have to integrate value of `speed_factor` to map keyframes
to strip space, but the animation is not limited to strip length.
- For each keyframe where speed gradually changes, at least one smooth
speed transition would be required, but there would be discrepancies
that would have to be accounted for. With simpler strategy it is
likely, that extent of ramps would be limited and thus animation would
be quite different from original.
Because of these reasons, I think it is best to not convert
`speed_factor` animation.
Pull Request: https://projects.blender.org/blender/blender/pulls/114295
Unsupported data can be removed, which reallocated the custom data layer
array. Since the temporary ID vectors referenced memory in that array
directly, this could lead to a use-after-free. Instead remove unsupported
data before collecting the referenced attribute IDs.
Also add data-blocks from the redo panel inputs to the temporary
dependency graph added by 2893dc8ab7. Then make a temporary
copy of the properties list to pass the updated "evaluated" pointers to
the geometry nodes evaluator.
Sharing code between the modifier and tools is starting to make things
more complicated than they should be. But for now it's still probably
worth it.
The remaining issue with data-block inputs is #113383. I'll look into
that next.
Pull Request: https://projects.blender.org/blender/blender/pulls/114347
Customs sockets always ignore their draw_color method and are always
drawn using a magenta color.
This is a regression that was introduced in e071288ab2. The commit used
the simple variant even for drawing nodes where a context is available.
So this patch mostly reverts those changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/114148
Windows allows people to pin an application to their taskbar, when a
user pins blender, the data we set in
`GHOST_WindowWin32::registerWindowAppUserModelProperties` is used
which includes the path to the `blender-launcher.exe`. Now once that
shortcut is created on the taskbar, this will never be updated, if
people remove blender and install it again to a different path
(happens often when using nightly builds) this leads to the
situation where the shortcut on the taskbar points to a no longer
existing blender installation. Now you may think, just un-pin and
re-pin that should clear that right up! It doesn't, it'll keep using
the outdated path till the end of time and there's no window API call
we can do to update this information. However this shortcut is stored
in the user profile in a sub-foder we can easily query, from there, we
can iterate over all files, look for the one that has our appid in it, and
when we find it, update the path to the blender launcher to the
current installation, bit of a hack, but Microsoft seemingly offers no
other way to deal with this problem.
Pull Request: https://projects.blender.org/blender/blender/pulls/113859
Use more modern approaches for supporting all generic attribute types,
rather than hardcoding all of the types and mistakenly correlating types
and domains.
A "Converter" template class handles conversion to GPU data and
describing the GPU format. The class is based on recent work in Cycles
attribute upload and is meant to replace the `AttributeTypeConverter`
class in `extract_vbo_attributes.cc`. I will do that as a separate step.
This structure will give build errors if new attribute types are added
but not supported here, preventing the situation described in the
report.
All generic attribute types are supported now, consistently with non
sculpt mode drawing. The edge domain isn't supported though.
Typically edges are more costly and complex to access, and interpolation
is less well defined anyway.
Pull Request: https://projects.blender.org/blender/blender/pulls/114334
Currently the node tool node group and data-blocks referenced by it
may not be part of the active dependency graph. This means we
cannot retrieve their evaluated geometry when executing the operator.
Since operators almost always use the evaluated geometry of other
objects, and since geometry nodes is mostly set up to deal with
evaluated data-blocks currently, this must be fixed.
Instead, set up a temporary dependency graph and add the selected
objects and the data-blocks used by the node group. That graph is
evaluated to give simple access to evaluated data-blocks.
Unfortunately this will cause more work than necessary in a few ways:
1. Selected objects are reevaluated an extra time before execution.
2. All data-blocks referenced by the group are completely evaluated again.
3. The node group itself is reevaluated, which recreates the function graph.
These may or may not become bottlenecks in the future, but it's best to
keep it simple late in the release process. And between a completely
broken feature and a potentially slow feature, the choice is clear!
Pull Request: https://projects.blender.org/blender/blender/pulls/114293
After previous changes to allow command buffers to not require
execution and completion in submission order,
guarantees for releasing freed buffers back to the memory pool
within the frame life time had changed.
This could mean a released buffer could be returned to the
memory pool prematurely, if a subsequent command buffer
completes before a previously submitted one, flagging a resource as no
longer in use by the GPU, while it still may be in use by the orignal
command buffer.
This PR defers final reference count release for buffers
being actively used until the following call to GPU_render_step,
to ensure that buffers freed will be available for the lifetime of
the frame, covering all command submissions, rather than just
within the lifetime of the command buffer submission within which a
buffer was freed.
Authored by Apple: Michael Parkin-White
Pull Request: https://projects.blender.org/blender/blender/pulls/114329
The issue was that when in tweak mode, there are other places than just
the strip list that keep pointers to the tweaked strip. So deleting
that strip would leave dangling pointers, which caused things to blow up
elsewhere.
Pull Request: https://projects.blender.org/blender/blender/pulls/114331
In certain cases bones can disappear in pose mode. The cause was
that the alpha channel was not set in all cases and might use uninitialized
memory as alpha value.
Pull Request: https://projects.blender.org/blender/blender/pulls/114324
If "Region Overlap" was disabled, the region coordinate calculations
would end up placing the header on the bottom, taking space away from
the main asset shelf region. This is because the header was abusing the
`RGN_SPLIT_PREV` flag a bit, because it gave the desired behavior of
hiding the regions together. This worked well because the regions
wouldn't actually do the splitting when one used region overlap and the
other not. But disabling region overlap would bring the splitting
usually enabled with the `RGN_SPLIT_PREV` flag.
This PR removes the `RGN_SPLIT_PREV` flag from the asset shelf header.
Instead a new flag is introduced to only enable the behavior of
`RGN_SPLIT_PREV` of hiding a region together with the previous one. So
the header stays at the top of the region, and labels stay visible.
The new flag is added to the `ARegion.alignment` flags, even though it's
more related to behavior than alignment. However this is more
convenient, and keeps it together with related flags.
Regression from 7ec7dac860 (I assume). While the block active state is
relevant during drawing to avoid glitches, it should be ignored during
handling. Explained further in comment.
The functionality to frame channels in the Graph Editor
did not take into account any NLA mapping, causing the
viewport to frame the wrong part.
Fix it by mapping the `rctf` x-values
I had to remove the `const` on a parameter from the function
since `ANIM_nla_mapping_get` doesn't take a `const`.
Pull Request: https://projects.blender.org/blender/blender/pulls/114325
The issue was that the undo system detected that node trees have been changed
even though they have not. This is because the memory dump of the node tree
changed after unrelated changes. The root issue was that
`bNodeTreeInterface::write` also wrote the struct, and the pointer of the
`bNodeTreeInterface` itself. While this pointer is generally stable, it is not
during file-write, because when IDs are written, a shallow copy is created
first (see `BLO_write_init_id_buffer_from_id`). The temporary buffer for this
shallow copy is allocated on the heap, so its pointer may change over time.
The fix is to simply not write the `bNodeTreeInterface` separately, since it's
already embedded in `bNodeTree`.
Pull Request: https://projects.blender.org/blender/blender/pulls/114322
Mistake in 4d668e6825. `draw_seq_strips()` would use
`UI_view2d_view_orthoSpecial()` to only scale drawing horizontally, but didn't
reset the matrix state for normal view-space drawing. Result is that the
preview range drawing would be broken, and so were add-ons using the
`POST_VIEW` draw callback.
Pull Request: https://projects.blender.org/blender/blender/pulls/114285
Address issues raised by #114155.
Also fix sphinx documentation generation using incorrect identifiers
when looking up references from PyStruct types
(was looking for `bpy.app.bpy.app.driver_namespace.py`).
Regression in [0] which only ran drag events if the press event passed
through.
Resolve using the same logic as select picking
(see: WM_operator_flag_only_pass_through_on_press).
[0]: 4d0f846b93
Adjust clamping of inputs in the Principled BSDF to avoid errors and
inconsistencies between render engines, while trying to leave as many
inputs as possible unclamped for artisitc purposes.
Pull Request: https://projects.blender.org/blender/blender/pulls/112895
The last good commit was 8474716abb.
After this commits from main were pushed to blender-v4.0-release. These are
being reverted.
Commits a4880576dc from to b26f176d1a that happend afterwards were meant for
4.0, and their contents is preserved.
If region overlap was disabled, the full background of the asset shelf
header would be drawn, unlike usually where we keep the space between
button sections transparent. But resizing the region by dragging wasn't
possible from the space between the button sections, even though the
header was fully opaque.
Button section drawing should only be respected when region overlap is
enabled.
The Huang model has issues with fireflies in various scenes, and the
defualt choice is somewhat arbitrary anyway as they have both pros and
cons. For now be conservative and keep the default the same as before.
The asset shelf was hidden by default in 04d22d73f3. But this only
affected existing 3D Views, not newly created ones. This wasn't
intentional, 3D Views should have the same defaults here.
When a spherical reflection probe is in the scene and the viewport
is set to a lookdev world the scene was constantly being updated.
The cause for this was that the reflection probes where updated when
the lookdev shader was compiled, but that is almost always the case.
This PR fixes this by checking the compile status and compile status
change. Only the first time the world has been compiled the world
reflection probe will be marked dirty.
Pull Request: https://projects.blender.org/blender/blender/pulls/114276
This PR will use "EEVEE (Legacy)" for the legacy EEVEE and renames
"EEVEE Next" to "EEVEE".
When starting Blender EEVEE Legacy will still be the default. We
will change the default to EEVEE when all missing features have been
addressed.
After that we can cleanup idnames and panels etc.
Pull Request: https://projects.blender.org/blender/blender/pulls/114272
Goal is to reduce the number of command buffer flushes by tracking what is
happening in the different command queues. This is an initial step towards
advanced queue-ing strategies.
The new (intermediate) strategy records commands to different command
buffers based on what they do. There is a command buffer for data transfers,
compute pipelines and graphics pipelines.
When a compute command is recorded it ensures that all graphic commands
are finished. When a graphic command is recorded it ensures all compute
commands are finished. When a graphic or compute command is scheduled
all recorded data transfer commands are scheduled as well.
Some improvements are expected as multiple compute and data transfers
commands can now be scheduled at the same time and don't need to unbind
and rebind render passes. Especially when using EEVEE-Next which is
compute centric the performance change is visible for the user.
Pull Request: https://projects.blender.org/blender/blender/pulls/114104