Commit Graph

107048 Commits

Author SHA1 Message Date
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
Sergey Sharybin
e3a7d68baf Fix #118034: Cycles: Driven View Layer property not considered in realtime
The issue was caused by Cycles doing dependency tracking on its
side, relying on the fact that view layer needs to be tagged as
modified when its properties change.

This was not the case when custom property on the a view layer is
modified via a driver.

Now the dependency graph will tag IDs which generic properties did
change as ID_RECALC_PARAMETERS, giving it a chance to render engines
to react to it.

Since this is quite generic code which might have unforeseen side
effects the change is not targeted to the current release branch.

Note that this chaneg does not fix the #103140, as the issue there
is use of RNA path to another data-block, without the node tree
registering relation to that data-block.

Also fixes #118117: Compositor does not update image when path is changed via handler

Original Pull Request: https://projects.blender.org/blender/blender/pulls/118134

Pull Request: https://projects.blender.org/blender/blender/pulls/118846
2024-02-28 15:56:31 +01:00
Sean Kim
329926e7d5 Fix: Disable dyntopo detail flood fill for invisible objects
This PR disables the `SCULPT_OT_detail_flood_fill` operator on invisible objects.

Addresses part of #112371
2024-02-28 14:45:41 +01:00
Sean Kim
89d073dafa Fix: Disable project line gesture on invisible objects
This PR disables the `SCULPT_OT_project_line_gesture` operator on invisible objects.

Addresses part of #112371
2024-02-28 14:44:50 +01:00
Sean Kim
aa75f841bf Fix: Disable set_persistent_base for invisible objects
This PR disables the `SCULPT_OT_set_persistent_base` operator for invisible objects.

Addresses part of #112371
2024-02-28 14:41:47 +01:00
Jacques Lucke
4a4916db45 Fix #118237: don't allow changing NodeSocket.type directly on built-in nodes
Changing socket types like this is not generally supported. Usually one should
modify a property that is stored on the node instead. For custom node trees,
one should generally remove one socket and replace it with the new one.

Existing addons might use this functionality on custom node trees where it's
okayish. This patch forbids changing socket types directly on built-in nodes.

Pull Request: https://projects.blender.org/blender/blender/pulls/118794
2024-02-28 11:35:32 +01:00
Jacques Lucke
f65e6da101 Fix #118073: show exact integer representation in some cases in socket inspection
Without the extra precision, `fmt::format` rounds the resulting float to one with
fewer significant digits. This is generally nice, but not desired in this specific
case for consistency with the value stored in the socket.

Pull Request: https://projects.blender.org/blender/blender/pulls/118797
2024-02-27 20:38:41 +01:00
Jacques Lucke
64febcf155 Fix #116820: make sure that simulation runs when it contains an active viewer
Previously, the viewer node would work, but since the simulation output node
was never evaluated, the new simulation state was never stored. Now make
sure that the simulation output node is executed when there is an active viewer
inside the simulation.

Pull Request: https://projects.blender.org/blender/blender/pulls/118804
2024-02-27 20:37:52 +01:00
Jacques Lucke
c96e0a24bf Fix #116598: disable color overlay for rotation values
Currently, we don't support this. Depending on the geometry type, the rotations
are either displayed as black, magenta or there is a crash. Better disable this for
now until we have a proper implementation. It's not quite obvious how rotation
values should be converted to a color, so this also needs some design work.

Pull Request: https://projects.blender.org/blender/blender/pulls/118808
2024-02-27 20:30:01 +01:00
Jacques Lucke
103fda89f4 Fix #116380: disable pinning when switching to tool mode
It might be nice to keep the pinning but that's a bit more tricky technically
currently because the pinned node tree is overridden by the tool node tree.
Just disabling pinning solves the main issue right now which is that the
node editor shows the wrong node tree.

