Commit Graph

107021 Commits

Author SHA1 Message Date
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
Philipp Oeser
ae022e515b Fix 104657: crash when trying to create a Pivot Constraint for armature
`RootPChanMap` will be nullptr when building DEG object-level
constraints (as as opposed to bone constraints where this map is built
prior), and in that case we don't need to check for the common chains in
`bone_target_opcode`.

Thx @sergey for additional confirmation

Pull Request: https://projects.blender.org/blender/blender/pulls/118745
2024-02-26 17:15:58 +01:00
Omar Emara
a2ca050087 Fix #118711: Crash in compositor with many nodes
The Viewport Compositors crashes when there are many nodes that are not
connected to the compositor or viewer outputs.

That's because those sockets were wrongly added to the shader operation,
even though they will not be used, which surpasses the limit for the
maximum image units per shader.
2024-02-26 16:24:38 +02:00
Aras Pranckevicius
b846ccd76b Fix #118501: crash opening some projects if Load UI is off
Missing vecscope_rgb null initialization when loading Scopes data,
introduced in 567455124d
2024-02-26 14:54:05 +02:00
Miguel Pozo
a106ff9f56 Fix #118634: EEVEE: Set clip threshold per material
Pull Request: https://projects.blender.org/blender/blender/pulls/118681
2024-02-26 12:49:29 +01:00
YimingWu
e938b516a9 Fix #118425: LineArt: ensure long edges are shown
Line art used to not calculate edges where both ends are outside image
frame, this will lead to missing edges in some cases where the model is
scaled up pretty big. Now it ensures those edges are still preserved.

Pull Request: https://projects.blender.org/blender/blender/pulls/118448
2024-02-26 04:50:48 +01:00
YimingWu
0a339231ec Fix #118547: LineArt: Handle shadow segments with 0 length
Line art shadow projection will cut lines indefinitely when it
encounters a edge segment with 0 length. In the case of #118547, it was
caused by the combination bevel modifier and the view angle. This fix
ensures that no such edge is worked on further.

Pull Request: https://projects.blender.org/blender/blender/pulls/118613
2024-02-26 03:53:21 +01:00
Campbell Barton
5db2a842c0 Unbreak build with GLIBC pre 2.28
Also de-duplicate rename logic for Linux & other UNIX systems.
2024-02-26 10:15:54 +11:00
Jesse Yurkovich
0f266ca3c9 Fix #118704: STL batch export used wrong filename
The newly generated filename for batches was not used.

Pull Request: https://projects.blender.org/blender/blender/pulls/118708
2024-02-25 00:01:33 +01:00
Philipp Oeser
c75d2d09e3 Fix: Cloth could ignore "Shear" vertexgroup
Oversight in e3d31b8dfb

While most situations would have other vertexgroups set anyways (so this
probably wasnt noticed, it was only ignored if it is the only
vertexgroup used), at least theoretically it could happen that
`cloth_uses_vgroup` would return false even then `vgroup_shear` is set
(thus skipping actually setting these weights later).
2024-02-23 15:34:12 +01:00
ok_what
8b5f11839e Fix: Copying strip inside meta, copies top-most meta instead
When inside a meta strip, copying and pasting a strip would copy the
top-most meta strip, rather than the intended strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/118090
2024-02-23 15:08:14 +01:00
Pratik Borhade
80e7c04726 Fix #118475: Regression: NLA/driver data missing in outliner
Caused by 0a633a4e07
NLA and driver tree-elements were not added to the outliner when
"action" is unlinked from the object. This is due to the wrong `if`
condition preventing the excution of `expand_drivers/expand_NLA_tracks`.

Pull Request: https://projects.blender.org/blender/blender/pulls/118597
2024-02-23 12:07:40 +01:00
Philipp Oeser
199f8ad817 Fix #118643: Translation of enum button tooltip not working in cases
Originally caused by 90c4e2e6ec [which did not translate the tooltip
descriptions for enum items at all]
That was fixed in cbc5d861db [which was working fine for the default
translation context -- which is most of the time]

Now 7d7318f6c5 added the `BLT_I18NCONTEXT_ID_ID` translation context
to `buttons_context_items` (rightfully so) but using this context on the
enum item **description** translation does not really make sense. So as
a result, the description was not translated in this case.

To resolve, now dont use a special translation context for the
**description** of enum items at all, this is also what
`property_enum_translate` does.

Pull Request: https://projects.blender.org/blender/blender/pulls/118653
2024-02-23 11:50:30 +01:00
Philipp Oeser
8b44c62ce7 Fix #118307: Outliner crash with additional constraint on overridden bone
Since `IDOverrideLibraryProperty` apparently stores its rna_path with
string-based collection keys, we have to make sure we also use string-
based keys elsewhere in `OverrideRNAPathTreeBuilder::build_path` and
down the line, otherwise:
- we get duplicate collection entries ("pose.bones[1].constraints" vs.
"pose.bones["Bone.001"].constraints")
- crashes may occur (we are reading on an already freed `TreeElement`
see #118307 for ASAN output)

So now make sure we are using string-based collection keys when we can
so the TreeElements match /and dont get duplicated).

NOTE: the duplication of entries came with 67b92418ee

Pull Request: https://projects.blender.org/blender/blender/pulls/118573
2024-02-23 09:15:37 +01:00
Aras Pranckevicius
3e232aaac1 Fix #118501: crash opening some projects if Load UI is off
Wrong check for vecscope_rgb array free, introduced in 567455124d
2024-02-23 07:27:57 +02:00
Bastien Montagne
1dca5af712 Core: Libraries: Fix library parenting when libraries are deleted.
So far, when deleting a library (either explicitely, or through e.g.
relocation), its dependencies would get a `nullptr` parent, and
therefore become 'directly used' libraries.

