Commit Graph

107080 Commits

Author SHA1 Message Date
Hoshinova
bbb14b95bb Fix: Crash when creating Noise Texture node with link-drag-search
Fix crash when creating a Noise Texture through dragging and releasing
another output and connecting it to the "Gain" or "Offset" sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/119097
2024-03-06 15:42:22 +01:00
Bastien Montagne
bb00621965 Fix recent regression preventing animation on any linked data.
Regression in 427eed292d.

Root of the issue was that animation system was using a single same
check to decide if an F-Curve/driver was valid to use to animate some
data, and whether user can create/edit animation for that data.

Both cases are actually different, since e.g. linked data is not
user-editable, but it can still be animated (either by related linked
Actions, drivers defined in the linked data, or some more hackish
changes like py API/RNA scripting).

This commit now defines two checks:
 * `RNA_property_animateable`: whether a RNA pointer & propoerty is
   animateable, based on their types and definition.
 * `RNA_property_anim_editable`: whether a specific data referenced by
   the RNA pointer and property is effectively user-editable.

The new `driveable` check added by 427eed292d is also renamed to
`RNA_property_driver_editable` (since the basic type-based
`RNA_property_animateable` is also valid for drivers currently).

Pull Request: https://projects.blender.org/blender/blender/pulls/119089
2024-03-06 10:02:53 +01:00
Omar Emara
bfec649bd9 Fix #119043: Compositor crashes with intricate setup
The Realtime Compositor crashes with intricate node setups. That's
due to hardware limitations where shaders can't have as many output
images as needed by the compositor shader operations. To fix this, we
recursively split shader operations until their output count fits the
hardware limitation.

Pull Request: https://projects.blender.org/blender/blender/pulls/119075
2024-03-06 07:25:05 +01:00
Harley Acheson
49c723e117 Fix #118765: Show Startup Popup Warning on Main Window
During startup, popup block warnings should be displayed on the main
window, not a child window even if it is active.

Pull Request: https://projects.blender.org/blender/blender/pulls/119096
2024-03-05 21:16:35 +01:00
Hans Goudey
90fb838416 Fix: Geometry Nodes Sort Elements node crash with nested instances
Typically nodes that edit instances only change the top level of
instances. As an oversight, that wasn't done in the sort elements node.
This causes problems as the top level of instances are reordered and
nested instances are edited. As the top-level is replaced, its
contained geometry sets (the nested instances) are deleted.

To fix, only reoder the top-level instances in this node.
2024-03-05 14:18:29 -05:00
Hans Goudey
6181341bad Fix #119091: Incorrect path for WM context RNA property
Mistake in 61fb2b17c8
2024-03-05 11:57:22 -05:00
Hans Goudey
7b94e61f09 Fix #119047: Avoid copying captured attribute to itself
The "capture field on geometry" utility is used in many places to store
the result of field evaluation as an attribute. There is a special case
for when an attribute already exists with the same name, data type, and
domain. But when exactly the same attribute was stored, it would assert
because it ended up copying an array to itself. Arguments for those copy
functions aren't supposed to alias each other.

As a fix, clarify the logic a bit to return earlier in this case.
Also remove a redundant case handling the same thing later on
in the function.

Pull Request: https://projects.blender.org/blender/blender/pulls/119063
2024-03-05 17:32:09 +01:00
Sean Kim
4d8dad056c Fix #119070: Fix crash in sculpt menu lasso tool
This PR adds an extra check to exit from sculpt gesture code early to
avoid attempting to allocate a 3 * (UINT_MAX - 1) amount of elements
inside the trim gesture code.

Pull Request: https://projects.blender.org/blender/blender/pulls/119073
2024-03-05 15:50:40 +01:00
Philipp Oeser
8c3b85d666 Fix #84848: Specific Rig Crashes blender when going into pose mode
The armature reported had two bones with a `bMotionPath` but its lengths
are zero (which causes trouble in `motion_path_cache` drawing code due
to 0 allocations).

Not exactly sure how we got there, something like
`animviz_verify_motionpaths` should take care of this already in current
code, but this might be from a time where there were not enough sanity
checks.

So now early out in `motion_path_cache` if we encounter such a
"corrupted" motion path.

