Commit graph

117409 commits

Author SHA1 Message Date
Philipp Oeser
ce642e790a Bump version cycle to 3.3.18 release 2024-04-15 09:29:46 +02:00
Sergey Sharybin
1d5ef2d1c6 Fix #120007: Crash rendering when using OptiX and Grease Pencil on recent drivers
The issue seems to be caused with the recent NVidia drivers, which will
crash if OptiX context is created prior to the OpenGL context on Linux.
This happens with drivers 545.29.06, 550.54.14, 550.67 and kernel 6.8
on Ubuntu 24.04, and also happens with NVidia driver 550.67 on Gentoo.

While it does seem the issue is likely on the driver side, the timeline
for it being resolved there is unknown. Until then it is possible to
apply workaround on Blender side, which will initialize GPU context
prior to rendering with an external render engine when it is known the
GPU context will be needed later on.

Note this is not a complex fix, because in general it's still possible to
render a frame without and then with grease pencil, in which case OptiX
will still be initialized first. But we don't want to always initialize
OpenGL, and we can't predict future operations.

Pull Request: https://projects.blender.org/blender/blender/pulls/120026
2024-04-10 16:51:45 +02:00
Brecht Van Lommel
0c34e529c5 Fix #110751: Crash baking grease pencil line art
Ensure depsgraph tag happens when strokes are cleared, otherwise the
next depsgraph evaluation tries to use freed stroke data.

Pull Request: https://projects.blender.org/blender/blender/pulls/119662

Pull Request: https://projects.blender.org/blender/blender/pulls/120468
2024-04-10 14:15:01 +02:00
Hik
c32f7ea887 Fix #119275: Update Sidebar Values with Voxel Size Changes
Add notifier when changing sculpt voxel size so that the new value is
shown in the sidebar.

Pull Request: https://projects.blender.org/blender/blender/pulls/119646
2024-04-10 13:44:08 +02:00
Amine Bensalem
b9add3302b Fix #118137: Symmetry buttons on-click state change
Buttons for mesh symmetry on the toolbar, and other buttons of the same
functionality located in other areas of the window, weren't updated when
clicking on them.

Pull Request: https://projects.blender.org/blender/blender/pulls/118508
2024-04-10 13:43:37 +02:00
Bastien Montagne
fef97afbad 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).

NOTE: Cherry-pick of 6adf5adb7f, had to do some non-trivial changes to
get it to work in older code though.

Pull Request: https://projects.blender.org/blender/blender/pulls/119429

Pull Request: https://projects.blender.org/blender/blender/pulls/119687
2024-03-21 11:06:03 +01:00
Bastien Montagne
988eef5f31 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-21 11:06:02 +01:00
Bastien Montagne
eb1b028c14 Fix #118299: Crash in some cases with invalid/deprecated LibOverride data.
`BKE_lib_override_library_validate` used on fileread to ensure all
liboverrides are valid was using direct call to
`BKE_lib_override_library_free`. However, this was lacking the handling
of embedded dependencies (from liboverride PoV), in particular
ShapeKeys.

Since these shapekeys were still tagged as embedded liboverrides,
liboverride code would later assume their owner (mesh etc.) was also a
valid liboverride, leading to various potential issues.

Use instead `BKE_lib_override_library_make_local`, which also ensures
that embedded dependencies are handled properly.
2024-03-21 11:06:02 +01:00
Philipp Oeser
f44c100dd4 Bump version cycle to 3.3.18 candidate 2024-03-21 10:51:19 +01:00
Philipp Oeser
1057a9e58a Bump version cycle to 3.3.17 release 2024-03-18 14:37:40 +01:00
Sergey Sharybin
f3bceefdb7 Fix make_update when old Python3 is used
The `is_relative_to` has been introduced in Python 3.9, which is newer
than some of the workers on the buildbot are using.

Pull Request: https://projects.blender.org/blender/blender/pulls/119165
2024-03-13 15:26:49 +01:00
Philipp Oeser
61896b2037 Fix build issue on windows
backport oversight in 2e8241b40733e [which didnt complain on linux]

