Blender 5.0 got a theme overhaul, removing hundreds of options and
adding some more. While versioning was attempted to keep themes
looking as close as possible, some settings are impossible to guess
so they require manual editing.
Reset the theme to the default. Similarly to how it was done in other
major overhauls (2.80, 3.0).
Documentation and tools to migrate themes will be available at:
https://developer.blender.org/docs/release_notes/5.0/user_interface/
Pull Request: https://projects.blender.org/blender/blender/pulls/147637
BLI code for enums that are meant to be used as "bit flags" defined
an ENUM_OPERATORS macro in BLI_utildefines.h. This cleans up things
related to said macro:
- Move it out into a separate BLI_enum_flags.hh header, instead of
"random bag of things" that is the current place,
- Update it to no longer need manual indication of highest individual
bit value. This originally was added in a31a87f89 (2020 Oct), in
order to silence some UBSan warnings that were coming
from GPU related structures (looking at current GPU code, I don't
think this is happening anymore). However, that caused actual
user-visible bugs due to incorrectly specified max. enum bit value,
and today 14% of all usages have incorrect highest individual
bit value spelled out.
- I have reviewed all usages of operator ~ and none of them are
used for directly producing a DNA-serialized value; all the
usages are for masking out other bits for which the new ~
behavior that just flips all bits is fine.
- Make the macro define flag_is_set() function to ease check of bits
that are set in C++ enum class cases; update existing cases to use
that instead of three other ways that were used.
Pull Request: https://projects.blender.org/blender/blender/pulls/148230
Rewrite the "mesh is valid" and "validate mesh" functions to be more
agnostic of the custom data storage system, align with the changes to
topology storage in the last 5 years, be much clearer overall, more
reusable.
Each check is implemented as a separate pass over the remaining
valid geometry in the mesh, producing an IndexMask of the invalid
elements it finds. At the cost of some extra iteration over mesh elements,
this should make each requirement clearer and make it easier to
optimize and reuse each check if needed.
The code is roughly twice as fast as it was before. I measured 92ms
instead of 200ms for a 1 million vertex cube on a Ryzen 7950X.
There's a bit of low hanging fruit for further optimization too.
There are now automated tests just for the validation code as well.
For now they are very basic but they could be extended in the future.
Some non-obvious points:
- The new face offsets storage (replacing `MPoly`) upholds more
invariants by itself. Previously faces could easily overlap or leave
corners unreferenced. That doesn't really happen anymore, but
bad offset values are a more "global" problem.
- The validation code for the old "MFace" storage was removed. It is
just rebuilt when it's needed at runtime anyway, so there isn't much
point in validating it.
- The versioning code for 2.90.1 was calling the mesh validation code
to fix an issue where the extrude manifold tool could generate bad faces.
Unfortunately keeping that would mean being unable to remove the old
code, so now there's a warning to open and save the file in a previous
version instead.
- One of the main goals of the new code is better const correctness, and
working better with implicit sharing. The code now only requests mutable
copies of the mesh data if it has to change.
Part of #122398
Pull Request: https://projects.blender.org/blender/blender/pulls/148063
The issue was that the data-blocks of two different undo steps were detected to
be identical, even if the attributes changed. That's because even if the
implicitly-shared data was different, they were turned into the same pointer by
cadb3fe5c5 on write.
This patch makes it so that for undo steps, implicitly shared data does not use
the pointer stability feature (in a sense, implicit-sharing itself provides
pointer stability for undo steps already).
The main tricky aspect is that we need to know if a pointer is implicitly shared
in `writestruct_at_address_nr` and oftentimes that's called before the
corresponding shared data is actually written with `BLO_write_shared`. The
solution is to enforce that the blend-write code has to know what pointers are
implicitly-shared before they are written the first time. The simplest way to
ensure that is to call `BLO_write_shared` first. However, that's not always
possible, especially when the pointer is directly embedded in an ID. Therefore,
there is a new `BLO_write_shared_tag` function that can be used in such cases.
The undo performance for the file in #141262 is still fixed with this change.
Pull Request: https://projects.blender.org/blender/blender/pulls/148144
Forgot that the Armature's bones list only contain root bones...
Fix the versioning code.
Also adding a 'recovery' extra versioning step for files that may have
already been opened and re-saved in Blender 5.0 (though this step is
not 100% handling all cases, in case some script or add-on already
created some system properties in a bone in 5.0, the existing user
properties from 4.5 and before won't be copied over anymore).
Pull Request: https://projects.blender.org/blender/blender/pulls/148125
The issue here was that when an archive library ID is read from
blendfile (memfile undo buffer in that case), a new split main is
immediately created for it in `direct_link_library`, and the newly
read Library is assigned to its `Main::curlib` pointer.
However, in undo readfile code, when an old matching ID is found, the
new data is moved into that old address, to avoid modifying all other
unchanged ID using that re-read data-block.
For (archive) libraries, it means that their split main `curlib` pointer
also needs to be re-assigned to the re-used old address.
Pull Request: https://projects.blender.org/blender/blender/pulls/147744
Th compositor asserts when loading certain files. Those file were saved
with an invalid active viewer key, possibly due to a bug that was fixed
already in c8cb24121f, but blend files were never updated.
So starting in 5.1, we fix those files by essentially doing what
ED_node_set_active_viewer_key is supposed to do at load time during
versioning.
Pull Request: https://projects.blender.org/blender/blender/pulls/148047
Split the "Interpolation Line" theme property into three for each
interpolation mode, and use them accordingly. In the current theme
refactor, almost all theme properties of the dope sheet are getting
either removed (unused), or moved (shared). This decluttering opens up
the possibility to allow more theming, and let artists read the Dope
Sheet better.
## Avoiding Confusion
There's two "Bézier" interpolation types:
- Called "Bézier" in the interpolation type menu, and
- Called "Bézier" in the code, for the types that are labeled as
**"Easing" and "Dynamic"** in the interpolation type menu.
Since this commit is about the interpolation lines, which are **not**
drawn for the former, **this PR only covers Constant, Linear, and the
latter form of Bézier interpolation types.**
Pull Request: https://projects.blender.org/blender/blender/pulls/144255
Move the versioning code that switches the Timeline editor to Dope
Sheet from the 'first' to the 'after linking' versioning stage.
There was already versioning code that effectively turns the Dope
Sheet back into a Timeline, for pre-2.80 files, and this runs in the
'after linking' stage. The 5.0 versioning code now correctly runs
after this.
Fixes: #147742
Pull Request: https://projects.blender.org/blender/blender/pulls/147734
In certain scenarios, the Node Editor lacks the `RGN_TYPE_ASSET_SHELF` &
`RGN_TYPE_ASSET_SHELF_HEADER` regions.
That is because the versioning code from 0a0dd4ca37 only creates these
for Node Editors that are Compositors.
That does not seem right. The thing is, if you change a non-node Editor
(e.g. an Image Editor) to a Compositor editor, all is fine (`SpaceLink
*node_create` gets called, the regions set up correctly), but changing
an **existing** node editor (e.g. Shader or Geometry Nodes) to a
Compositor, no new Space gets set up (rightfully so) and we are then
missing the regions.
I dont really see an issue with having the versioning setting up shelf
regions for **all** node editors (the shelf polls will already take care
of it only showing in the Compositor) which is what this PR does.
Now we are in the unfortunate situation that people might have saved
their `startup.blend` (or other files affected by that) in the meantime,
so versioning will not kick in anymore, so we probably have to do
another versionbump (which will happen in `main`).
Pull Request: https://projects.blender.org/blender/blender/pulls/147689
This patch mixes the alpha channel of the color in the Mix mode of the
Mix node. This has no effect on EEVEE/Cycles since they do not support
alpha, but affects the Compositor, Geometry Nodes, and Texture Nodes.
Previously, the alpha of the first color was assumed, which meant mixing
two images with transparency using a mask in the compositor resulted in
part of the image having bad alpha and required manually mixing of the
alpha channel. And this is the main motivation of this patch.
Pull Request: https://projects.blender.org/blender/blender/pulls/146461
This fixes the root cause of #147541. However, the file in the report is still
in a bad shape. It needs to be resaved after this patch so that appending the
node group works as expected.
The issue was that making a data-block local did not clear the
`ID_FLAG_LINKED_AND_PACKED` flag.
Pull Request: https://projects.blender.org/blender/blender/pulls/147603
File template names are only extracted in the
`blo_is_builtin_template()` versioning function, not the template
files themselves.
This commit adds the recent "Storyboarding" template to the list of
built-in templates, which allows extracting it for translation.
Reported by Ye Gui in #43295.
Version patching keymaps was only handling new/changed key-map items.
However it's important to version patch removed key-map items so they
match the key-map items in the updated key-map and disable them.
Regression from [0] which copied the error from [1].
Resolve both by updating all key-map items.
Ref !147668
[0]: 5e2b421996
[1]: 4986f71848
Make the logic in the image editor drawing robust against configuration
when the image editor has flag "show render result from sequencer scene"
and the sequencer scene being nullptr.
It could happen when user configures image editor is such way and then
removes the sequencer scene.
Or, it could also happen when the image editor has the flag set, which
was exactly the cause of the originally reported issue. So this change
also clears the flag which was expected to be cleared. It could affect
some current files saved in the past day, but since the render operator
sets it based on the way the scene is rendered it is not too bad.
Caused by 76c03744a8
Pull Request: https://projects.blender.org/blender/blender/pulls/147630
The UI property was changed 7b97bc48d8
to a negative boolean but the boolean conversion inside EEVEE was
not inverted.
This mean that since 4.2, the default behavior for Lightprobe
volume has been broken / inverted.
To make an existing scene bake the same as before, all material
needs to have their `BackFace Culling > Light Probe Volume` options
inverted. This is done automatically through the versioning code.
The only test cases broken are the ones using default materials which
do not have their property turned off.
Release Notes should contains the compatibility breakage.
Pull Request: https://projects.blender.org/blender/blender/pulls/147218
Replace per UV map selection with a single UV selection for all UV's.
This uses the same data as UV sync select, meaning that it's no longer
possible to keep a different selection when sync-select is disabled.
There is a minor improvement to functionality - previously not possible
to de-select a single face surrounding by selected faces.
Now this is possible because true face selection is supported.
The selection from the active UV-map is converted to use the shared
selection data.
Ref !147523
Co-authored-by: Hans Goudey <hans@blender.org>
The owner library could keep invalid references to removed archive
libraries after undo.
This should fix the immediate issues reported as #147236, #147095 and #147036.
There is still a known crash, although it is harder to reproduce reliably
from the UI, so it will be handled separately. It is tracked by #147317.
This adds an overlay to the animation editors to visualize the current scene strip
in and out points in the scene timeline when the `Sync Scene Time` option in
the sequencer is used.
* Adds an overlay toggle + panel to the dopesheet.
* Adds a new theme setting (for the overlay) under
`Common` > `Animation` > `Scene Strip Range`.
* Adds the overlay drawing to the dopesheet.
Pull Request: https://projects.blender.org/blender/blender/pulls/146165
This patch adjusts the LGG Color Balance mode to operate in linear space
as opposed to sRGB space, which is more inline with other software and
is more expected to the user.
Versioning was added using pre and post gamma correction, but it is
very slightly different in the blacks because the gamma node only does
power correction.
Pull Request: https://projects.blender.org/blender/blender/pulls/147533
Adds a new operator that jumps time by a given number of frames or seconds, forward or backward.
Surprisingly, it was lacking in Blender, and prompted many users (including me) to create extensions.
This PR adds two properties: `time_jump_unit` for choosing whether to jump by frames or seconds
and `time_jump_delta` property that defines by how many frames or seconds the operator should jump,
as well as an actual operator that changes the current frame (`screen.time_jump`).
`time_jump_delta` is a float that gives users the ability to jump by half a second, for example, or by subframes.
Default is set to 1 second, which translates to as many frames jump as frame rate / frame base.
The operator is intentionally not bound by frame range, and can go in negative frames as well.
This is very important because it's extremely common to set frame range to the current workload,
but wish to see animation beyond that.
Operators are added in the new footer for animation editors alongside with pop-up menu where
properties can be changed.
Shortcuts are also added: Ctrl+Left/Right Arrow, which was surprisingly free in Blender.
Now timeline controls are:
- **Right Arrow**: Next Frame
- **Ctrl + Right Arrow**: Jump Forward (by default also Next Second)
- **Shift + Right Arrow**: Jump to End
Pull Request: https://projects.blender.org/blender/blender/pulls/140677
Support sync selection in the UV editor, with face-corner selection,
so it's possible to select individual UV vertices/edges in the UV editor
without UV's attached to the same underlying edge also becoming selected.
There is limited support for maintaining the UV selection when selecting
from the 3D viewport, common operations such as picking &
box/circle/lasso select support this, however other selection operations
such as "Select Random" or "Select Similar" will clear this data,
causing all UV's connected to selected mesh elements to become selected.
We may add support for additional operators as needed.
Details:
- UV Sync Selection is now enabled by default.
- In edit-mode the UV selection is stored in BMLoop/BMFace which are
written to custom-data layers when converted to a Mesh.
- To avoid unnecessary overhead - this data is created on demand.
Operators may clear this data - selecting all or none do so,
as there is no reason to store this data for a uniform selection.
- The Python API includes functions to synchronize the selection to/from
UV's as well as flushing based on the mode.
- Python scripts that manipulate the selection will either need to clear
this synchronized state or maintain it.
See:
- Design task: #78393.
- Implementation task: #131642.
Ref !138197
This PR changes the current behavior that closes menus that are open
when your mouse is moved out of its "safe" area (a bit wider than its
visible bounds). With this PR applied menus stay open unless you click
elsewhere, hover a neighboring menu, press escape, or select an item.
Although this PR turns off menu mouse leave, it also adds a preference
that can be used to turn it back on.
Pull Request: https://projects.blender.org/blender/blender/pulls/145523
Fixed the two most obvious entry points (actually making a linked ID
local, and making a local copy of linked data), there may be more
unusual ways to do that still hidden in the code though.
Also added a couple of 'sanity asserts' to the writefile code regarding
cases where IDs are expected to have a null deep_hash data.
The function name `for_each_callback` is ambigous (what are we iterating?)
and also doesn't align with the naming of other "for each" functions in Blender
which usually are named `foreach_<thing>` like `IndexMask::foreach_index`
or `animrig::foreach_fcurve_in_action` etc.
Pull Request: https://projects.blender.org/blender/blender/pulls/147440
Move the Copy Global Transform core add-on into Blender's code.
- The entire extension was one Python file. This PR basically splits
it into two, one for operators (in `bl_operators`) and the other for
UI panels. Those panels are registered in the 3D viewport's sidebar,
which were registered in `space_view3d`, but I made the decision
here to create a new file `space_view3d_sidebar`, because the main
file is getting too large and difficult to navigate. This PR puts
the global transform panel in this file. After this is merged, I
will do refactors to move the rest of the sidebar panels here as
well.
- `AutoKeying` class was moved into `bpy_extras/anim_utils.py` so that
it's reusable and also accessible from API, since it's generally
very useful. There were discussions about putting this somewhere,
but for now, I chose against it because creating a new file would
also mean PR would have to affect documentation generation, and
would complicate things. If we want to, we can probably create a new
module in the future.
- Little tweaks to labels and descriptions. Now that they exist
outside of the add-on context, and exist without the user explicitly
enabling them, they need to be more descriptive and tell users what
they actually do. They also need to conform to Blender's GUI
guidelines. Also tried organizing files a little by grouping
objects.
- Add-on properties (which included word `addon` in the name) have
been registered in C++, on `scene.tool_settings` with `anim_`
prefix.
Pull Request: https://projects.blender.org/blender/blender/pulls/145414
Goal of this PR is mainly to improve flexibility and of VSE layout and
screen space efficiency.
Previously, strip properties were displayed in timeline sidebar. This
was limiting, because if you want to display as much properties as
possible, the timeline area had to be taller, but this was at the
expense of space available for preview. However there is plenty of
space in properties editor, which is mostly unused in VSE. Therefore
strip properties were moved to the properties editor.
ID pinning and path displayed in top section aren't drawn, since strip
is not an ID and can not be pinned. Since there is more space for
properties, various panels are changed to be open by default.
Mainly transform and time panels, since they are used often.
There is one minor change: The waveform display property
of sound strip was previously hidden, if timeline area had per strip
waveform display overlay set. This is no longer possible to do and the
property is always visible.
Pull Request: https://projects.blender.org/blender/blender/pulls/140395
When an old file that uses regular subdivision is loaded, the adapative
settings were not applied to the existing modifiers if they weren't
already using adaptive subdivision. This results in the settings
remaining at their 0 defaults which can be surprising. E.g. the
`dicing_rate` of 0 is clamped to 0.1px which is probably not intended.
Make sure to set the correct defaults in all cases now.
Pull Request: https://projects.blender.org/blender/blender/pulls/147164