Pull Request: https://projects.blender.org/blender/blender/pulls/119081
2024-03-05 13:15:18 +01:00
Philipp Oeser
959595069d Fix #95411: Collada export crashes if temporary file is not accessible
This can happen e.g. when relative "//" is in Preferences > File Paths >
Temporary Files is used.

Now catch the corresponding COLLADASW::StreamWriterException
and cancel export then.

NOTE: 51126fab33 might have prevented the most common case
to run into this crash (but there might be other cases still so being safe
here does not hurt)

Pull Request: https://projects.blender.org/blender/blender/pulls/118958
2024-03-05 13:14:45 +01:00
Bastien Montagne
1906ee76ba Fix (studio-reported) IDproperties of liboverrides not being animatable.
Regression from 427eed292d, in IDProperty case the 'ensured' PropertyRNA
pointer is some sort of empty template, and cannot be used for many
things.

Instead of calling `rna_ensure_property` twice for each call to
`RNA_property_animateable`, rather add an optional parameter to static
helper `rna_property_editable_do`, and call it directly from
`RNA_property_animateable`.
2024-03-05 11:53:06 +01:00
Bastien Montagne
6adf5adb7f Fix LibOverride asserting when same RNA path changes type.
Although rare (and not recommended!), it can happen that a same exact
RNA path points to a different type of data.

This can come from an update of the code itself, but this is very
unlikely and discouraged.

However, geometry nodes and their 'modifiers' interface have made it way
more easy to create such conflicting situation, since users are free to
re-arrange and edit the nodes and their 'public' interface as they
want...

Found out while investigating some unrelated issues in some studio Gold
production files (namely,
`pro/shots/090_joining_whale/090_0130/090_0130-anim.blend` r2110
exhibits such issue for `OBGEO-mika-body`
`modifiers["RIG-GN-mask-clothing"]["Socket_3"]`, where the RNA type
changes from integer to bool).
2024-03-05 10:03:44 +01:00
Campbell Barton
8842982dbd Docs: note the temporary directory will be ignored unless it exists
Other minor changes:

- Remove reference to `TMP` environment variable in the `--help` text
  as this isn't a posix standard and is noted as something that may be
  removed in the future.
- Show WIN32 `TEMP` when showing all help text so it will be included
  in the user manual.
2024-03-05 10:19:16 +11:00
Iliya Katueshenock
fa229c5753 Fix #119019: Geometry Nodes: Split to Instances wrong field interface
Input fields should propagated on input geometry.

Pull Request: https://projects.blender.org/blender/blender/pulls/119032
2024-03-04 16:57:28 +01:00
Sebastian Parborg
a8cc2e4d96 Fix: Add missing iostream include
Without this include compilation would sometimes fail
2024-03-04 16:50:47 +01:00
Raul Fernandez
3c6a9cb5a5 Fix #117824: Sculpt color filter crash
Fix for Sculpt: Color Filter crash #117824

This change fixes the crash due to invalid active color layer
in the Undo/Redo stack when redoing from the original state.

Previously when performing a redo to a filter color state from the
original state, it cased a crash because
&((SculptUndoStep *)us_iter)->active_color_start did not contain valid
color data in the original state.
In this PR we check if is the original state and use the
&((SculptUndoStep *)us_iter)->active_color_end instead which is
de correct data to use.

- [x] Fix color update  when redo from initial state

Pull Request: https://projects.blender.org/blender/blender/pulls/118885
2024-03-04 16:31:52 +01:00
Bastien Montagne
afb5cb440b Fix/tweak UI messages (typos etc.). 2024-03-04 11:17:55 +01:00
Campbell Barton
51126fab33 BLI_tempfile: ensure the temporary directory is absolute
While unreported, there is nothing preventing CWD relative temporary
directories being used. Resolve asserts & errors if the CWD changes at
run-time.
2024-03-04 12:20:44 +11:00
Guillermo Venegas
8f68dfe0c2 Fix #119000: File handler extension check should be case insensitive
Allows case insensitive extension match.

Pull Request: https://projects.blender.org/blender/blender/pulls/119018
2024-03-03 22:50:51 +01:00
Pratik Borhade
5f70bd0e46 Fix #116435: Rotate Vector node on a link connects wrong sockets
`sock_rotation` has higher priority (6) than the vector socket (4).
Hence inserting node between vector-vector link joins thorugh "rotation"
socket (`get_main_socket()` / `get_main_socket_priority()`).
This can be fixed by making "vector" input socket as default for link.