Pull Request: https://projects.blender.org/blender/blender/pulls/119377
2024-03-12 16:23:50 +01:00
Philipp Oeser
37907e8a80 Fix #114552: Copy material to selected crash on object lacking slot
Caused by 9c1da81a4c.

This happened in the case where objects shared the same data and slots
are assigned to object and receiving object did not have a material slot
yet.

Then, `ob->matbits` may be NULL, now just check for this, too.

Pull Request: https://projects.blender.org/blender/blender/pulls/119161
2024-03-12 16:23:48 +01:00
Sergey Sharybin
ac10c8023e Fix missing relations built for camera referenced by markers
A missing part since PR #110139: the nodes and relations builders
needs to be in-sync and build the same objects. The relations builder
was missing relations building for camera referenced by markers.

Pull Request: https://projects.blender.org/blender/blender/pulls/114443
2024-03-12 16:23:48 +01:00
Pratik Borhade
b3dfc0df63 Fix #119106: Set Action in outliner does not update the animation
This is due to the missing depsgraph update

Pull Request: https://projects.blender.org/blender/blender/pulls/119112
2024-03-12 16:23:48 +01:00
Philipp Oeser
23f9094961 Cleanup: format 2024-03-12 16:23:48 +01:00
Pratik Borhade
efd27d29e9 Fix #119142: Skip linking collection inside another linked collection
When linking a collection from library, it can be linked inside another
linked/overrided collection if it is selected in outliner. This can be
prevented by linking with editable parent collection.

Pull Request: https://projects.blender.org/blender/blender/pulls/119144
2024-03-12 16:23:48 +01:00
Bastien Montagne
55b0b24096 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-12 16:23:48 +01:00
Bastien Montagne
11f591d38c 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-12 16:23:48 +01:00
Alaska
be7c08424f Fix: Cycles HIP incorrect rendering of clip image textures
This was fixed in the driver quite a while ago:
https://github.com/ROCm/HIP/pull/2229

Ref: #91571
Pull Request: https://projects.blender.org/blender/blender/pulls/118540
2024-03-12 16:23:48 +01:00
Alaska
ebdd21974b Cycles: Improve reporting of HIP texture allocation failures
HIP fails to allocate textures, typically when they are too large.
This commit lets the user know what might be causing the issue
rather than providing a confusing internal error message.

Pull Request: https://projects.blender.org/blender/blender/pulls/118239
2024-03-12 16:23:48 +01:00
Philipp Oeser
4d297c32c4 Fix #102930: crash loading a GP file with hook custom curve
The CurveMapping was just not initialized on file read (now done via
BKE_curvemapping_init).

Pull Request: https://projects.blender.org/blender/blender/pulls/118525
2024-03-12 16:23:48 +01:00
Philipp Oeser
708953888f Fix #105968: Crash when delete linked object in scenes Outliner
Problem here is that when selecting/activating an object in a different
scene in the Outliner, the Outliner will automatically switch scenes via
`WM_window_set_active_scene` however the `view_layer` was untouched and
as a consequence `BKE_view_layer_synced_ensure` gets the right scene but
the "wrong" viewlayer [which makes it not do its thing properly]

To solve, now use the new active viewlayer after having switched scenes.

NOTE this also solves a couple of other asserts elsewhere (when not
deleting, just selecting/activating could assert on
`DEG_is_evaluated_object(ob)`)

Pull Request: https://projects.blender.org/blender/blender/pulls/118458
2024-03-12 16:23:48 +01:00
Philipp Oeser
9800ef6ab3 Fix #118225 possible crash double clicking on certain anim channels
The intend in the report was to rename a linked object in the NLA
channels. The operator to rename actually does everything right, it
detects that the object is linked and passes through to other operators.

The crash then happens in the attempt to select keyframes of channels
(also doubleclick n the keymap) -- in `select_anim_channel_keys`.

