Commit Graph

113810 Commits

Author SHA1 Message Date
Jesse Yurkovich
daddd56be1 Merge branch 'blender-v4.3-release' 2024-10-07 09:14:09 -07:00
Sybren A. Stüvel
0a74768a98 Anim: when inserting a key on a slotted Action, correctly remap via NLA
When inserting a key on a slotted Action, apply NLA remapping on both
the key's time and value.

This pushes the fork in the code (between legacy & new Actions) a bit
further down the call stack.

Ref: #120406

Pull Request: https://projects.blender.org/blender/blender/pulls/128700
2024-10-07 18:09:42 +02:00
Jesse Yurkovich
1676c06386 Fix #128504: check instancer purpose and visibility before processing
During stage load we first look for Prototype prims which are used for
instancing. However, if the instancer itself at the root of that
Prototype hierarchy would later be excluded because of either purpose or
visibility checks, the Prototypes would still be processed. These would
correctly be imported but would end up orphaned because nothing would
later add them to the view layer. Code expecting these objects to be
found within the scene would then fail.

In Animal Logic ALab this situation played out where there was a
`/root/instancer` prim with purpose "render" and we proceeded to load
the prims under the `/root/instancer/Prototypes/...` hierarchy. Since we
were attempting to load just the "proxy" purpose, the `/root/instancer`
was later excluded and the orphaning of those prototypes happened.

The change here moves `collect_point_instancer_proto_paths` to a method
of `USDStageReader` so it can now access `include_by_purpose` and
`include_by_visibility`. And these are now used to prevent unnecessary
Prototype loading.

Pull Request: https://projects.blender.org/blender/blender/pulls/128564
2024-10-07 18:08:22 +02:00
Omar Emara
0141c84b0d Merge branch 'blender-v4.3-release' 2024-10-07 18:49:01 +03:00
Omar Emara
0a70360eb6 Fix: Blender crashes opening a file with compositor
Blender crashes when opening a file that has an interactive compositor
active, while also having a script that invokes the compositor upon file
load.

This is caused by the same system GPU context being active in two
threads at the same time, which happens when the GPU context for the
compositor is created in the main thread, it is made current during
creation, but it is not reset to the main GPU context of the drawable
because it is null. So when the GPU compositor actually executes, it
makes the GPU context current again but in its own thread, causing a
BadAccess error in X11 and potentially other window systems.

The reason why the drawable is nullptr is because it is reset in the
existing window manager when opening a new file while Blender is open,
but it is never initialized for the new window manager. The drawable
info should be moved from the old window manager to the new window
manager in wm_file_read_setup_wm_use_new, but it is preemptively reset
by the wm_window_clear_drawable call before it it is moved. This is done
in wm_file_read_setup_wm_substitute_old_window.

So to fix this, we move wm_window_clear_drawable after the code block
where wm_file_read_setup_wm_substitute_old_window gets called.
2024-10-07 18:34:54 +03:00
Nathan Vegdahl
75819f991d Anim: update collada import code for slotted actions
Follow-up to #128061, which addressed the export side of this.

This updates the Collada import code to import properly to slotted
actions.

Note that importing the animation of non-transform properties (e.g.
camera fov, material colors, lamp intensity, etc) does not work,
but that isn't caused by this PR.  That was already not working at
least as far back as Blender 3.6.5.

Pull Request: https://projects.blender.org/blender/blender/pulls/128529
2024-10-07 16:49:54 +02:00
Sybren A. Stüvel
66f1e3a223 Anim: support 'Stash to NLA' on slotted Actions
Ref: #120406
Pull Request: https://projects.blender.org/blender/blender/pulls/128696
2024-10-07 16:42:06 +02:00
Sybren A. Stüvel
7c281ad13d Cleanup: Anim, reorder action assignment function declarations
Reorder the Action and Slot assignment function declarations, so that
they are grouped a bit more sensibly.