But this will break the link creation when node is inserted between
rotation-rotation link. It seems rotation is converted to vectors so
perhaps make sense to make "vector" as default socket for link.

Pull Request: https://projects.blender.org/blender/blender/pulls/116550
2024-03-03 00:38:34 +01:00
Jacques Lucke
cce2b6671e Fix #114110: background dots clipping in node editor
The clipping was introduced because it looked a bit like the dots are
above the scrollbar. However, the clipping looks worse and the dots
are actually below the scrollbar. If we don't want stuff to be visible
through the scrollbar, it should be more opaque.
2024-03-03 00:34:16 +01:00
Jacques Lucke
e72bf54791 Fix #118926: missing transform relation when using Object/Collection Info node
This was probably accidentally broken when we moved the rna code into node files.

Pull Request: https://projects.blender.org/blender/blender/pulls/119017
2024-03-02 23:59:48 +01:00
Jacques Lucke
65083472ec Fix: issue in previous commit
Many tests started failing after 173c41c1c0
due to memory leaks.
2024-03-02 23:56:37 +01:00
Jacques Lucke
173c41c1c0 Fix #114946: Mesh.clear_geometry should not clear required built-in attributes
Pull Request: https://projects.blender.org/blender/blender/pulls/119012
2024-03-02 21:40:03 +01:00
Jacques Lucke
cc891aa699 Fix #115583: multiple sharing info for same data after reading file
It's possible that multiple custom data layers share the same underlying data.
This data is only written once (per data-block) currently. However, when reading
the data again, two separate `ImplicitSharingInfo` were constructed which
referenced the same underlying memory. The fix is to reuse previously created
`ImplicitSharingInfo` that manage the same data.

Pull Request: https://projects.blender.org/blender/blender/pulls/118991
2024-03-02 20:10:34 +01:00
Richard Antalik
58a9acb016 Fix #118486: Prevent emitting error when adding VSE strips
When adding strips that generate image on their own, while 3 or more
strips are selected, it emits error. This was caused by incorrect
handling of this case in `seq_effect_find_selected()`. If effect has no
inputs, function should return early.

Pull Request: https://projects.blender.org/blender/blender/pulls/118866
2024-03-02 18:34:00 +01:00
Bastien Montagne
da101d8cdb Fix #118300: Broken liboverride data can crash Blender on load.
Second issue reported in the comment was caused by some shapekeys
flagged as embedded liboverride data, when their owner ID (Mesh e.g.)
is not a liboverride at all.

The `BKE_lib_override_library_validate` called on file read was only
covering real liboverride IDs, which where then supposed to take care of
their own embedded data. But since the owner ID is already a full
non-override ID, its embedded data ended up never being properly
sanitized.

Most likely more corruption data from quite old files and/or deprecated
experimental features.
2024-03-02 16:17:41 +01:00
Jacques Lucke
4a81fe8180 Fix #115755: rename enum from type to rotation_type to resolve name collision
`type` is a built-in property already.

Pull Request: https://projects.blender.org/blender/blender/pulls/118990
2024-03-01 23:57:33 +01:00
Hans Goudey
beb92830f9 Geometry Nodes: Add node tools warning when shape keys are removed
For various reasons, node tools don't support some data. Shape keys aren't
supported because their format is entirely different for evaluated and
original data-blocks, and node tools currently work in the "evaluated"
world. Though that would be nice to change, in the meantime users
should at least be warned when this happens.

This PR adds a simple "Mesh shape key data removed" operator warning.

See #113662

Pull Request: https://projects.blender.org/blender/blender/pulls/118986
2024-03-01 22:45:04 +01:00
Jacques Lucke
8f36281787 Nodes: expose ordering of links in multi input socket in Python
This fixes #116096 and is based on #115249 with some changes.

This patch contains three changes:
* `NodeSocket.links` in the Python API gives the links in the correct order.
* `NodeLink.multi_input_sort_id` gives read-only access to an id that's used
  for sorting. Note that for historical reasons the highest id is the first link.
* `NodeLink.swap_multi_input_sort_id(other_link)` provides a safe way to
  change the order of links connected to a multi-input socket.