The problem is that `bAnimListElem` `key_data` cannot be expected to be
an `FCurve` in all cases. Code does though, it always casts, but this is
unreliable, basically this would fail for all of the "summary" channels
or any channel type (e.g. mask layers etc.), either it is NULL or
garbage data.

So to resolve, we just check the `bAnimListElem` type -- if it is not
ALE_FCURVE we can early out (preventing the crash).

NOTE: this changes behavior of double clicking on a summary channel that
cannot be renamed slightly in that it will not deselect its keys anymore
(it was not selecting any keys anyways, this is actually more in line of
what would happen if you just select another channel -- this also leaves
key selection alone -- so this is actually an improvement as well imho)

Pull Request: https://projects.blender.org/blender/blender/pulls/118251
2024-03-12 16:23:48 +01:00
Brecht Van Lommel
ee0e7d0667 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-03-12 13:32:10 +01:00
Omar Emara
a7ae75235f IMB: Read single-layer XYZ channels as a combined image
Currently, the OpenEXR reader can't read single-layer XYZ images as a
combined image. Single-view images will only read the X channel, while
multi-view images will interpret the Z as a depth image and the Y and Z
channels will be treated as float passes.

This patch allows the reading of XYZ channels as combined images. For
single-view images, we just extend the RGB-like channel names we match
to contain XYZ. For multi-view images we only treat the Z channel as a
Depth one if no X and Y channels exists, since the Z in this case is
part of the XYZ image.

Pull Request: https://projects.blender.org/blender/blender/pulls/115290
2024-03-12 13:32:10 +01:00
Omar Emara
387d383666 IMB: Support rgba and V channels in single-layer EXR
Currently, the EXR reader only considers uppercase RGBA channel names in
single-layer EXRs, which leaves out the lower case rgba channel names we
started using for data and vector passes in Cycles and the compositor.
Further, a single V channel was also ignored, which is by convention
used for BW passes.

This patch extends the single-layer channel recognition methods to
include lowercase rgba and V channels.

Pull Request: https://projects.blender.org/blender/blender/pulls/114339
2024-03-12 13:32:10 +01:00
Campbell Barton
5c04695de2 Cleanup: remove strcpy usage 2024-03-12 13:32:10 +01:00
Brecht Van Lommel
f13ebb09de Fix #117485: Crash rendering motion blur with changing curve count
This is not supported so there can be artifacts, but it should not
crash.

Pull Request: https://projects.blender.org/blender/blender/pulls/118859
2024-03-12 13:32:10 +01:00
Philipp Oeser
df7d77d967 Bump version cycle to 3.3.17 candidate 2024-03-12 12:54:55 +01:00
Ray Molenkamp
19e0e525d1 deps_builder: fix URI for the blender mirror of the source packages
This was still using the SVN repository, which isn't used any more
since the migration to git lfs.
2024-03-11 10:41:29 +01:00
Lukas Stockner
603b88f188 Fix #117586: Cycles: World Lightgroup not updated when creating/deleting LGs 2024-03-07 17:33:49 +01:00
Sergey Sharybin
ec030f848a Make update: Bring behavior closer to what it used to be
The `make update` will now always update all initialized submodules,
including the library ones.

The `make_update.py --no-libraries` will neither initialize nor update
pre-compiled libraries or tests.

This is a cherry-picked #118812 onto the 3.3 LTS branch.