Of the touched functions, I also replaced `ATTR_WARN_UNUSED_RESULT` with
`[[nodiscard]]`.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/128695
2024-10-07 16:41:21 +02:00
Iliya Katueshenock
26bce79b10 Cleanup: unused variable
Pull Request: https://projects.blender.org/blender/blender/pulls/128662
2024-10-07 16:38:13 +02:00
Clément Foucault
f877f705c6 Revert "DRW: Rename draw_debug_info.hh to avoid conflict with main branch"
This reverts commit 301c853b9c.
2024-10-07 16:19:55 +02:00
Clément Foucault
0ab5b400b3 Merge branch 'blender-v4.3-release' 2024-10-07 16:17:28 +02:00
Nathan Vegdahl
91984fad1b Anim: make pose library pose blending work with slotted actions
This wasn't working because the code that stores the backup up the current pose
looped over the pose asset's fcurve listbase to determine which bones needed to
be backed up. When the pose asset was stored as a slotted action, that listbase
was always empty, so nothing was backed up. This resulted in exploding poses as
the pose was repeatedly applied on top of itself, and in debug builds would
trigger asserts in code that was sanity-checking quaternion values.

This PR updates that code to loop over the fcurves of the first slot when the
pose asset is stored as a slotted action, which in turn makes pose blending
work as expected with slotted actions.

Pull Request: https://projects.blender.org/blender/blender/pulls/128686
2024-10-07 16:13:56 +02:00
Clément Foucault
301c853b9c DRW: Rename draw_debug_info.hh to avoid conflict with main branch
Between 0bfd5e3536
and b1cbd9c889
the main branch is incorrectly processing the file
`draw_debug_info.hh` as GLSL and does some string
preprocessing on it. But the output filename matches
the name of the header source file used for compiling
the gpu module. This file not having been updated
since a long time doesn't get copied from the source
folder when switching to other branch and make compilation
fail.

In order to avoid breaking the buildbot longer, we
rename the incriminating file to force recreate it
when building the release branch.
2024-10-07 16:11:09 +02:00
Clément Foucault
597388a65e Fix: GPU: GLSL-C++ stubs GPU_SHADER_INTERFACE_INFO macro error
The macro should take only one parameter.
2024-10-07 15:55:29 +02:00
Jacques Lucke
652a336079 Merge branch 'blender-v4.3-release' 2024-10-07 14:11:03 +02:00
Jacques Lucke
9fc0d50846 Cleanup: encapsulate check for whether attribute is built-in 2024-10-07 14:10:38 +02:00
Pratik Borhade
6c5f9ea502 Merge branch 'blender-v4.3-release' 2024-10-07 17:28:31 +05:30
Pratik Borhade
772bb795d2 Fix #124753: Tag preferences dirty when editing operator property
When operator property is tweaked in preferences > keymap > "any operator",
preferences are not tagged dirty, which prevents writing the userpref
file at `WM_exit_ex` when auto-save is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/128516
2024-10-07 13:56:46 +02:00
Jacques Lucke
e0e8a87453 Merge branch 'blender-v4.3-release' 2024-10-07 13:32:46 +02:00
Jacques Lucke
5fa8b5b601 Fix #127170: crash when openvdb throws exception in Volume to Mesh node
This catches the exception and shows the error message to the user.
We don't have much control over the error message here currently. Better just
report it for now. In the future we could try to detect what error it is exactly
and produce a more user friendly error.
2024-10-07 13:32:01 +02:00
Nathan Vegdahl
f37215d583 Anim: make remaining sequencer features work with slotted actions
This is a follow-up to #128363, and fixes up the remaining areas of
the sequencer's code that didn't yet account for slotted actions:

1. Moving strips failed to move their animation with them.
2. Duplicating strips failed to duplicate their animation with them.
3. Deleting strips didn't delete their animation channels with them.

This also takes the opportunity to add depsgraph tagging and
notifiers that were already missing in the pre-slotted-actions
code, for the strip delete and strip paste operators. The absence
of these was making the UI not update and was also causing stale
animation data to get evaluated.

