Commit Graph

104278 Commits

Author SHA1 Message Date
Philipp Oeser
0a3b44ed64 Fix #114358: Trace Image to Grease Pencil misses first frame in sequence
Off by one when it comes to setting `ImageUser` > `framenr`

Pull Request: https://projects.blender.org/blender/blender/pulls/114365
2023-11-03 09:42:41 +01:00
Sergey Sharybin
e24c7f1954 Fix #114129: Crashes on boolean operation macOS Intel
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
2023-11-03 09:27:59 +01:00
Richard Antalik
5d765a0d31 Fix #114342: Crash when opening too many movies at once
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
2023-11-03 02:01:17 +01:00
Hans Goudey
937b12e983 Fix: Missing include in previous commit 2023-11-02 18:36:21 +01:00
Hans Goudey
b8c5af45ba Fix: Use native path separator for node tools redo panel title
Use the platform dependent `SEP_STR` instead of a hardcoded back slash.
2023-11-02 18:35:35 +01:00
Falk David
05d6818aa2 Fix #110038: Crash when sculpting on GP object with modifier
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
2023-11-02 17:08:36 +01:00
Hans Goudey
db5cae78b7 Fix: Sculpt redo crash after undoing addition of mask
Fixes a crash in the following case:
Enter sculpt mode -> draw face set -> draw sculpt -> undo * 3 -> redo * 3
2023-11-02 16:40:38 +01:00
Bastien Montagne
67445c2353 Fix #114152: Blender crashes when loading files with unknown IDProperty types.
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
2023-11-02 14:33:04 +01:00
Jeroen Bakker
d4262071b1 Fix #114224: Bones Disappear In Pose/Edit Mode
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
2023-11-02 13:36:44 +01:00
Lukas Tönne
578d91b9db Fix #113919: Avoid crashes with unsupported new socket types
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
2023-11-02 12:55:37 +01:00
Hans Goudey
0f9dcafa76 Fix #112973: Node tools: Incorrect redo behavior in sculpt mode
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.
2023-11-02 09:38:36 +01:00
Campbell Barton
0372bb44f7 Cleanup: format 2023-11-02 16:33:28 +11:00
Lukas Stockner
0b81a163e2 Cycles: Fix Principled BSDF versioning for keyframes and drivers
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
2023-11-01 19:27:51 +01:00
Richard Antalik
01b617a3c6 VSE: remove speed_factor RNA property from sound strips
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
2023-11-01 13:17:06 +01:00
Hans Goudey
d503f2ac33 Fix #114177: Crash in extrude mesh vertex mode with unsupported data
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.
2023-11-01 11:08:35 +01:00
Hans Goudey
66c1ca7419 Fix #114102: Node tool data-block inputs broken
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
2023-11-01 10:53:40 +01:00
Omar Emara
cbcfca0a19 Fix #112716: Custom sockets ignore draw_color method
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
2023-11-01 09:29:56 +01:00
Ray Molenkamp
f6c52849b5 Fix #112729: Update pinned blender shortcut
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
2023-11-01 01:44:51 +01:00
Andrej730
977c62c708 Docs: remove dpi from blf.size doc as it's deprecated
DPI argument of blf.size is deprecated, remove it from docs.

Ref !114319.
2023-11-01 11:37:16 +11:00
Hoshinova
92c9a2d1bc Nodes: Add forward compatibility for merged Noise/Musgrave Texture
Add versioning to convert the new combined Noise Texture node from #111187.
Versioning is only done for the Musgrave exclusive noise modes, that is all modes
except for fBM.

Pull Request: https://projects.blender.org/blender/blender/pulls/114236
2023-10-31 19:57:57 +01:00
Hans Goudey
d6be6339f1 Fix: Incorrect PBVH mask drawing after recent change
The `COMPONENT_LEN_SCALAR` workaround isn't used for
masks which are drawn in a more hard-coded way.
2023-10-31 18:17:26 +01:00
Hans Goudey
e05c36f56d Fix #113496: PBVH draw crashes and unsupported attribute types
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
2023-10-31 17:33:15 +01:00
Hans Goudey
2893dc8ab7 Fix: Broken node tool group data-block references
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
2023-10-31 17:16:48 +01:00
Jason Fielder
a96aabc6f6 Metal: Resolve premature memory release
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
2023-10-31 16:45:12 +01:00
Nathan Vegdahl
5974a4482a Fix #109430: exit tweak mode before deleting an in-tweak-mode NLA strip
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
2023-10-31 16:06:38 +01:00
Jason Fielder
dde346ca9f FIx #114286: Resolve ghosting artifact in workbench in Metal
Missing GPU flush added between workbench render frames
to ensure GPU command buffer does not submit all frames
in one go.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/114328
2023-10-31 15:53:32 +01:00
Jeroen Bakker
3da63377fc Fix #114224: Bone Disappear in Pose Mode
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
2023-10-31 15:40:28 +01:00
Julian Eisel
4f0258f549 Fix #113687: Asset shelf header overlaps labels without region overlap
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.
2023-10-31 15:26:09 +01:00
Julian Eisel
af363a6ba2 Fix asset shelf can't resized by dragging header edge anymore
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.
2023-10-31 14:59:45 +01:00
Christoph Lendenfeld
fef222efc3 Fix: NLA mapping not taken into account when framing FCurves
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
2023-10-31 14:52:45 +01:00
Michael Kowalski
1e7f5b1e61 USD: fix cache reader open error handling.
This commit fixes error handling logic implemented in #113524.