Pull Request: https://projects.blender.org/blender/blender/pulls/118811
2024-02-27 20:25:02 +01:00
Miguel Pozo
71fffa57fd Fix #116232: EEVEE: NaN reflection normals
Same fix as #114960.
2024-02-27 20:22:28 +01:00
Sean Kim
b5f76620e4 Fix: Disable symmetrize on invisible objects
This PR disables the `SCULPT_OT_symmetrize` operator on invisible objects

Addresses part of #112371
2024-02-27 19:13:26 +01:00
Jacques Lucke
ee179e2749 Fix #116368: missing redraw after baking in geometry nodes
This tag indirectly calls `ED_render_view3d_update` on the main thread,
which will cause the 3D view to redraw without evaluating any objects again.
2024-02-27 18:31:27 +01:00
Bastien Montagne
40480fe226 Fix #118693: Crash on linking collection, then undoing and re-doing operation.
Do not blindly iterate on a ListBase when you add or remove items
to/from it...

Own mistake in readfile refactor in 06/2023 (ebb5643e59).
2024-02-27 17:28:29 +01:00
Bastien Montagne
9fe3de2289 Cleanup: blo_read_file_internal: Use local bool flag instead of bitflag check. 2024-02-27 17:07:36 +01:00
Bastien Montagne
e78224d751 Cleanup: RNA: Make PointerRNA parameter const for more accessors.
Still much to do here, but that's one step further.

Should be strictly non-behavioral change.
2024-02-27 16:14:39 +01:00
Brecht Van Lommel
f00099f5f2 Cleanup: make format 2024-02-27 14:14:00 +01:00
Jeroen Bakker
e273fb4226 Revert "Fix: GPU: Reduce GPU_MAX_ATTR from 15 to 14"
This reverts commit d9caa19ec2.

This commit doesn't compile, and when fixing the issues, doesn't start
blender.
2024-02-27 13:41:31 +01:00
Pratik Borhade
8e28536257 Fix #118706: Ctrl-X between Vector and Rotation will not preserve the linkage
Internal link is not created for a node when it has rotation output
socket. This is because the missing case for `sock_rotation` in
`get_internal_link_type_priority()` which fails to find input_socket
priority in this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/118735
2024-02-27 13:10:26 +01:00
Pratik Borhade
05c4b7f588 Fix #118621: Obj Importer does not handle inline comments correctly
Add simple check in `geom_add_polygon` to skip comments that are on same
line as face corner index.

Pull Request: https://projects.blender.org/blender/blender/pulls/118742
2024-02-27 13:09:05 +01:00
dupoxy
d9caa19ec2 Fix: GPU: Reduce GPU_MAX_ATTR from 15 to 14
This is to accommodate Position and Normal attributes.
The normal used to be optional but isn't nowadays.

So the limit is actually 14 attributes until we do some big refactoring of
the attribute fetching.

Pull Request: https://projects.blender.org/blender/blender/pulls/118441
2024-02-27 12:19:09 +01:00
Campbell Barton
3d18896e4b Fix #102526: Fix crash performing nested viewport drawing
Performing an off-screen draw call while drawing the viewport isn't
supported, add a check that raises an exception when called from Python
instead of crashing.

Ref: !118780
2024-02-27 21:29:38 +11:00
Campbell Barton
efdbdd6915 Fix #118767: Incorrect Python syntax highlighting for mult-line strings
Lines beginning with a back-slash used a previous character that
was initialized to the default which isn't correct for multi-line
strings.
2024-02-27 21:24:37 +11:00
Campbell Barton
0d9cd1ee2d Fix crash hiding a region from Python with a popover & region overlap
This was reported as #93410 & fixed with [0] however the fix didn't
help for animated logic (with region overlap enabled).
Resolve by adding a function ED_region_visibility_change_update_ex which
is called by the animated and non-animated region hiding functions.