Co-authored-by: Adrian Bibby Walther <adrianbibbywalther@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/118987
2024-03-01 22:36:10 +01:00
Jesse Yurkovich
1597e9386f Fix #118602: Build depsgraph on main thread for Alembic
Building the depsgraph from a worker thread is unsafe currently, as it
may trigger some deferred processing on the Main data itself.

Mimic what was already done for USD (from `5cf3654d9d`) and build the
graph before launching `export_startjob`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118974
2024-03-01 22:14:12 +01:00
Sean Kim
c60d793bbf Fix #103013: Add default cavity curve
This PR initializes all brushes with the default automasking cavity
curve when a `startup.blend` file is loaded. Because there exists a
series of brushes that are added if they are not found in the
`startup.blend` file (e.g. "Paint") **after** the file is already
loaded, the existing fallback code to handle `nullptr` in the loader
code does not run.

Pull Request: https://projects.blender.org/blender/blender/pulls/118943
2024-03-01 22:06:35 +01:00
Pratik Borhade
5f7b5a922d Fix: Restrict recurse select when over icon during extend-range selection
Recurse selection was not restricted to "mouse over icon" during range
selection (i.e. if we shift- double click on any area of tree element,
resurse select is still executed, which is wrong)

Also did a bit cleanup to use existing `is_over_icon` instead of calling
`outliner_item_is_co_over_icon` multiple times

Pull Request: https://projects.blender.org/blender/blender/pulls/118556
2024-03-01 19:14:45 +01:00
Bastien Montagne
427eed292d Fix #117970: Fix RNA checks for animatable properties, add a check for drivable ones.
The `RNA_property_animateable` would check for some conditions, where it
is not valid to add or edit animations (e.g. if using a linked Action
ID...).

Add a new `RNA_property_drivable`, which is essentially a call to
`RNA_property_animateable` with extra checks in liboverride cases, as
drivers are stored directly in the AnimData struct, instead of their own
dedicated ID.

Pull Request: https://projects.blender.org/blender/blender/pulls/118809
2024-03-01 18:19:38 +01:00
Philipp Oeser
f880cbce93 Fix #102860: crash importing a certain dae (collada) file
There seems to not be a strict rule to only have armatures as parents to
single bones, apparently collada files can also be set up to have mesh
parents for bones. As a consequence, the collada importer
`joint_parent_map` is not safe to fetch objects from and assume their
data can be cast to `bArmature`.

Ultimately, the `joint_parent_map` needs to be looked at again, this
patch just avoids a crash in this scenario (so no such joints will be
iported). Still better than crashing I guess.

Pull Request: https://projects.blender.org/blender/blender/pulls/118751
2024-03-01 16:31:33 +01:00
Bastien Montagne
71df742eb4 Fix #117795: Add a validation pass on embedded liboverrides.
One of the consequences of the mistake in 3fcf535d2e (fixed in previous
commit), was that the more recent `LIB_EMBEDDED_DATA_LIB_OVERRIDE` ID
flag could be wrongly set in some nodetrees from pre-2.76 blendfiles.

This commit adds a check that embedded IDs flagged with
`LIB_EMBEDDED_DATA_LIB_OVERRIDE` are actually embedded IDs of a
liboverride.

Pull Request: https://projects.blender.org/blender/blender/pulls/118921
2024-03-01 11:28:38 +01:00
Bastien Montagne
05af72fc2e Fix #117795: Refactor code from 9 years ago forgot to cleanup flags of embedded IDs.
In 3fcf535d2e, the `ID.flag` data was split, keeping persisten flags in
`ID.flag`, and moving runtime ones into a new `ID.tag` data.

Some versionning code was then added to cleanup the existing `ID.flag`
on file read, but embedded IDs (root node trees only, back then) are not
stored in Main data-base, and were skipped.