- No longer calling WM_reportf, which is not thread safe.
- Freeing the reader before returning early.

Pull Request: https://projects.blender.org/blender/blender/pulls/114298
2023-10-31 14:50:47 +01:00
Jacques Lucke
c29857fffa Fix #113532: geometry nodes is always reevaluated after undo
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
2023-10-31 13:46:31 +01:00
Jacques Lucke
245da40f81 Fix #114251: Angle input of Compare node disconnected on reload
The issue was that `Angle` also starts with an `A`, just like the input
that is supposed to be handled by this compatibility code.
2023-10-31 13:44:09 +01:00
Pablo Vazquez
86ccbc4353 Fix #113683: Wrong colors in UIList items after importing 3.6 theme
Theme changes for active/hover elements in 4.0 were missing versioning.
2023-10-31 13:07:54 +01:00
Bastien Montagne
46c180015a Fix #114134: Make Local (All) operator is crashing Blender with Library Override.
Dummy mistake in own a238ab737b, forgot to do a NULL check...
2023-10-31 11:56:18 +01:00
Campbell Barton
ab41558186 Fix #113881: Sculpt Curves: R shortcut conflict
The "Curves" key-map poll function now only works in edit-mode.

Ref !114297.
2023-10-31 21:48:30 +11:00
Julian Eisel
7c739ad560 Fix #114287: Drawing in post-view draw handlers broken
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
2023-10-31 11:41:47 +01:00
Campbell Barton
ea86a77bc5 Docs: add notes on populating bpy.app.driver_namespace
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`).
2023-10-31 21:34:32 +11:00
Campbell Barton
4bec9d0d71 Fix #114282: Extrude to Cursor tool no longer tweaks on drag
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
2023-10-31 14:55:12 +11:00
Alaska
a15f9e49ec Shader: Only clamp undefined or unsupported inputs of Principled BSDF
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
2023-10-31 03:14:04 +01:00
Brecht Van Lommel
39107b3133 Revert changes from main commits that were merged into blender-v4.0-release
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.
2023-10-30 21:40:35 +01:00
Clément Foucault
b26f176d1a Fix #114096: Workbench: Broken thumbnail shadows on Mac
This is the same as 5d06632565
but ported to the no-geometry shader version.

However the rendering is still broken for another reason.
See #114286.
2023-10-30 19:46:09 +01:00
Julian Eisel
2e1244f3cf Fix resizing asset shelf header edge not working without region overlap
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.
2023-10-30 18:19:08 +01:00
Brecht Van Lommel
10645237e8 Cycles: change default Principled Hair BSDF back to Chiang
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.
2023-10-30 18:08:34 +01:00
Julian Eisel
4a89720fe1 Fix asset shelf not hidden for new 3D Views
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.
2023-10-30 18:02:51 +01:00
Omar Emara
56ffa441b9 Cleanup: Use input reading shaders for Movie Clip node 2023-10-30 17:33:10 +02:00
Omar Emara
f79b3ffe12 Cleanup: Generalise input reading in compositor
This patch generalises the pass reading shaders into input reading
shaders. This is done make future development easier.
2023-10-30 17:27:07 +02:00
Jeroen Bakker
5ba661b706 EEVEE-Next: Fix Infinite Loop With Reflection Probe
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
2023-10-30 16:00:17 +01:00
Jeroen Bakker
fcb26fe72d EEVEE: Update UI Names
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
2023-10-30 15:04:13 +01:00
Jeroen Bakker
f35b0373d6 Vulkan: Separate DataTransfer, Compute, Graphics Commands
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
2023-10-30 14:21:14 +01:00