Pull Request: https://projects.blender.org/blender/blender/pulls/128440
2024-10-07 13:31:14 +02:00
Jacques Lucke
67c7485bfd Refactor: Geometry Nodes: improve lifetime analysis for anonymous attributes
This refactors the lifetime analysis of anonymous attributes in geometry nodes.
The refactor has a couple of goals:
* Use a better and simpler abstraction that can be used when building the
  lazy-function graph. We currently have a bunch of duplicate code to handle
  "field source" and "caller propagation" attributes. This is now unified so
  that one only has to worry about one kind of "reference sets".
* Make the abstraction compatible with handling bundles and closures in case we
  want to support them in the future. Both types can contain geometries and
  fields so they need to be taken into account when determining lifetimes.
* Make more parts independent of the concept of "anonymous attributes". In
  theory, there could be more kinds of referenced data whose lifetimes need to
  be managed. I don't have any concrete plans for adding any though.

At its core, deterministic anonymous attributes still work the same they have
been since they became deterministic [0]. Even the generated lazy-function graph
is still pretty much or even exactly the same as before.

The patch renames `AnonymousAttributeSet` to the more general
`GeometryNodesReferenceSet` which is more. This also makes more places
independent of the concept of anonymous attributes. Functionally, this still the
same though. It's only used in the internals of geometry nodes nowadays. Most
code just gets an `AttributeFilter` that is based on it.

[0]: https://archive.blender.org/developer/D16858

Pull Request: https://projects.blender.org/blender/blender/pulls/128667
2024-10-07 12:59:39 +02:00
Clément Foucault
9c0321ae9b Metal: Simplify MSL translation
Move most of the string preprocessing used for MSL
compatibility to `glsl_preprocess`.

Enforce some changes like matrix constructor and
array constructor to the GLSL codebase. This is
for C++ compatibility.

Additionally reduce the amount of code duplication
inside the compatibility code.

Pull Request: https://projects.blender.org/blender/blender/pulls/128634
2024-10-07 12:54:10 +02:00
Jacques Lucke
9e604f0e00 Merge branch 'blender-v4.3-release' 2024-10-07 12:45:10 +02:00
Jacques Lucke
218af9b2cc Fix: missing anonymous attribute relations for foreach zone 2024-10-07 12:44:21 +02:00
Clément Foucault
b1cbd9c889 Fix: Build error caused by GLSL processor overriding valid header source
The issue was that the GLSL processor was incorrectly
processing an info.hh file which was also supposed to be
included inside the gpu module. The generated source
was creating build error.
2024-10-07 12:35:47 +02:00
Clément Foucault
754920a92d Cleanup: DRW: Missing include
This Shader lib is unused anyway.
2024-10-07 12:35:47 +02:00
Clément Foucault
42e8cbb921 GPU: Make use of the C++ stubs in some shaders 2024-10-07 12:35:47 +02:00
Clément Foucault
fd47edfb86 GPU: GLSL C++ Stubs: Use create_info namespace to avoid symbol colision 2024-10-07 12:35:47 +02:00
Clément Foucault
5fe608da4b Fix: Overlay: Wrong end macro for named interface 2024-10-07 12:35:47 +02:00
Miguel Pozo
9395ccc6bf Merge branch 'blender-v4.3-release' 2024-10-07 12:14:06 +02:00
Miguel Pozo
88289e8bac Fix #126562: Cycles/EEVEE versioning
Check all scenes to decide between versioning merged settings using
EEVEE or Cycles properties.