[0]: 8f69c91408
2024-02-27 20:47:48 +11:00
Omar Emara
d88cdb3cf1 Fix: Crash when the input of Kuwahara is translated
Blender would crash if the input of the Classic Kuwahara node is
translated. This is due to an out of bound access due to the miss-use of
IndexRange, where it was assumed to have a start-end constructor, while
it was in fact a start-size one. Fix this by computing the size from the
area and supplying it to the constructor.
2024-02-27 11:37:35 +02:00
Jesse Yurkovich
5b65e2dd7c Fix #118704: permit filepaths without extensions in STL batch mode
The STL exporter was enforcing file paths with an extension when used
from the file browser. This would cause oddness during Batch export mode
and was different than the prior Python based exporter[1].

Permit the exporter to accept names without an extension as before.

[1] [Prior python exporter](https://projects.blender.org/blender/blender-addons/src/branch/blender-v4.0-release/io_mesh_stl/__init__.py#L239)

Pull Request: https://projects.blender.org/blender/blender/pulls/118777
2024-02-27 07:46:29 +01:00
Campbell Barton
b16ef496a6 Fix #113479: Crash on script error after calling modal_handler_add()
Operators that added themselves as modal handlers would crash if there
was a Python exception in the script before returning.

Now modal handlers are removed an exception occurs in exec & invoke
operator callbacks.
2024-02-27 16:38:01 +11:00
Hans Goudey
341166c728 Fix #118538: Sculpt smooth mask broken for multires
Mistake in bd51bb7623.
2024-02-26 22:31:55 -05:00
Campbell Barton
fe8e27ad17 Fix #116680: Crash disabling an add-on used in the file-selector
Clear SpaceFile::op pointer when unregistering an operator to
prevent a use after free error.
2024-02-27 13:04:38 +11:00
Jesse Yurkovich
5d9e127234 Fix: Proper error handling for STL, PLY, and OBJ IO
Properly handle exceptions from STL and PLY code to prevent crashes on
invalid file paths.

This will now also Report errors/warnings to the callers of these
formats as well. For the UI this means a Report banner and Info editor
entry. For Python scripts this means an exception instead of silently
continuing.

Related to #117881
Pull Request: https://projects.blender.org/blender/blender/pulls/118731
2024-02-26 20:45:46 +01:00
Bastien Montagne
3748e49034 LibOverride: When created from IDTemplate UI, ensure instanciation of hierarchy root.
When a new liboverride is created from the IDTemplate UI widget, in case
its hierarchy root is different than the liboverride itself, ensure that
it is also instanciated in the scene, if possible (i.e. if it's an
object or collection).

Should allow for better representation of liboverride hierarchies
created that way, and reduce the risk of getting key liboverrides hidden
from the scene's hierarchy (in the Outliner ViewLayer view e.g.).
2024-02-26 18:48:37 +01:00
Bastien Montagne
73a2af3ae5 Fix #118714: Crash on trying to create override on nested linked object.
LibOverride creation code wrapper when called from the IDTemplates in
the UI was a tad too permissive in its attempts to find the best
possible liboverride hierarchy root, leading to potential invalid linked
ID selection.
2024-02-26 18:48:37 +01:00
Philipp Oeser
a6060ea8ee Fix #118637: crash after editbone duplication in certain case
Crash happens in `action_group_colors_set_from_posebone` /
`ANIM_bonecolor_posebone_get` on a `bPoseChannel` without a `bone`.
If I am not mistaken a new `bPoseChannel` (e.g. after duplication) will
only get its `bone` after leaving editmode.

So in a way the situation is similar to 2a8ce1f121

Behavior of `animchan_sync_group` is not reliable in a way that getting
a `bPoseChannel` from an `bActionGroup` will guarantee these are really
corresponding. So usually, if you dulplicate/symmetrize a bone, there
would be no corresponding `bActionGroup` and nothing would happen
really. But you could for example group fcurves from `Bone` under a
group called `Bone.001` and vice versa. This is totally allowed to do.
In this case, `animchan_sync_group` is doing nothing totally helpful, so
it could find the "wrong" `bPoseChannel`. And it could try
`action_group_colors_set_from_posebone` with that `bPoseChannel` which
still does not have a `bone` and then crash.

So now only do this if we have a valid `bone`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118676
2024-02-26 17:40:57 +01:00