Pull Request: https://projects.blender.org/blender/blender/pulls/118816
2024-02-27 21:26:42 +01:00
Sergey Sharybin
6481bf32b3 Blender 3.3: 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:
```
  * 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 library and tests data submodules are disabled by default. 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 new 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

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Ray Molenkamp <github@lazydodo.com>

Pull Request: https://projects.blender.org/blender/blender/pulls/118740
2024-02-26 15:12:59 +01:00
Bastien Montagne
d78a01b8a9 install_deps: Add git-lfs to 'build essentials'.
'Porting' ea10be4dd6 from `main`.
2024-02-22 21:21:04 +01:00
Thomas Dinges
d980adcac7 Release: Bump to 3.3.16 2024-02-19 17:47:13 +01:00
Bastien Montagne
6d39e78438 Fix #118055: libOverride resync() RNA call crashes when view_layer is not specified.
Underlying `lib_override_library_resync` code lost the optional aspect
of its `view_layer` parameter at some point, trivial to restore it
luckily.

3.3-specific version of original fix (711e4cdd94).

Pull Request: https://projects.blender.org/blender/blender/pulls/118364
2024-02-16 10:36:32 +01:00
Bastien Montagne
5b79fc9885 Fix mistake in fix for #108407 (crash on deleting shapekeys).
Own d38824bc02 mistakenly added the 'FILTER_ID_KE' to the list IDTypes
usable by Lights (`ID_LA`) instead of Lattices (`ID_LT`)...

Note that this did not cause any additional issue, but only missed part
of the expected fix.
2024-02-16 09:16:55 +01:00
Bastien Montagne
737d963c3a Fix #108407: Crash on deleting shape key from Blender File view.
`BKE_library_id_can_use_filter_id` was missing the ShapeKey type for
geometry IDs (meshes, legacy curves, and lattices), leading to the
remapping code to fail to do its job when deleting the ShapeKey only.

Pull Request: https://projects.blender.org/blender/blender/pulls/118281
2024-02-14 17:06:38 +01:00
Campbell Barton
6fba82404d Fix buffer overflow passing a vertical segment to convexhull_2d
Convex hull calculation would "cap" line segments with the first point.
Besides causing a buffer overflow when passing in two points,
it's not needed as matching first/last ends aren't expected
to be set by this function.
2024-02-14 16:30:12 +01:00
Philipp Oeser
6bd9b1f189 Fix #54554: missing colorspace calling paint.image_paint() from python
Without doing a stroke "manually", colorspace initialization on
UnifiedPaintSettings was never done.

This lead to wrong colors in the past, since modern CS code with OIIO
this also crashes.

Colorspace was added into UnifiedPaintSettings in 6f153046e0 to avoid
doing this when sampling the brush texture images [which is good], but
the initalization was done in `paint_brush_update`.

We dont need to have this called for every step (it was skipped anyways
after one run), so it seems we can move this out of `paint_brush_update`
and put this into `paint_stroke_new`.

Thx @RevDr for initial findings.
2024-02-14 16:25:54 +01:00
Philipp Oeser
2498b9b212 Fix: Entering node group via icon after exiting it via ctrl+tab broken
This is because the `NODE_OT_group_edit` operator reuses the last value
of the `Exit` property and once this is set it would always try to pop
(instead of push [which is what we want from the icon]) the nodegroup.

Callers of the operator set `Exit` explicitly elsewhere (just not
from node drawing -- where the way it is called [via a more general
callback] makes it difficult to set operator properties from there).

Solve by not saving the property for following usages (flag
`PROP_SKIP_SAVE`).

Fixes #117530.

Pull Request: https://projects.blender.org/blender/blender/pulls/117542
2024-02-14 16:21:33 +01:00
Philipp Oeser
8ee0333602 Fix #117526: Crash when Changing Color Palette in Edit Mode
By default, Color Palettes are only drawn in the UI in the context of
**painting**.
UI button code then tries to update an appropriate brush from edits to
the palette.

So a valid `Paint` and `Brush` were assumed. This is not a problem for
objectmode (because `BKE_paint_get_active_from_context` then defaults to
`ImagePaintSettings`'s `Paint`), but other modes dont guarantee this
(editmode only returns a valid `Paint` when uv sculpting).

In the report, a palette was created and displayed via python, making
changes in editmode would then crash.

Solve by checking we have a valid Paint in corresponding UI code to
begin with.

Similar to 9e82e48937 .

Pull Request: https://projects.blender.org/blender/blender/pulls/117544
2024-02-14 16:21:08 +01:00
Philipp Oeser
20880d002e Fix #68436: External Particle Disk Cache Playback Is Broken
This has been broken since 2.8.

The highlevel reason for this is that the "info file" (saved as frame
zero) was not written anymore.
Reason for that in turn is that when calling BKE_ptcache_write outside
the bake job, the PTCacheID calldata (a psys in our case) is not the
evaluated particle system, causing a check for totpoint to fail (these
were always zero).

Deeper reasoning is unclear, no further investigations were done as to
why/when this happened.

The solution proposed here is using the evaluated psys when writing the
info frame (and this is isolated to just this spot and only to particle
systems). File then gets
written and can/will be read when using this as an external disk cache
in another file.

Pull Request: https://projects.blender.org/blender/blender/pulls/117401
2024-02-14 16:16:48 +01:00
Philipp Oeser
1925c62d5f Fix #106425: Mantaflow guiding with domains is broken
Caused by e968b4197b / 67e23b4b29

Since culprit commits, we are not running `MANTA::initGuiding` /
`fluid_alloc_guiding` if guiding is meant to be pulled from other
domains (it does work with effectors though). This is because atm. only
the `FLUID_DOMAIN_ACTIVE_GUIDE` flag sets `mUsingGuiding` to true
(activated in `update_obstacleflags`, so only for effectors).

So to fix this, we have to ensure that `MANTA::initGuiding` runs (also
if guiding is pulled from domains), but also make sure we dont run into
the crashes from T102257.

It seems that the real reason we were getting crashes in T102257 is that
67e23b4b29 made it so that resetting the cache (including a call to
`fluid_modifier_reset_ex`) in `fluid_modifier_processDomain` happens
**after** `FluidDomainSettings.active_fields` have been updated (this
happens in `update_flowsflags` & `update_obstacleflags`).
But `fluid_modifier_reset_ex` also resets
`FluidDomainSettings.active_fields`. If we then update pointers later in
`fluid_modifier_processDomain`, we never get anything in the guiding
related pointers for the new `mCurrentID` (specifically `mPhiGuideIn`
will be a nullptr). This is the real reason `initGuiding()` runs a
second time (it does once for `fluid_modifier_init` then again as a
consequence of the call to `manta_guiding`).

This patch proposes to move the resetting process from 67e23b4b29
**above** the refreshing of the `FluidDomainSettings.active_fields`,
this way these field stay intact, we do get the first run of
`initGuiding()` from `fluid_modifier_init`, manta pointers get updated
with intact fields afterwards (so we then get a valid `mPhiGuideIn`),
which then prevents the second run from `manta_guiding` to actually call
the python script again.

The fix from e968b4197b is then not needed and reverted in this patch.

This should be good for LTS I think.

Pull Request: https://projects.blender.org/blender/blender/pulls/117067
2024-02-14 16:11:37 +01:00
Campbell Barton
94b359d1f2 UI: context menu support for changing menu & panel shortcuts
While the shortcuts would be shown for menus & panels,
there was no way to edit them from the context menu.

This was reported as a bug since moving "Undo History" from an operator
to a menu meant it was no longer possible to assign a shortcut from
the context menu.

Resolves: #97431.
2024-02-14 16:04:23 +01:00
Campbell Barton
4a2a6f1fa4 Cleanup: remove use of scoped defer to ensure memory is freed
Using a single free call is simple and reduces the generated code side.
2024-02-14 15:49:53 +01:00
Jesse Yurkovich
e10b2fc1a3 Fix: memory leak during Property Search
An early return prevented the property item array from being free'd.

Pull Request: https://projects.blender.org/blender/blender/pulls/116860
2024-02-14 15:46:03 +01:00
Philipp Oeser
ffdec7c0f9 Bump version cycle to 3.3.16 candidate 2024-02-14 15:29:52 +01:00
Brecht Van Lommel
8d9ecf2885 Build: don't write __pycache__ files into lib folder for make commands
These scripts are not performance critical, and the cache files could
potentially interfere with library updates in the future.
2024-01-23 20:31:21 +01:00