Still far from a great solution. :(

Pull Request: https://projects.blender.org/blender/blender/pulls/128554
2024-10-07 12:12:37 +02:00
Sybren A. Stüvel
a97fe64c4f Anim: fix Action slot idtype endianness switching
`ActionSlot::idtype` needs some extra care when reading from a blend
file. Blender's generic endian switching needs to be un-done, as the
ID type values are not numerically the same between little and big
endian machines. Due to the way they are defined, they are always in
the same byte order, regardless of hardware/platform endianness.

This is the same for Action Slots as #128129 does for Actions, except
that Action Slots use a `int16_t` instead of `short` and thus don't
need a cast.

Pull Request: https://projects.blender.org/blender/blender/pulls/128438
2024-10-07 10:45:11 +02:00
YimingWu
eec84d16ed Overlay-Next: Check active_base for GPv3 sync
`state.active_base` could be null when checking `active_base->object`,
thus guarding this from happening.
2024-10-07 14:22:20 +08:00
Campbell Barton
98002ce4ad Cleanup: minor simplification to file-selector directory expansion
Instead of setting the directory empty so it's initialized to the root,
use a variable which can be set when there are problems expanding the
path. This is then checked once at the end.

Also avoid inlining platform specific root directory access.
2024-10-07 13:11:51 +11:00
Campbell Barton
c1f18be1ba Merge branch 'blender-v4.3-release' 2024-10-07 13:05:28 +11:00
Campbell Barton
9cda82f3f9 Merge branch 'blender-v4.3-release' 2024-10-07 13:05:24 +11:00
Campbell Barton
f36b303a75 Merge branch 'blender-v4.3-release' 2024-10-07 13:04:26 +11:00
Campbell Barton
a5f121149d Merge branch 'blender-v4.3-release' 2024-10-07 13:02:31 +11:00
Campbell Barton
6039cb17e6 Unix: use getpwuid() to access home when the variable/tilde expand fails
This was already done in GHOST, but not BKE_appdir_folder_home.

Also null check the return value from getpwuid() as it's not
guaranteed to be non-null.
2024-10-07 13:00:56 +11:00
Campbell Barton
1e9206238e Fix crash if expanding the fonts directory fails
Add missing null check for BLI_expand_tilde.
2024-10-07 13:00:53 +11:00
Campbell Barton
ff9d9711d7 Fix crash using "~" in the file selector when the "home" is null 2024-10-07 13:00:52 +11:00
Campbell Barton
e0f036f8f3 Fix inconsistency between *BKE_appdir_folder_{home/default} on macOS
Change from [0] introduced BLI_expand_tilde but missed the change
for BKE_appdir_folder_default.

[0]: 9df13fba69
2024-10-07 12:58:39 +11:00
Jason C. Wenger
262d32b694 Cleanup: improve comments & add error checking asserts
Ref !128610
2024-10-07 12:52:34 +11:00
Campbell Barton
61ea50e9c8 UI: don't resolve // in the file selector for unsaved blend files
Using `//` for unsaved files isn't meaningful, instead of replacing
with a "default" directory, clear the input to avoid confusing
users as to the meaning of the prefix.
2024-10-07 12:21:01 +11:00
Campbell Barton
6df7656fca Cleanup: remove redundant call to BLI_path_abs, reduce variable scope 2024-10-07 12:21:01 +11:00
Campbell Barton
16b839dd5f Docs: expand comments for file selector logic
Some of the assumptions made here weren't so clear,
update comments for clarity.
2024-10-07 12:21:01 +11:00
Campbell Barton
13fdf34e57 Cleanup: early return from file-selector handlers
Also pass arguments Main & FileSelectParams to file_expand_directory
instead of the context as this is a lower level function thats
only ever called when these values are known & doesn't run
the appropriate refresh functions needed to be called on it's own.
2024-10-07 12:21:01 +11:00
Germano Cavalcante
6d5d3ce975 Transform: Simplify and specialize the handling of events
The `transformEvent` function is becoming increasingly complex due to
the inclusion of operation-specific code.

To improve this, remove the `handled` boolean and allow each
`TransModeInfo::handle_event_fn` to determine how to handle already
processed events.

Additionally, move some operation-specific logic to the operators file.

Note:
The `handled` boolean was added in aef307cf31 to fix a bug with the
custom events of the Edge and Vertex Slide operators;
2024-10-05 22:11:07 +02:00
Germano Cavalcante
e82ce39e17 Fix: Snap Toggle not updating snap status after a transform operation
Unlike Snap Invert, Snap Toggle (Shift + Tab) saves the snap status in
ToolSettings.

This is a regression from v3.6
2024-10-05 14:20:29 -03:00