Note that this fixes the conversion of older (2.76.4 and older) files.
There is no reliable way to cleanup files opened and saved from more
recent versions of Blender unfortunately.
2024-03-01 10:45:30 +01:00
Campbell Barton
65f5e8b775 Cleanup: undefined defined variable warnings with CMake 2024-03-01 16:22:06 +11:00
Germano Cavalcante
3d6bb6ce04 Fix #118906: conflict with alt hotkey in Vert and Edge Slide operators
This 'alt' hotkey is captured in the modal map
`TFM_MODAL_PASSTHROUGH_NAVIGATE` in order to appear in the header.
But this modal map is not necessary.
2024-02-29 20:50:09 -03:00
Campbell Barton
72688791dc Fix #98491: Crashes with node view operators running without a region
Add poll functions that check for an active region when running
operators that require a region.
2024-03-01 10:19:35 +11:00
Campbell Barton
a8892c7264 Fix crashes running console operations without an active region
Some console operations checked for this but many didn't.

Addresses issues raised in #98491.
2024-03-01 10:00:01 +11:00
Campbell Barton
fc6975e218 Unbreak build with WITH_IMAGE_OPENEXR disabled on macOS/ARM
[0] was meant to resolve this but the include is still needed event
when OPENEXR is disabled.

[0]: a39c16270c
2024-03-01 09:08:14 +11:00
Brecht Van Lommel
a060e96103 Fix #101227: Crash and other issues with non-multiview multipart EXR
Some software stores passes or layers as parts. This case was not
supported by the OpenEXR reader yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/118867
2024-02-29 13:50:18 +01:00
Jacques Lucke
4d13f56f63 Fix: cut off quaternion text overlay 2024-02-29 13:13:00 +01:00
Sebastian Parborg
f8741580a6 Fix: Dropping sound/image/movieclip IDs into the VSE would not work as expected
The drop location would not be set correctly as we returned early if and
ID was dropped.
2024-02-29 13:08:51 +01:00
Campbell Barton
c19cdc343f Fix assert with temporary directories beginning with "//"
- Skip leading forward slashes when setting the temp directory.
- Add a utility function to set the temporary directory
  which is used for the user preferences & environment variables.

This issue was raised by #95411 where "//" resolves to "/",
then asserts when passed to Blender's file-system functions.
However the crash referenced in this report looks to be caused
by Collada failing to write to the temporary directory which
can be handled separately.

Ref !118872
2024-02-29 22:01:44 +11:00
Christoph Lendenfeld
a96f1208cc Fix #97202: Channels of animation editors disappearing when applying filters
The issue is that when applying filters, the list of channels shrink, but the `View2D` isn't updated accordingly.
When you move the viewport, the channels would jump back into view but not before.

The total height of the channel stack is computed every frame,
and the issue is fixed by calling the `UI_view2d_curRect_clamp_y` after that.

Since this has to be done before `UI_view2d_view_ortho` is called, I had to extract
the height calculations into the caller function.
I thought about making a generic function for all 3 editors but they were too different
to meaningfully do that.

I removed the fix that stopped the channels going off screen when using the cursor to scroll,
since the new logic already does that.

Note: while the report only mentions the Dope Sheet, this fix is applied to
the Graph Editor and NLA editor as well since they had the same issues. This PR fixes them all.

Also fixes #46649

Pull Request: https://projects.blender.org/blender/blender/pulls/118006
2024-02-29 10:33:02 +01:00
Campbell Barton
f647e1a5b7 Weight Paint: expose all pose mode selection tools
Pose-mode selection tools (box, lasso & circle select) now support
pose-mode when weight-painting.

Changes to the key-map [0] caused a regression where it was no longer
possible to select multiple bones because Shift-LMB is now used for
painting. The report #114981 proposes to support pose selection tools
in weight paint mode.

Note that in [1] added the tweak tool, this completes the change by
supporting other tools & fixing W-key shortcut access.

Resolves #114981.

[0]: 6de6d7267f
[1]: edcac1f48b
2024-02-29 18:12:50 +11:00
Campbell Barton
94ae1bd407 Fix pose-mode lasso select failing with multiple objects
When detecting pose-bone visibility lasso select used the same
armature for all pose bone checks. This caused the PBONE_VISIBLE
to return invalid results.

Simplify the logic by calling ED_view3d_viewcontext_init_object in the
outer loop.
2024-02-29 17:06:52 +11:00
Campbell Barton
08e0b35b31 Fix C-style formatting characters shown in operator reports
Caused by [0] which moved to fmtlib but left in some C-style formatting
characters.

[0]: f04bc75f8c
2024-02-29 12:23:17 +11:00