And ignore a few CVEs that do not affect Blender.
openimageio 2.4.15
openssl 3.1.2
python 3.10.13
sndfile 1.2.2
webp 1.3.2
Ref #104895
Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Pull Request: #112528
Regression in [0] which caused `execinfo.h` not to be detected by CMake.
Setting a default variable for other platforms prevented the new
variable from being set.
[0]: f197b1a1f1
When multiple packing methods results in effectively the same bounds,
prefer the packer that uses the smallest area. When all islands can
easily fit this is usually the box packer instead of alpaca. The zigzag
method of the latter has a tendendcy to take up more area and rotate
islands.
Fix#110724: smart UV project unnecessarily rotates islands
Pull Request: #112295
This has a tendency to place islands diagonally in the image which is
not usually wanted, even if it's maximimizing the number of pixels for
the island.
Fix#109906: UV unwrap packs island diagonally instead of straight
Pull Request: #112295
Batch deletion of IDs could lead to deleting ObData ones while keeping
the related ShapeKeys.
Orphaned shape keys are not allowed anymore in Blender, they are checked
against in both file write and read code.
This would lead to assert (and crash) e.g. in the liboverride code.
This commit forcefully add shapekeys of deleted meshes, curves etc.,
when calling e.g. `BKE_id_multi_tagged_delete`.
Note that deleting the shapekey when deleting the obdata ID was already
implemented in single ID deletion (`BKE_id_delete` & co), in the
underlying private `id_free`. But this is skipped in `no main` case.
which is used by the batch deletion code for performance optimizations.
Regression in [0] caused the function to jump to the error in the text
editor not to restore the exception, using the trace-back being iterated
over instead of the original value.
[0]: 2d2baeaf04
Pull Request: #112708
The `ScopedModifierTimer` would work for "real" curve modifiers, but was
skipping geometry node modifiers.
Now move it up so geometry node modifiers are included.
Pull Request: #112420
Notifiers was sent to outliner for redraw but outliner was out of sync
due to missing flag which is required for syncing.
This will correctly set the select/active outliner element flags with
the help of Base in `outliner_select_sync_from_object`. So correct active
tree element will be highlighted in `outliner_draw_highlights`
Pull Request: #112370
A mistake in the backport of be2df46afe caused a crash when
there are split edges in some cases. That was caused by changing from a
lambda in the 4.0 version of `IndexMask::foreach_segment` and the
regular iteration over the mask in 3.6. A return in 4.0 is equivalent to
a continue at the top level of the loop in 3.6.
When the mouse cursor is outside the window, it's expected to not have
an active area set in context on such screen level operators. Use the
existing context query that handles this case.
Pull Request: #112417
The `OBJECT_OT_simulation_nodes_cache_delete` operator
would delete the parent bake directory. This could lead to catastrophic
loss of data if the user set their bake directory to a folder that
contains other files or folders.
This commit makes sure that only the "meta" and "bdata" folders get
deleted in the parent directory.
Pull Request: #110999
I couldn't reproduce the issue myself, but my guess is that this happened to work for me because freeing the pointer and then immediately allocating the same size again yielded the same pointer. This is allocator dependent behavior which depends on the platform.
A stable pointer is necessary so that `uiBut`s of different frames can be identified to correspond to each other.
In `main` that works already, because `Vector.resize` does not change the pointer if the size does not change.
Pull Request: #112360
The official SDK was released, add correct paths for that version. The
old paths can be removed once the buildbot uses this SDK.
The SDK installer sets a HIP_PATH environment variable. This is used to
automatically detect the location when HIP_ROOT_DIR is not manually
specified.
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: #110519
The context contained an invalid region pointer after closing the popup.
In the bug report this caused problems making a copy of context.property
which accesses the region, but doing other access to context.region was
a problem as well.
This issue only become visible in debug builds. I'm not aware of bad behavior
that this caused in release builds. Fixing this is necessary to test #112110 in a debug build.
Pull Request: #112363
Fix#100718: NLA Hold Forward Inconsistency
Action Track with 'extrapolation=Hold Forward' behaves the same as 'Hold'.
For the Action Track, we now properly treat extrapolation Hold_Forward just like the rest of the NLA system.
Co-author Wayde Moss @wbmoss_dev
Pull Request: #112347
These group nodes currently don't have a socket declaration for every socket.
Instead we just don't touch the sockets at all so that things have not changed
when the node group is found again.
Pull Request: #112373
There were two issues:
* The check for conflicting AOVs was done after the Render Layer node
was updated. This led to an unexpected state in the node.
* The check for conflicting AOVs did not work, because AOVs that already
had the conflict-flag set were ignored.
In 2788fa915b the `CurvesGeometry::blend_write` and `CurvesGeometry::blend_read` functions were added. Unfortunately, the commit also altered the writing logic and introduced a bug where loading a file with a converted `Curves` object would crash. See #112068.
This PR fixes the issue by making sure that `CustomData_blend_write_prepare` is called before `BKE_id_blend_write`, which is the root cause of the crash that happens on load.
The `CurvesGeometry::blend_write` function is split into `CurvesGeometry::blend_write_prepare` and `CurvesGeometry::blend_write`.
Pull Request: #112280
Pull Request: #112366
The new split edges code from e83f46ea76 started the use of
Mesh rather than BMesh as a performance improvement. However, the code
contained a complex loop used for de-duplicating edges that gave invalid
indices in some circumstances. That was fixed by b226c115e2,
but in turn that commit caused loose edges to be skipped. That was
fixed by 111e378366, however that caused another crash.
Long story short, the code is quite complex and the existing algorithm,
while an improvement from the original, is fiddly. For example, instead
of working with just the input and output states, it adjusted topology
data for an intermediate state halfway through the change.
Fixes#109236
**Goals**
- Only use topology maps from the input mesh. This should work better
with future topology caching improvements (See !107816).
- Run de-duplication in a per-edge context to allow parallelization.
- Optimize for real world use cases when there is merging of new edges.
- Improve readability by making each step's inputs clear, improving naming,
and separating functions.
- Improve handling of loose edges.
- Reuse existing edges for the first new split edges, simplifying
edge attribute propagation.
**Tests**
New regression tests have been committed separately. Existing
tests were updated since the new code gives different indices.
Mistake in cc01bb83f6.
Above commit tried to be smart about early out, but wasnt.
Now corrected.
NOTE: fix needs to go into 3.6 LTS
Pull Request: #112292
Pull Request: #112328
Mistake in 7c48196056.
Second handle was always drawn with positions of the first handle (when
it was highlighted).
Should be good for 3.6/3.3 LTS.
Pull Request: #112219
Regression from c51467cd4c.
Above commit made the IS_ALLSELECT_EVENT more strict and now excluded
mousewheel events.
Refining IS_ALLSELECT_EVENT even further (to respect mousewheel there)
is unfortunately not easily possible since mouswheel events are excluded
from `win->eventstate` (could only be retrieved from `win->event_queue`
but that is not reliable either since it might have events that are not
handled yet).
Possible solutions:
___
Adding mouswheel events to `win->eventstate`
- seemed to risky (could not forsee all possible consequences this would
have, e.g. double-click behavior)
___
Moving shortcuts for button array copy/paste from ALT to SHIFT
- downside: breaking user habits
- upside: additionally holding ALT could open the door for pasting on
all selected items
-- downside: without further work to make paste to multiple work better,
it would bring back #108096
___
So propose to do what was first suggested in #108270 as a third
solution:
Instead of refining IS_ALLSELECT_EVENT, bring it back to the state
before c51467cd4c (So `Ctrl + Alt + V` would still pass this test), but
specifically "filter out `Ctrl + Alt + V` right after in ui_apply_but().
Pull Request: #112095
Caused by 62d9e55eec
Grease pencil channels are not added to the `anim_data` list when
`ANIMFILTER_FCURVESONLY` is set. So skip this filter-type when GP
animdata is present.
Pull Request: #111377
Caused by 346023b457.
Above commit made variables too local (starting index with zero in each
nurb of the curve/surface object, but we need the "overall" index).
Should be good for LTS.
Pull Request: #112222
The line `oxr_binding.egl.getProcAddress = eglGetProcAddress` supposedly
needs a type casting for it to compile successfully under llvm16.
Pull Request: #111915
This is a nasty gathering of several issues, main one being that 'local
collections' of 3DViews are still updated immediately instead of the
deferred update used for all other viewlayer cases.
The change in a16bcb6576 led to internal references to the Scene's
master collection to become invalid, which is the expected behavior.
But this turns the Scene's view_layers into invalid state too.
Ideally, there should never be resync of viewlayers of a scene being
deleted anyways.
For now, take the (hopefully!) safe approach of explicitely forbidding
any viewlayer update during ID deletion process, and deferring it at the
end of the process.
Note that this change may also give some marginal gerformance
improvements in some rare edge cases (like deleting a very heavy scene
with many collections and 'local collection' 3DViews ?).
This fix makes it so the circular brush is fitted into the square
texture. This seems to be the most straightforward way to resolve
confusion of the inter-dependencies between different brush and
texture options.
Pull Request: #110896
`NLASTRIP_TYPE_TRANSITION` was being used incorrectly as a flag, having
`NLASTRIP_TYPE_TRANSITION=1` and `NLASTRIP_TYPE_SOUND=3` in the enum
`eNlaStrip_Type`, when evaluating `NLASTRIP_TYPE_SOUND &
NLASTRIP_TYPE_TRANSITION` gives a invalid truish value.
Also `strips` that can't be placed were freed, but no removed from the
`strips list`, this will cause a error if the `strip` is at begin
or end of the list.
Pull Request: #110605
Cycles oneAPI kernel library was compiled using -ffast-math. The current
version of Clang makes it link to crtfastmath.o in that case, bringing a
static constructor that does set the FTZ/DAZ bits in MXCSR for the whole
program, leading to unwanted behavior with other components.
Instead of -ffast-math, we switch to a safer subset of compile flags.
Pull Request: #111708
Regression from c3dfe1e204.
Above commit put a dummy dragable button over the filename (well, to
allow dragging). Enabling drag ripples down to the button ending up in
the `BUTTON_STATE_HIGHLIGHT` state [which is still good of course].
However, `ui_do_but_EXIT` will then return `WM_UI_HANDLER_BREAK` which
then results in the filebrowser operator being skipped.
`ui_do_but_EXIT` already had a special case for file-browser drag button
[which would return `WM_UI_HANDLER_CONTINUE` instead]. Formerly this was
just the icon, now it is the icon and filename label. So in order to fix
this, remove the explicit check for the `but->imb` which will then
include the dragable label button in the exception for returning
`WM_UI_HANDLER_CONTINUE`.
Fixes#111645.
Pull Request: #111693
With such small proxy sizes (combined with a small blur radius), the
kernels `halfWidth` can get zero, which leads to a memory allocation of
same zero size and writing to that memory leads to overflow/crashes/can
only go downhill from there.
Now early out in such cases [which leads to
slightly different output -- well if the "buggy" output survives and
does not crash that is].
(alternatively we could just prevent the overflow and still let do
`RVBlurBitmap2_float` do stuff that it really shouldnt imo, see first version of the PR)
Pull Request: #111660
`LayerTypeInfo` can define a `layers_max()` function which determines the
maximum allowed number of layers.
Upon merging, this limit was respected from the source, but not on the
destination, so it was possible to exceed the max (if there were layers
on the destination already).
NOTE: `layers_max()` is currently only defined for legacy CD_MTFACE, but
we might want to enforce this for UVs / CD_PROP_FLOAT2 again.
This came up in #111608.
Pull Request: #111609
Currently, while calculating face corner normals, Blender retrieves
custom normal data with write access. When the the custom normals in a
single smooth corner fan don't match, they are reset to the average
value.
This behavior is very old, but it comes from when Blender didn't have a
strong idea of const correctness. Indeed, modifying custom normal data
while calculating normals isn't threadsafe, which is important because
normals are calculated for viewport drawing, for example. And in the
future, properly caching face corner normals (see #93551) will require
the ability to calculate normals on a properly const mesh.
The fix is to still use the average of custom normals in a fan, but
not write that back to the custom data array. In my testing the results
are the same. Setting custom normals still fills the same value for all
corners in a fan.
Pull Request: #110478
Pull Request: #112055
This was caused by 56659f1510.
The line added by this patch was added by the reverted 82ca3d3604, but should not have been reverted. It was not obvious enough that two different things were changed by the same patch.
Pull Request: #111958
The loop was ignoring ` nu->pntsv` in this case, resulting in only the
first point of each row being used for snapping.
This commit also simplifies the code by removing the no-snap limitation
when the curve only has 1 point.
This limitation existed because the curve is not visible in this case.
But this is contradictory for when the curve has loose points (which
are also not visible).
Regression introduced in 69d6222481.
In that commit the `Depth` option of the placement started to override
the snap toggle. So only the `Suface` value had snap.
This commit also changes the behavior when triggering Placement.
Previously, snapping was forcefully enabled (in the case of `Surface`)
and snapping elements other than Face were used.
Now snap is only enabled if toggle is enabled.
This affected sculpt, vertex- and weightpaint.
So attempting to (temporarily) switching to the smooth/blur tools from
another tool using the "Shift" shortcut can fail if the corresponding
smooth/blur brush is not found/missing [which was the case in the report
because the brush was deleted].
In this case, brushes dont really get switched, but blender would still
try to cache the size (because the smooth/blur brush temporarily uses
the same size as the previous brush) of the smooth brush in
`StrokeCache` (see `smooth_brush_toggle_on`). Then in
`smooth_brush_toggle_off` it was assumed brushes were actually switched
and the (non-existing) size of the (missing) smooth brush was applied to
the **actual** brush.
Now restructure code a bit so in the case of a missing brush we can
early out (without affecting the **actual** brush then).
Pull Request: #111516
Pull Request: #111977
Registering a node with a `bl_idname` same as a built-in node will lead
to crash because `rna_Node_unregister` does not check `nt->rna_ext.data`
to see whether it's not null (which indicates whether this node is
registered with python or not). Now fixed.
Pull Request: #111615
If this is not a system override, this leads to the override actually
being reset (which might affect the 3Dview and most probably affects the
Properties Editor).
Now use the same modifiers as used elsewhere for resetting a library
override.
Pull Request: #111469
Previously `SEQ_modifier_list_copy` in append mode does not ensure
unique strip name, which will result in duplicated names in target
modifier list, then `strip_modifier_remove(name="something")` can remove
the wrong one later on. Now fixed using `BLI_uniquename`.
Pull Request: #111602
The code ensuring that an object (or obdata) is not made local if it is
used by linked data that is not tagged to be made local was blatantly
buggy, leading to over-detecting such cases.
Note that this code remains fairly fragile imho, think the whole Main
data-base of IDs should be checked, other data-types than Objects can
use objects! But this is for another day.
Status of selected bold, italics, underline, and small caps requires
that the curve have an editfont object. Not checking for this works
interactively but can cause errors in Python. This PR adds explicit
getters and setters that check for editfont.
Pull Request: #110513
Specifying the correct operator context (`INVOKE_REGION_CHANNELS` in
this case) is mandatory, otherwise looking up the shortcut in
`wm_keymap_item_find_props` will fetch the wrong region
(`RGN_TYPE_WINDOW` not `RGN_TYPE_CHANNELS`) and thus wont find the keymap
item in that region keymap.
This was already done for the other menus, not for the context menu
though.
Pull Request: #111376
Mistake in (7-year-old) f6c09eadf0.
The operator was just cancelled if the right button was found, instead
it should only cancel if the button is _not_ found.
Pull Request: #111373
Since menus are created flipped (from event handling point of view), the
root layout block needs to be flagged `UI_BLOCK_IS_FLIP`.
This was missing for a couple of `uiMenuCreateFunc`, namely:
- creating worspaces menu
- modifiers extra ops
- constraints extra ops
- GP modifiers extra ops
- GP Shader FX extra ops
Same fix as f51de2246c.
Not crtitcal, but could go into LTS I guess.
Pull Request: #111341
WM_report on the unlikely event when an area (smaller than minimums) is
within the combined operation bounds (close or join) and interferes.
Pull Request: #111280
Fixes NaN in Vector Displacement node caused by the normalization of
0, 0, 0 vectors.
This fixes both visual rendering issues and an "illegal address" error
on the GPU. The "illegal address" error came from the Light Tree
Sampling code not handling the NaN normals well, leading to weird code
paths being taken, eventually leading to a kernel_assert and a
user facing illegal address error.
Pull Request: #111294
When the temporary File Browser uses a maximized editor, it reuses the
File/Asset Browser under the cursor. When the file browsing action is
confirmed, the old editor state is restored but the file-list cleared,
so it fails to find the active asset and the ID it represents in
context.
Work around this by getting the ID before spawning the File Browser from
the operator.
When copying (CTRL+L->Animation Data) a driver between two objects
that are linked with library overrides, `AnimData` was not created.
This did crash Blender when it tried to use the `nullptr`
The reason it crashed is because the function
`DEG_id_tag_update()`
was never called.
Fix it by restructuring the code so the function gets called
Pull Request: #110795
Bug identified in #110942.
In cases where the last corners of a polygon are out of context, the
`weld_iter_loop_of_poly_next` iterator skips these corners.
This means that some corners of the resulting mesh do not have the
value set, which can even result in infinite loops.
The solution was not simple. The iterator had to be practically redone
to not use the `loop_end` member (which caused the problem).
Fortunately the code is more simplified with this change.
Pull Request: #110982
When swapping strips, if the strips overlapped after the swap, one
of them would get deleted. We now check if they would overlap
ahead of time, and simply abort the swap instead.
Pull Request: #109980
Pull Request: #111957
Reason was a difference in poll functions (dropbox poll function vs.
operator poll function).
So the dropbox was actually recognized as being active (see
`dropbox_active`) but then when actually dropping, the corresponding
operator wasnt called (but instead another operator was).
In detail, the way `wm_handlers_do_intern` works, it checks all
dropboxes poll function if one succeeds it calls the dropbox operator.
But if that operators poll function fails, `wm_handlers_do_intern`
happily continues and "ends" the drop operations in a way we dont
actually get to the "real" dropbox & operator that was also recognized
as being active.
In the case of the report:
- dropbox for `UI_OT_drop_name` is active
- dropbox poll for `NODE_OT_add_object` (`node_object_drop_poll`)
succeeds though
- operator poll for `NODE_OT_add_object` (`node_add_object_poll`) fails
(it checks `UI_but_active_drop_name` already)
So in order to make this work, add the check for `UI_but_active_drop_name` to two dropbox poll
functions (and remove from the operator polls).
Probably good for LTS as well.
Pull Request: #110929
When the mouse cursor is between editors ignore scroller zones, which
overflow their areas, so that screen edges are always detected.
Pull Request: #110402
The `BPy_IDPropertyUIManager` takes different keywords for different
data types in its `update` methods.
Booleans and Strings only handle defaults and description while Floats
and Ints can handle additional stuff like min/max.
(see `idprop_ui_data_update_string` vs. e.g.
`idprop_ui_data_update_float`)
There was a different code path in `rna_idprop_ui_create` for bools
already (only passing a subset to `update`), now use this for string as
well since it matches.
Bug introduced in 8b9a3b94fc.
Probably good for LTS.
Pull Request: #110935
The new keyframe jumping code for the graph editor did not respect the NLA strip offset.
This patch fixes that by applying `ANIM_nla_mapping_apply_fcurve`
Technical side note: `FCurve *` lost its constness due to that
Pull Request: #110790
This commit fixes the RNA path reported from the struct owned by the
Scene.display data. Paths generated for the View3D space remain
completely broken (but whole 'space' paths are broken anyway).
Bug report #110948: a file with a polygon so large that a single line
is 140 kilobytes. The previous limit was 64kb, increase the read file
chunk limit to 256kb. Still not fully robust, would need a more
complex fix to support arbitrarily large line length limits.
Not all gizmos were hidden when "show_gizmo" was disabled (most notably
python defined gizmos).
This was working in the 3DView and the Sequencer, but not respected in
the Clip Editor and Image/UV Editors.
Now check the flag prior to `WM_gizmomap_draw`.
Probably good for LTS.
Pull Request: #110932
4.0 files now include asset shelf regions in 3D views. This region type is not
known to older Blender versions. So far, in such cases we would just change
the region type to be the first known region type and keep the region storage
otherwise. This was arbitrary, and in fact unsafe: the reused settings may
violate invariants/assumptions for a region type and worse, the
`ARegion.regiondata` can only be interpreted and correctly written to files
if the region type is known.
Make sure all invalid regions (regions where the type cannot be restored) are
removed on file read.
Pull Request: #111483
The commit that this reverts fixed the rest position attribute, which
wasn't added in edit mode, since the modifier evaluation is different.
The change was simple, but caused quite a few problems because it broke
the assumption in places that the evaluated result of the mesh modifier
stack in edit mode was also a BMesh rather than a mesh. In main this
has been resolved by a refactor, 91b27ab637, but that change
is too complex to backport to 3.6. As discussed in the most recent nodes
module meeting, this reverts the original fix. That does mean that
the rest position attribute won't function properly in edit mode.
Fixes#110136, #110925, #109301, #109432
This reverts commit 82ca3d3604.
Pull Request: #111396
When choosing the new 'overwrite' option when trying to save a blendfile
from a newer version of Blender, it would cause invalid (use-after-free)
memory access.
Issue caused by the main commit (a1d7ec7139) of the new blendfile
compatibility handling. No idea how it was not detected earlier.
Many thanks to @weizhen for spotting the issue and doing some initial
investigation on it.
Somehow the backport for 3.6 diverged from commits to main (4.0), and
the case were the DNA block would go missing would not anymore prevent
handling of further `is_minversion_older_than_blender` test in
`blo_decode_and_check`.
There were two separate issues occurring here:
With some other recent changes to curve handles, an early exit was
added when the handles should not display, however, this early exit
was not discarding geometry in the Metal implentation, but leaving
values undefined. Resulting in random geometry flickering on screen.
This may not previously have happened in certain modes if the vertex
buffers were zero-initialised up-front (which only happens with certain
debug flags).
Curve handle geometry generation would render incorrectly when
outputting triangleStrips IF the transparent border was disabled.
Authored by Apple: Michael Parkin-White
Pull Request: #110719
Pull Request: #111044
When keys were not perfectly on the frame, the index logic
would fail and duplicate data across 2 frames.
Using `round()` solves this. It does not add subframe support though.
Pull Request: #110059
Naming is bad and confusing, but the 'expander' code path from readfile
can also be used outside of the reading context (see e.g.
`BKE_blendfile_write_partial` code). So code cannot assume that it is
exclusively working on data freshly read from file.
This should be renamed - but should also be probably replaced by
proper usage of the more generic 'foreach_id' code anyway, see #105134.
Found while investigating #109588.
Regression caused by 03f17c42d0
In that commit it was assumed that the hotkey modifier `S` had no
influence if we were already resizing.
But this is not the case in tracking. The second `S` has influence and
should not be filtered.
The solution is to add a conditional only to Trackers transformation.
This commit also fixed the canceling of this transformation which did
not revert the search area to its original value.
#109460 was caused by the introduction of implicit sharing for custom
data layers (7eee378eccc8f87e17). Due to implicit sharing, the vertex
weight layer is now shared between the original and evaluated object in
object/weight paint mode, but not in edit mode because of bmesh. For
that reason, the original data has to be copied to be able to edit it, which
causes its pointer to change. `uiDefButF` can't deal with the situation when
the pointer changes on every redraw.
The solution is to just use an intermediate variable that is passed to the
`uiBut` and to update the vertex weight only when the intermediate value has
changed.
Pull Request: #109665
Strip was removed from `seqbase` prior to calling
`SEQ_edit_remove_flagged_sequences()` which resulted in strip not being
actually removed, and it could be seen in timeline while being active.
Commit `c9be925f7d` fixed files for studio, that were saved in incorrect
state. This also attempted to fix unaffected files.
In affected files `seq->startofs` did overflow. Sound strips are not
expected to have negative `startofs` and therefore fix in `c9be925f7d`
can be limited to broken files by checking `startofs` value.
The wrong RNA pointers were passed (passing the root ones instead of the
ones actually owning the rna-path-resolved property).
This was likely a harmless mistake, since it only affected RNA
collections of IDs, afaik we currently don't have many (if any) of these
in non-ID RNA structures. The children collections and objects in a
Collection data-block RNA structure e.g. were not affected.
But the potential consequence of that bug would have been missing
automatic detection of some needed liboverride resyncs.
In case a blend file opening fails (in the context of library content
listing, e.g. for linking or appending), the File Browser would just
show an emtpy window.
With the new comnpatibility policy, this will now become a fairly common
situation, which requires giving proper explanations to the user.
This commit re-uses and extends the system used to display errors
messages from the Asset browser.
Part of #109151 (PR !110109).
Pull Request: #110568
This implements the main aspects of changes to blendfile compatibility
as designed in #109151:
* Blender files which file minversion is newer than current Blender
executable won't be loaded at all.
* Blender files which file version is newer than current Blender will
triger systematic warning to user:
* In the status info bar (lower right corner in default UI).
* When attempting to save (overwrite) them.
This means that the file minversion becomes a hard limit, and not a
soft, warning-only as it used to be. Further more, forward compatibility
warning is now systematic (instead of depending on file minversion),
and more visible for users.
See also https://wiki.blender.org/wiki/Process/Compatibility_Handling
for details over the new policy.
Technically:
* Opening any file with a minversion newer than current Blender file one
now triggers an early abort, with an error message reported to the user.
This is handled by a new utils called from `blo_decode_and_check`.
* Any file newer than current Blender version sets a new
`has_forward_compatibility_issues` flag in Main struct at read time.
* Status bar info area is turned into a template, which uses this flag
to display special warning UI and tooltip when set.
* A new confirmation popup appears when user tries to save (overwrite)
such a 'newer' blendfile, stating potential loos of data, and
proposing by default to 'save as' instead.
* The 'quit unsaved' popup has also been updated to 'save as' instead of
'save' when the edited file is has potential forward compitibility
issues.
NOTE: For 3.6LTS, an additional hot-fix is applied on read file
minversion, to ensure that all files from early 4.0 develpment stages
remain readable in Blender 3.6LTS after this commit.
Part of #109151 (PR !110109).
Since in rare cases there may be needs to expose file subversion here,
the following format was defined:
<major>.<minor> (sub <subversion>)
Part of #109151 (PR !110109).
Regression in [0] changed the order of execution for the load_post
handler which previously (in 3.5x) ran before driver evaluation.
Calling either load_post/load_post_fail handlers after loading was
changed intentionally to simplify the code-path for calling handlers
however it meant the handler couldn't be used to setup drivers,
so restore the original logic.
Back ported to 3.6 from [1].
[0]: 46be42f6b1
[1]: c6725b935c
Pull Request: #110448
The edited mesh is not occluded even with Xray alpha 1.0, but it still
occludes other meshes that are not in edit mode.
Therefore, to resolve, alpha is still considered in general occlusion,
but is ignored in occlusion of edited meshes.
Co-authored-by: Philipp Oeser <philipp@blender.org>
Pull Request: #110263
USD has recently renamed their repository from USD to OpenUSD leading
to a change in the URI for this dep and the hash for the previously
released USD 23.05 since the tarball now will have the source in the
OpenUSD-23.05 folder.
Even if a text datablock was "used" by in the Text Editor, it would be
lost after save/reload if no fake user is set.
This is not in line with other datablocks if they are used by an editor
(e.g. images, clips, masks etc.).
Now handle this with `IDWALK_CB_USER_ONE` (instead of `IDWALK_CB_NOP`)
in `id_refcount_recompute_callback` >
`BKE_screen_foreach_id_screen_area` which re-ensures a user is set.
(Bit on shaky ground here, but this seems like this is how this is
handled for other editors "consuming" a datablock).
Pull Request: #110344
Clipping should use `clipr`instead of `curr`.
`clipr` is for value clipping while `curr` is for curve view clipping,
misuse of these two can lead to output value being clipped by
viewing range. Now fixed.
Pull Request: #106164
When an offline render was done side by side render preview, further
render preview updates requiring BVH to be rebuilt would trigger a
crash.
This will be fixed upstream the same way in Embree 4.2.
Pull Request: #109966
Use modifier keys that are pressed before activating a new window.
Allows call of `wm_window_update_eventstate_modifiers` on
`GHOST_kEventWindowActivate` by using `GetAsyncKeyState` instead of
`GetKeyState` in GHOST_SystemWin32::getModifierKeys, which retrieves
actual hardware state.
Pull Request: #110020
Allows Win32 key repeat filtering to support multiple simultaneously
repeating keys, as can happen with modifiers. Removes
m_keycode_last_repeat_key and instead checks current down status.
Pull Request: #109991
When the override property over a non-ID RNA pointer is not needed
anymore, remove it.
This case is a bit special, because the match does (potentially) detect
differences within the RNA structures pointed to by the property, yet
there should be no override rule for the property itself.
An override rule may have been created in a previous diffing if one of
the RNA pointers was null.
Note that while fairly rare, this is not a corner-case, as it affects at
least one (very common) RNA pointer: the 'animation_data' one.
This left-over rule (created when the liboverride is animated, while the
linked reference data would have no anim data, and becoming useless once
both have anim data) was harmless so far, but would become a problem
with up-coming changes related to #110067.
Pull Request: #109704
Update #BKE_lib_override_library_id_unused_cleanup to also clear the
property when all its operations have been removed, even if the
property itself was not tagged as unused.
These tests now have basic coverage of:
* Linking data and creating liboverride hierarchy from it.
* Linking that liboverride again.
* Creating liboverride of liboverride.
* Modifying data hierarchy in the library, and testing (recursive)
resync of it.
* ID name collision handling (between modified linked data and
existing overrides).
In case the reference data of a liboverride is aslo a liboverride, and
is already tagged for resync, the override of the override also needs to
be resynced.
Note that linked overrides are guaranteed to be processed by apply code
(and hence get checked for needed resync) before the liboverrides using
them.
Code in charge of fixing invalid liboverride hierarchy roots would be
too agressive in re-assigning new root in replacement of old one. When
the invalid initial case was a 'low-level' type of ID (like a nodetree
e.g.), it could 'contaminate' many valid data (objects etc.) and force
them into its own local hierarchy.
This commit fixes the issue by storing all 'processed as valid' IDs into
a set, and ensuring that once an ID has been put into that set, its
hierarchy root is not changed anymore.
in other words, it changes the old behavior of 'last encountered hierarchy
wins' to 'first encountered hierarchy wins'. Since higher-level types of
IDs (like collections or objects) are processed first, this is the
most logical behavior too.
While in theory RNA collections of IDs will have unique names in common
use cases, it can happen that there are naming collisions (due to a same
RNA collection having ID pointers to data from different libraries,
having the same name).
This situation is deadly for liboverride applying code, since it rely on
finding which item of the collection to modify by using its name.
To alleviate the problem, this commit changes the way items are searched
for, by adding an extra first check to find an item which matches both
the requested name and index.
While not perfect, this should reduce the breaking cases when production
files get dirty and start having complex mangling of override and linked
data naming.
Code was only considering RNA pointer properties to IDs, but not the
case of RNA collections of ID pointers (like e.g. the Collections' `objects`
property).
This would result in 'resync enforce' fixing tool not working properly
e.g. on liboverride collections' objects.
When the parent ID pointer of an object is a 'system override' (i.e.
matches hierarchy-wise the parent of the linked reference object, or
actually use the same linked object), also clear potential liboverrides
for the other related parenting properties.
This is especially critical for the parent inverse matrix, otherwise if
it ever gets out of sync, in case of re-parenting in the lib data, the
offset would remain and move the liboverride child object into random
places.
NOTE: This may break some very specific workflows where users would rely
on actually overridden parent invert matrix. Not much to be done here,
there is currently no way to support both cases. This is not expected to
be a common use case.
While setting the parent object itself already had its dedicated
liboverride apply function to avoid resetting other related properties
like the invert parent matrix, other related properties also had custom
setter callbacks with similar effect.
This commit fixes the propblem for the `parent_bone` and `parent_type`
properties by adding a custom liboverride apply callback for them too.
The paint code doesn't invoke `stroke->redraw`
on `INBETWEEN_MOUSEMOVE` events. This causes
drawing lag on devices that tends to generate
more of them, like pen tablets.
The code no longer does this. It does still exclude
inbetween events for updating the paint cursor.
I checked, and only the two paint modes (3d texture paint and image paint) actually
use `stroke->redraw`. Both are implemented to only draw when necessary:
* `paint_2d_redraw` checks for `.need_redraw` flag on tiles.
* `paint_proj_redraw` checks `ProjStrokeHandle.need_redraw`.
I believe this may be the cause of #93796
Pull Request: #110119
Pull Request: #110954
This affected `Mesh Deform`, `Corrective Smooth` and `Laplacian Smooth`.
Exposed by 57ea827bfb (e5ec04d73c).
Evaluating the incoming mesh can be different in
`BKE_object_handle_data_update` as opposed to
`object_force_modifier_update_for_bind` due to different
`CustomData_MeshMasks` being used (the former used a handpicked set, the
later was still using `CD_MASK_BAREMESH`). But since moving many
relevant [to modifiers] data to attributes, this could lead to binding go
wrong (e.g. reporting a vertex count mismatch as reported in #110021
which was due to the fact that creases were not propagated and that
changed the output [also vertex count] of a subdivision modifier in the
stack).
Now use `CD_MASK_DERIVEDMESH` in `object_force_modifier_update_for_bind`
to get all relevant attributes for evaluation (this is not used in `BKE_object_handle_data_update`
to avoid a big performance impact there).
Also fixes#109626 afaict.
Should probably go into 3.6 LTS (maybe even 3.3 LTS).
Pull Request: #110095
The grab tool could crash when applied to a Grease Pencil object with a
Subdivide modifier (or any other modifier that changes the number of
points in strokes). This patch prevents the grab tool from crashing.
- Removed a grab tool exception that was no longer necessary.
- Added a missing null check.
Pull Request: #110078
The `UCKeyTranslate` function was being used wrong.
The `deadKeyState` param should use `kUCKeyTranslateNoDeadKeysMask`
instead of `kUCKeyTranslateNoDeadKeysBit` (optionally could also use
`(1 << kUCKeyTranslateNoDeadKeysBit`)).
This commit also dispenses with accessing the keyAction, as this is not
crucial for determining the key.
Comments have also been added to better describe the code.
Pull Request: #109987
This reverts commit b226c115e2.
Fixes#110005.
I have been working on a fix branch, but the problem was fairly
fundamental to the algorithm and the fix ended up being a rewrite
that I didn't quite finish yet, and I will be away next week. Since
the other bug is a crash rather than a change in behavior, better to
have the other bug than this one in the meantime.
Changes to the kernel source would not update the HIP RT binaries, leading
to render errors due to the kernel being mismatched with Blender.
The code this was copied from was inside a macro that defines the sources
variable, but it's not defined here.
Ref #109418
Pull Request: #110073
`Project Individual Elements` was never supported for `Vert Slide` and
`Edge Slide`, however, albeit erroneously, this option still affected
those operations.
In Blender 3.6 this situation of `Project Individual Elements`
affecting the result, has been "fixed". But users still preferred the
old behavior.
Therefore, instead of falling back to `Snap To Face`, support
`Project Individual Elements` for `Vert Slide` and `Edge Slide`.
This is more like how it worked previously.
Pull Request: #109656
This commit applies the latest changes to the merge by distance code.
All are related to the `do_mix_vert_data` feature.
This feature is essential for fixing #109565.
The commits are (from newest to oldest):
- 36b2291610
- 7aa31c884d
- e9aba52f42
- 1457c0c533
- 113004687d
- 74772c6920
The internal `use_occlusion_test` option was only being removed if it
was in conjunction with the `Snap to Face` option.
Both test occlusion and Snap to Face are conflicting. In wireframe mode
the objects are not occluded, but Snap to Face can prevent them from
being snapped.
The solution is to prioritize snapping to other non-Face elements but
still allow "Snap to Face" in X-Ray mode.
Pull Request: #109445
In RNA collections cases, the cleaning code was buggy and could end up
never cleaning actually unused liboverride operations, resulting in
sometimes tens of garbage operations on e.g. Collection's objects list.
This was a fairly severe bug, since it could lead to very broken
overrides of collections in some cases when things start to get broken
in the production file, amplifying greatly initially small issues.
`outliner_do_scene_operation` wasnt recursive, so it only acted on the
top-level `TreeElement` (which was fine for Scenes view, but failed in
`Blender File` view).
Now use an iterator that handles open subhierarchies as well.
Pull Request: #109810
Pull Request: #110011
Caused by 7a943428de
Looking at history, e.g. 575ade22d4 or prior, it seems the
"fallthrough" [related compiler warning was removed in 7a943428de] was
actually intended in the case of `VPAINT_TOOL_AVERAGE`.
So first, the average color is calculated and after that regular drawing
should happen with that color.
Now make this more clear by calling both `calculate_average_color` as
well as `vpaint_do_draw` before breaking.
Pull Request: #109971
Selecting a rigid body world collection is supposed to set up rigid
bodies for all of its mesh members (if they are not rigid bodies
already), expected result would be just the same as if `Object` > `Rigid
Body` > `Add ...` was used.
Doing it via just the world collection had the following issues though:
- calculating mass would crash on such a freshly created rigid body
objects (be1b32e4e4 falsely assumed `ob->rigidbody_object` is always
present on evaluated objects -- without tagging for depsgraph updates
this is not the case though)
- rigid body simulation would not work even on these freshly created
rigid body objects
Now tag bmain relations and object transforms for update to make both of
these work (following code in `BKE_rigidbody_add_object` that is used
when adding these through `Object` > `Rigid Body` > `Add ...`)
Pull Request: #109961
Users were reporting offset issues when the retopology overlay
was disabled. The reason those issues were happening is because of
`vs_offset = min(vs_offset, vs_z * -0.5);`.
That line is necessary for proper functioning of the retopology
overlay, but causes issues at lower offset values (such as zero, when
the retopology overlay is disabled).
Fixes#109640
Pull Request: #109657
Using 0.0015f as minimum value on Apple makes sense when the retopology
overlay is enabled.
When disabled however, this will cause the shader to think the overlay
is enabled when it's not, affecting the color of faces.
Therefore the offset when disabled should always be zero.
I've removed the unnecessary define and shortened the name of the other
one.
Pull Request: #109658
The `BKE_bvhtree_from_pointcloud_get` function have requirements for
input point cloud argument and initialization of `BVHTreeFromPointCloud`
can be skipped. Due to `BVHTreeFromPointCloud` is not initialized by
default constructor, it can contains garbage data. To check if tree is
initialized field of `BVHTreeFromPointCloud`, return argument shouldn't
be ignored. `[[nodiscard]]` attributes is added.
Pull Request: #109892
Certain feature requirements unsupported by older OS builds
caused failures when running Intel GPUs on older OS's.
This patch increases the minimum required OS version
to one which covers devices supporting all required features.
Authored by Apple: Michael Parkin-White
Pull Request: #109921
Displaying the warning on file load depended on `wm->winactive`
being set, and didn't work when loading a file from the file-open
window or when loading files using a command-line argument.
Resolve using the first window as a fallback.
This happens to resolve#109770, although not freeing timers on exit
is likely to be an issue under other circumstances.
At a glance, it can be hard to see if a Shape Key has been muted or not.
This change greys out all the UI elements, instead of just the current value number.
All the functionality still works the same, purely a visual change.
Pull Request: #109857
Originally was noticed when adding drivers to a rigid body., but
it could potentially happen with any configuration.
The reason for the crash was that the ID which was modified was
not tagged as such.
Modifying drivers from the interface are likely tagging for updates
from the operator. This change makes it so the python function also
does tagging.
It is not really how one would design the system nowadays, but it
is how the Blender historically handles such cases. A bigger refactor
is possible to move tags to the places where modification actually
happens, but it seems to be a better idea to tackle it as a separate
project which will be considered no-functional-changes.
Pull Request: #109895
When blender is not focused and a selection is executed
with the mouse, since there is no conversion from `wl_fixed` to `int`,
the bounds of the selection can cause the selection box to be too large,
causing `draw_select_framebuffer_depth_only_setup` to fail when create
`g_select_buffer.texture_depth`.
Ref !109834
First we copied the entire BMesh custom data layout to the Mesh, then we
decided not to copy some boolean layers like UV pinning if every value
was false. But that left the layers uninitialized. Instead, copy the
custom data layout _after_ finding which layers to skip.
In some cases, freeing the image cache keys would not update
next/previous links - causing future updates to reference freed memory.
Also assert the `last_key` is never points to freed memory.
Try loading ROCm 5.x libraries specifically, as the .so without version
is only part of the development package.
Thanks to Lee Ringham investigating and proposing this solution.
a8a454287a which moved edge creases out of `MEdge` only
retrieved the result data array if the mesh had vertex creases. Before
the processing always happened though. So process the result creases
if the input has edge creases too.
This was unintentionally fixed in the main branch for the 4.0 series
in the 61ed5b3d24. Initially the commit seemed to not be leading to
any functional changes, but turns out it did fix a real use-case.
This commit is the minimalistic change extracted from the original
commit, making it safe to be ported to the 3.6 LTS.
Pull Request: #109727
Prior to using OIIO for image loading, DDS files were hard-coded to
always treat files with BC5/ATI2 compression as normal maps[1].
This basically means that the B channel would be reconstructed from the
R,G channels in a particular way. There is a non-standard header flag
(coming from tools like NVTT and various others) that can also be used
to indicate if such processing should take place, and OIIO understands
that flag and acts appropriately. However, not all files have that flag
set.
This patch reverts to the hard-coded behavior to match prior versions.
If the user has explicitly set the OIIO environment variable to say
otherwise, we will respect that setting instead.
[1] https://projects.blender.org/blender/blender/src/branch/blender-v3.5-release/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp#L870
Pull Request: #109541
Pull Request: #109694
Happens with specific GPUs like NVIDIA A100-SXM4-40GB. They use the
compute capability 8.0, which is not explicitly compiled as a cubin,
and since 7fca0ee76a the PTX is not suitable for it either.
The safest solution is to revert the change to a known good state,
and re-iterate as needed.
Revert "Cycles: Increase the compute model for the PTX kernel"
This reverts commit 7fca0ee76a.
This change would need to be cherry-picked to the 3.6 LTS.
Pull Request: #109636
Caused by d9f5ce2546 which moved the NLA solo button to the right, but
didnt make the backdrop behind the right-hand-side widgets bigger. So
the first widget seemed "transparent" over the channel name.
Now make the backdrop bigger if the solo button is drawn.
Pull Request: #109498
We can't take the ownership of the data of a CustomDataLayer by simply
swapping the pointers anymore, since the data is owned by the layer's
implicit sharing info. Since shape keys don't support implicit sharing
(yet?), just duplicate the layer data instead of taking ownership of it.
Co-authors listed following the `Co-authored-by:` format in a commit
message will be automatically added to the list of contributors.
Further more, it is now possible to overwrite authors informations from
git commits with embedded data, in case it is necessary to correct some
commit's author information after the commit has been pushed.
Implements #109438.
Pull Request: #109468
Caused by 968ecf6f8b.
The value of the last pivot of the view should not be changed if there
is no selection.
The variable is static precisely because of this.
Since UDIM baking support in 6787cc13d4, the normalization of
diplacement heights was always based on the min/max height detected in
the _last_ tile, which could lead to clipping if the last tile had very
subtle (or no) displacement.
Now getting the min/max is spread across all images.
This also takes the first thread into account for getting the min/max (which for some reason was skipped).
Pull Request: #109409
`uiDefAutoButR` (or actually `uiDefButR_prop` > `ui_def_but_rna` later
down the line) has this behavior when "" string is passed in, it will
not display text on or next to the button.
This is of course desired in most scenarios -- it might even be desired
for non-icon enums in certain cases (though this is already a bit harder
to find cases for), so changing behavior in said functions is probably
not what we want.
The behavior - from the dopsheet sliders - would seem like a bug though.
Passing NULL (instead of "") to `uiDefAutoButR` results in properly
displaying the chosen item on the dropdown for enums, but for other
property types it would then show the property ui name alongside the
button (which is not what we want in the dopsheet, UI names are already
drawn there separately).
So now, pass "" or NULL conditionally (depending on property type
`PROP_ENUM`).
Pull Request: #109205
Usual issue of modifying the data hierarchy while iterating on it in its
outliner representation. And usual fix for this problem (only store data
to be processed during the iteration over Outliner data, and perform the
actual operation in a single call afterwards).
This commit also tries to improve a bit the 'Clear' process when applied
to a bunch of IDs, by iterating several times over the list of IDs to
clear, and only processing 'liboverrides leaves' first. That way, if
clearing a liboverride leaves turn other liboverrides into leaves, then
can also be processed that way, instead of just being reset.
Note that this is a naive and quite imperfect solution though
(dependency islands cannot be handled that way e.g.), this feature needs
a complete re-write at some point to be more complete and consistent.
Don't think this is high priority though, as it is not really that
useful in practice afaik.
Note: This should be backported to 3.6 LTS (and maybe 3.3 LTS if
applicable).
Since d8388ef36a, the "frame_change_post" handler could not be used
anymore to detect when animation playback stopped.
This functionality is needed by certain addons though and is generally
usefull to have, so this is now added.
Related reports : #109168, #109218
Pull Request: #109232
The root of the issue was that when localizing all linked data, it makes
no sense (and there is no way) to keep liboverrides, since some linked
data would then remain linked.
The solution is then to clear any override data from localized IDs.
While simple in theory, this adds a noticeable amount of complexity to
the 'append' process, as now some IDs should remain linked, and some
should be forcefull copied (instead of directly made local), such that
the liboverride reference data remains valid.
NOTE: Appending without `Localize All` remains unchanged here, and will
keep the liboverrides untouched, since in that case having some linked
data as result of the append operation is expected.
This fix should be backported to the 3.6 LTS.
In some cases, when making a linked liboverride data local, the
liboverride data should be preserved (and therefore produce a local
liboverride data).
However, it implies that the data is not really, fully made local, since
it has (critical) dependencies to linked data.
This new option allows 'make local' code to also clear any liboverride
data in the processed ID, making it effectively fully local.
Preliminary step to solve #109004.
Originally caused by edc12436c6, the fix c4f39eab88 also had a mistake
unfortunately (double free of `UVPackIslandsData` since it already
called `pack_islands_freejob`).
Pull Request: #109377
In 3.6, the legacy to current mesh format conversion of edge creases
would crash when loading a file from 4.0, because it expected there to
be an `MEdge` array, which doesn't exist in 4.0. This didn't happen
previously because edge creases were stored in the same format for 4.0.
Other "legacy to current" format conversions have similar null checks,
it was just missing here.
Pull Request: #109386