This commit adds a new util to rebuild the libraries hieararchy, and
calls it when a Library ID is deleted.

NOTE: While logic is somewhat similar to what liboverride resync does to
sort the libraries by indirect levels
(`lib_override_libraries_index_define`), there are some key differences
here, notably the fact that if a library has a valid `parent` pointer,
it is not replaced, even if a 'better' parent (less indirect library)
could be found.
2024-02-22 19:25:59 +01:00
Christoph Lendenfeld
a102d3e454 Fix #99635: Make last frame of motion path range inclusive
The issue described was that the motion path didn't display the last frame
of a scene.

This PR makes the user facing motion path range inclusive on both ends.
E.g. when the user specifies a motion path from 1-24 the will now get all 24
frames, whereas previously the motion path would end at frame 23.

This also makes the `Scene Frame Range` option work properly since that
had the same issue. Now it displays the actual full scene range.

Internally, the `bMotionPath` is still exclusive on the upper bound.
It is just the `bAnimVizSettings` range that has been modified.

Pull Request: https://projects.blender.org/blender/blender/pulls/118611
2024-02-22 14:44:26 +01:00
Jacques Lucke
e2d809fa91 Fix: show invalid links when separate group input nodes have different linked menu items
Previously, these invalid links would not show as invalid even though they don't work.

Pull Request: https://projects.blender.org/blender/blender/pulls/118610
2024-02-22 14:40:21 +01:00
Brecht Van Lommel
8dfb87d1af Fix: Update tests data path to new directory 2024-02-22 14:25:54 +01:00
Sebastian Parborg
b5c8505f5a Fix: Always print warnings when file/folder renaming fails
Rewrite the code so that users get an error message when trying to
rename something to an existing file in the file browser. Before this
change Blender would not print any notifications on why the rename
failed if a file with the same name already existed.

Pull Request: https://projects.blender.org/blender/blender/pulls/118571
2024-02-22 14:24:33 +01:00
Sebastian Parborg
b4610f8fc0 Fix #116049, #117754: Renaming fails on linux with certain filesystems
Not all filesystems on linux supports the RENAME_NOREPLACE flag.
If we get a EINVAL return value, retry with a non atomic operation.

RENAME_NOREPLACE was introduced in 050d48edfc, so this is a regression
fix as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/118571
2024-02-22 14:23:54 +01:00
Sergey Sharybin
3dc832a904 Switch SVN to Git submodules using Git-LFS
This change makes it so build system and update utilities for Blender builds
are using pre-compiled libraries and other resources attached as Git modules
instead of using checkout of SVN repositories in the parent folder.

The directory layout:
```
  * release/datafiles/
    * assets/        -> blender-assets.git
      * publish/
      * ...
      * README.txt
  * lib/
    * darwin_x64/    -> lib-darwin_x64.git
    * darwin_arm64/  -> lib-darwin_arm64.git
    * linux_x64/     -> lib-linux_x64.git
    * windows_x64/   -> lib-windows_x64.git
  * tests/
    * data/         -> blender-test-data.git
```

The changes about configuring the actual Git sub-modules are not included
into this patch, as those require repository to actually exist before it
can be used.

The assets submodule is enabled by default, and the rest of them are
disabled. This means that if someone runs `git submodule update --init`
they will not get heavy libraries. The platform-specific and tests
related submodules are enabled when using `make update` or `make test`.

All the submodules are tracked: this means that when new commits are
done to the submodule, the blender.git repository is to be updated to
point them to the new hash. This causes some extra manual work, but it
allows to more easily update Blender and its dependencies to known good
state when performing operations like bisect.

Ref #108978

Pull Request: https://projects.blender.org/blender/blender/pulls/117946
2024-02-22 13:50:55 +01:00
Campbell Barton
20c729b902 Fix missing info space redraw when modal operators report while running 2024-02-22 22:12:02 +11:00
Jacques Lucke
a1b95f69fa Revert "Fix #116082: support changing interface socket bl_socket_idname"
This reverts commit 42faf9d242.

This caused #118529. Better figure out a fix first before committing this again.
2024-02-21 22:23:32 +01:00
Bastien Montagne
243f125fa2 Fix #107946: Blender crashes when relocating a library to another library that uses the same "2nd-level" library.
The issue here is that the `parent` pointer of indirectly linked
libraries would not be propoerly cleared when their current parent was
deleted.

Note that this fix will leave effectively indirectly linked libraries
shown as directly used ones in the UI, until the blendfile is saved and
reloaded. This is not a new issue though, deleting a parent library in
the Outliner has the same effect.
2024-02-21 18:17:27 +01:00
Michael Kowalski
1d0bbefbb7 USD: Fix varying interpolation import
This addresses issue #93052.

Now converting the USD "varying" interpolation type to
the "point" domain type when importing USD attributes.

There have been some inconsistent opinions in the USD
developer community about whether "varying" interpolation
is equivalent to "corner" or "point" domains for meshes.
However, DCCs such as Unity and Houdini assume that the
number of entries for attributes with "varying" interpolation
is the same as the number of points, and this change allows
Blender to import such assets without error.

Pull Request: https://projects.blender.org/blender/blender/pulls/118539
2024-02-21 16:07:17 +01:00
Germano Cavalcante
bdc9767e09 Fix: wrong index returned for edge endpoints snapping
This value is not currently being used.
But it can cause problems for those who use Snap Gizmo in Python.
2024-02-21 10:31:18 -03:00
Enrique-de-la-Calle
bd783c8c1b Fix #113812: disabled Bake simulation if cache is not enabled
Currently, baking to disk does not work when caching is disabled. So better
force the user to enable the cache before attempting to bake.

Pull Request: https://projects.blender.org/blender/blender/pulls/114601
2024-02-21 14:12:55 +01:00