Commit Graph

29222 Commits

Author SHA1 Message Date
Nika Kutsniashvili
7f62d5d85e UI: Theme: Common colors for animation channels
Continuation of #140360

New common properties for Channel and Channel Selected,
used in animation editors.
Previously Dope Sheet, Graph Editor, NLA, and Movie Clip Editor
had separate properties for them.

Video and images inside the PR.

---

> [!important]

- Channels looked different in Dope Sheet and Graph Editor. In the former,
they were same color as the background, so only labels and icons were visible,
in the latter they had a darker color, so their outline was visible. We need to pick
which design we go for now that they're combined. I chose color from Graph
Editor for now, with alpha from Dope Sheet, since only that editor uses alpha.

---

There is a confusion with names of channel colors. In 4.5 there is:
- - "Channel" (singular, blue color) which refers to objects, actions,
and action slots that hold/combine channels.
- - "Channels" (plural, black color) which refers to individual channels.

This goes against how we name things. In theme, especially, we refer to object
colors as "Object", singular, not Objects, plular. Same goes for all elements except
this one, where individual elements are referred in plural.

To lessen the confusion, and also avoid unnecessary breaking changes in the
future (in case we want to rename blue things, which seems likely), in this PR
I swap those names. Main reason is that black color marks individual channels,
so it should be singular, and blue colors are combination of many channels,
so they should be plural. Otherwise even talking about them is awkward.

Note that renaming isn't a breaking change, because we already "broke" them
by moving them to common path from individual editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/146091
2025-09-12 14:49:27 +02:00
Campbell Barton
1e2ed785f7 Cleanup: use assume attribute to quiet array bounds warning for GCC 15
Ref !146150
2025-09-12 22:03:35 +10:00
Nika Kutsniashvili
534b5f1f4f UI: Theme: Shared regions
Continuing recent attempts to combine theme settings
and reduce complexity. part of #140360
This PR adds new root panel in theme called "Regions" which for now
includes two subpanels:

# Asset Shelf
This is just moving asset shelf from root to regions, where
it's more appropriate and less noisy.
No functional changes. (alternative to #144267)

# Channels
Previously known as "Theme Space List", or "Source List",
but in user interface we refer this region as "Channels".
This region is shared by all animation/video editors, and each had
a separate panel for theme properties. Now they're combined, and all
editors follow settings defined in Regions -> Channels.

Additionally, "Source List Title" property, which was never used is removed.
Properties are also renamed to be more intuitive and shorter.

# Toolbar / Sidebar
Previously was registered separately on every single editor. This allowed
for some extra customization, but in 5.0 need for this is reduced very much,
because elements drawn in those regions (tabs & tools) are also generalized,
so it makes sense to want same background color for them as well.

> This replaces 46 properties with 5, reducing the total by 41.
> Videos in PR

Pull Request: https://projects.blender.org/blender/blender/pulls/145609
2025-09-12 13:22:50 +02:00
Bastien Montagne
8d985f38de Fix broken build.
Broken by 6cb2226f13, due to very recent refactor in 84511b8509...
2025-09-12 12:05:21 +02:00
Jacques Lucke
6cb2226f13 Refactor: IDProperty: accelerate looking up properties by name
Currently, `IDP_GetPropertyFromGroup` is a common bottleneck because it has to
iterate over all properties to find the one with the right name.

This patch adds a hash table to id property groups that finding properties by
name in O(1) instead of O(n). The main tricky aspect is to find all the places
where this needs to be created/updated/freed. I tried to find all places but if
I missed some place, it should be easy to fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/140907
2025-09-12 11:34:38 +02:00
Campbell Barton
84511b8509 Core: add type checks to ID property accessors
Since moving the C++ ID property access macros cast "const" away,
replace with get/set accessors and add asserts that correct types
are used.
2025-09-12 06:29:42 +00:00
Campbell Barton
975f42b7b2 Cleanup: use doxygen comments to end groups 2025-09-12 10:19:56 +10:00
Sean Kim
a426e70bf6 Fix: Use new USER_DEVELOPER_TOOL_TEST macro where appropriate
Missed in fb91e576ca

Changes all of the non-sanitized, always available options to use the
new macro to match previous behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/146118
2025-09-12 01:42:52 +02:00
Christoph Lendenfeld
baafbd8e95 Anim: Remove PBONE_SELECTABLE macro
This patch replaces the `PBONE_SELECTABLE` macro with functions.
There is a slight functional change in that for pose bones: the visibility
is now correctly accounted for. Before this change it would always look
at the `Bone` visibility. This is no longer the correct way to
check for that since a43359eb88
moved that to the pose bone

Part of #138482

Pull Request: https://projects.blender.org/blender/blender/pulls/145974
2025-09-11 10:00:13 +02:00
Sean Kim
0b19cb35b6 Cleanup: Various organizational changes for brush.cc
* Reformats comment, moves it near related code
* Adds doxygen section
* Reorganizes function order

Pull Request: https://projects.blender.org/blender/blender/pulls/146050
2025-09-11 05:01:37 +02:00
Sean Kim
e9295fad65 Sculpt: Avoid setting vertex normal to the zero vector
It is possible for the simple vertex normal calculated during Paint
BVH normal updates to have a length of 0 if the connected faces cancel
each other out. This is a generally unlikely scenario, but will almost
always lead to further corruption of the mesh with the new normal.

If we detect this case, set the vertex normal to (0, 0, 1)

Pull Request: https://projects.blender.org/blender/blender/pulls/146004
2025-09-11 01:20:10 +02:00
Sergey Sharybin
3ef2df3893 Cycles: Remove Use Tiling option
Always enforce tiling of some size, up to the 8k tile size.

Rendering very big images without tiles have a lot of challenges.
While solving those challenges is not impossible, it does not seem to
be a practical time investment.

The internals of the way how Cycles work, including Cycles Standalone
is not affected by this change.

A possible downside is that path guiding might not work exactly how one
would expect it to due to lack of information sharing across multiple
tiles. This is something that never worked nicely, and camera animation
and border render has the same issues, so it is not considered a stopper
for this change.

Fixes #145900

Co-authored-by: Brecht Van Lommel <brecht@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/146031
2025-09-10 17:15:07 +02:00
Hans Goudey
5afaa1c4bd Nodes: Move value to Combine XYZ from link-drag-search
Same as was implemented for some other cases in commits like
1a4c16a784

Pull Request: https://projects.blender.org/blender/blender/pulls/146033
2025-09-10 16:59:29 +02:00
Brecht Van Lommel
6d25aad41f Cycles: Remove Alembic procedural
This was added for a fairly specialezed use case and is no longer being used
as far as we know. A future replacement would be to add a USD/Hydra procedural,
for which most of the groundwork already exists.

Pull Request: https://projects.blender.org/blender/blender/pulls/146021
2025-09-10 16:39:01 +02:00
Jacques Lucke
0484738f8b Fix: Geometry Nodes: false warning when passing gizmo data through instance-only nodes
There was a `Realized data in input geometry is ignored` warning when passing
gizmo data through instance-only nodes. This was because the node thought that
this data is "realized data" (like a mesh, curves, etc). This patch removes the
warning by making the check for realized data more precise.

Pull Request: https://projects.blender.org/blender/blender/pulls/146014
2025-09-10 11:29:43 +02:00
Jacques Lucke
32c301e3cf Shader Nodes: support repeat zones, closures and bundles
This adds a function that can turn an existing `bNodeTree` into an inlined one.
The new node tree has all node groups, repeat zones, closures and bundles
inlined. So it's just a flat tree that ideally can be consumed easily by render
engines. As part of the process, it also does constant folding.

The goal is to support more advanced features from geometry nodes (repeat zones,
etc.) in shader nodes which the evaluator is more limited because it has to be
able to run on the GPU. Creating an inlined `bNodeTree` is likely the most
direct way to get but may also be limiting in the future. Since this is a fairly
local change, it's likely still worth it to support these features in all render
engines without having to make their evaluators significantly more complex.

Some limitations apply here that do not apply in Geometry Nodes. For example,
the iterations count in a repeat zone has to be a constant after constant
folding.

There is also a `Test Inlining Shader Nodes` operator that creates the inlined
tree and creates a group node for it. This is just for testing purposes.

#145811 will make this functionality available to the Python API as well so that
external renderers can use it too.
2025-09-09 16:15:43 +02:00
Sybren A. Stüvel
78032d57e7 Fix #145753: Crash deleting a keyframe for another slot when tweaking
When deleting the last key of an F-Curve, the F-Curve itself also gets
deleted. This is now done via the same code as deleting F-Curves from
the channel list.

Before this fix, a deletion function was used that's not capable of
deleting from Actions in NLA strips, which is why it crashed.

Pull Request: https://projects.blender.org/blender/blender/pulls/145929
2025-09-09 10:14:46 +02:00
Jacques Lucke
6066a0f83c Mesh: Optimize sparse face to vertex attribute interpolation
This was found to be a bottleneck in #136477. Before this conversion would
always convert the entire attribute. However, the caller only required a single
index. Now the attribute is interpolated lazily when specific indices are
requested later.

Pull Request: https://projects.blender.org/blender/blender/pulls/145934
2025-09-09 07:58:44 +02:00
Sybren A. Stüvel
6bf8685628 Anim: drop versioning code for pre-2.50 animation
Drop all support for animation data from Blender versions 2.49 and
older.

- The `IPO` DNA struct is deleted, as is the `IDType_ID_IP` type
  definition.
- Versioning code has been removed in its entirety.
- Loading a pre-2.50 blend file will issue a warning, stating that any
  animation data that was there is now lost, and that the file should
  be loaded & re-saved with Blender 4.5 to properly port the data.

Note that versioning of Action assignments (as in, picking a slot)
still uses the tagging + updating all tagged assignments as a
post-processing step. This is necessary because picking the right slot
is only possible after all Actions (also those from libraries) have
been versioned. We might be able to address this as well, by upgrading
legacy → slotted Actions "on the fly" versioning these Action
assignments. If we do that, I think that would be better in a separate
PR though, as it could introduce issues by itself.

Ref: #134219
Pull Request: https://projects.blender.org/blender/blender/pulls/145188
2025-09-08 14:09:21 +02:00
Brecht Van Lommel
10027d9a6d Color Management: Use working space from custom OCIO config in startup blend
When using the default Blender config use what was saved in the startup blend.
But when using a custom config it's likely the scene linear space from that config
is wanted. And not using it can lead to some confusing situations, where you end
up with an ACES config and the Linear Rec.709 working space.

Pull Request: https://projects.blender.org/blender/blender/pulls/145884
2025-09-07 21:32:17 +02:00
Sean Kim
9cae162597 Cleanup: Rename various multires functions
* `multires_reshape_evaluate_limit_at_grid` to
  `multires_reshape_evaluate_base_mesh_limit_at_grid`

Pull Request: https://projects.blender.org/blender/blender/pulls/145457
2025-09-06 23:55:16 +02:00
Campbell Barton
c17f676966 Fix: 3D text line end misses last character
Regression in [0] caused line-end not to select the last character.

[0]: 98fd1a942c
2025-09-06 21:11:13 +10:00
Jesse Yurkovich
3e3ee35e9d Fix #145711: Packed images may fail to export with USD
Certain packed images, like those loaded directly into memory with
`BKE_image_packfiles_from_mem`, would cause USD to process the images as
"in memory" rather than as "packed" because the API was not removing the
IMG_GEN_TILE flag.

Additionally, be sure to use the packed filepath whenever possible
rather than the name given to the Image datablock as this ensures the
correct file names are used inside the USD file and for the resulting
file on disk after export.

This also fixes 2 render tests which now match when compared to the
native renders.

Pull Request: https://projects.blender.org/blender/blender/pulls/145749
2025-09-05 19:41:20 +02:00
Brecht Van Lommel
6a083a5464 Color Management: Add working color space for blend files
* Store scene linear to XYZ conversion matrix in each blend file, along
  with the colorspace name. The matrix is the source of truth. The name
  is currently only used for error logging about unknown color spaces.
* Add Working Space option in color management panel, to change the
  working space for the entire blend file. Changing this will pop up
  a dialog, with a default enabled option to convert all colors in
  the blend file to the new working space. Note this is necessarily only
  an approximation.
* Link and append automatically converts to the color space of the main
  open blend file.
* There is builtin support for Rec.709, Rec.2020 and ACEScg working spaces,
  in addition to the working space of custom OpenColorIO configs.
* Undo of working space for linked datablocks isn't quite correct when going
  to a smaller gamut working space. This can be fixed by reloading the file
  so the linked datablocks are reloaded.

Compatibility with blend files saved with a custom OpenColorIO config
is tricky, as we can not detect this.

* We assume that if the blend file has no information about the scene
  linear color space, it is the default one from the active OCIO config.
  And the same for any blend files linked or appended. This is effectively
  the same behavior as before.
* Now that there is a warning when color spaces are missing, it is more
  likely that a user will notice something is wrong and only save the
  blend file with the correct config active.
* As no automatic working space conversion happens on file load, there is
  an opportunity to correct things by changing the working space with
  "Convert Colors" disabled. This can also be scripted for all blend files
  in a project.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/145476
2025-09-05 19:04:47 +02:00
Brecht Van Lommel
a4e9e4869d Refactor: Add foreach_working_space_color to ID type
Left for future work:
* Freestyle modifiers, dynamic paint, legacy texture mapping
* Editor colors: should be changed to sRGB?
* Studio light preferences: also sRGB, though less clear

Pull Request: https://projects.blender.org/blender/blender/pulls/145476
2025-09-05 19:03:32 +02:00
Hans Goudey
d939de98a9 Cleanup: Formatting 2025-09-05 11:10:28 -04:00
luz paz
0760b2d5aa Fix typos in source/blender/blenkernel
Fixes various user-facing and non-user-facing typos.

Pull Request: https://projects.blender.org/blender/blender/pulls/145767
2025-09-05 16:25:32 +02:00
Brecht Van Lommel
ffa4f8c7ad Refactor: Split off lighter BLI_color_types.hh from BLI_color.hh
Functions for convert between the color types and ostream support are
now outside the classes.

Many files were changed to fix cases where direct includes for headers
were missing.

Pull Request: https://projects.blender.org/blender/blender/pulls/145756
2025-09-05 11:11:32 +02:00
Brecht Van Lommel
9d2058eb1e Color Management: Warn when OpenColorIO config for blend file is likely missing
If any display, view or colorspace is not found, these would be changed to an
existing one and show warnings in the console. Now also warn about this in the
user interface using the same mechanism as loading new blend files in older Blender
versions, with a warning in the status bar and on file save.

Ref #145476

Pull Request: https://projects.blender.org/blender/blender/pulls/145756
2025-09-05 11:11:32 +02:00
Brecht Van Lommel
76a446deba Fix: Wrong color space for gizmo, fluid grid line and stamp colors
Mark these as sRGB, as they already were or should be interpreted this way.

Pull Request: https://projects.blender.org/blender/blender/pulls/145755
2025-09-05 11:11:32 +02:00
Harley Acheson
91997ea89f UI: Save Temp Window Sizes & Positions
Allow temporary windows (like File Browser, Preferences, Render,
Drivers, Info) to open at their last positions and sizes.

Pull Request: https://projects.blender.org/blender/blender/pulls/104727
2025-09-05 00:05:50 +02:00
Mattias Fredriksson
ccd8926717 Curves: Simplify calculation of NURBS basis functions
Replaces current basis function calculation which seems to be a direct
implementation of the recursive NURBS formulation. New implementation
avoids the need to check for zero divisions during iteration. Out of
bounds checks are also converted to asserts, assuming input provides
valid span index.

Performance wise this nets a 7+% performance improvement with the
average result being as fast or faster then the fastest execution
from previous implementation!

Pull Request: https://projects.blender.org/blender/blender/pulls/144457
2025-09-04 21:49:58 +02:00
Jonas Holzman
fff3af04c4 UI: Nodes: Rename Shader / Compositing RGB nodes to Color
This PR renames the Shader and Compositing RGB nodes to unify them with
the Geometry Color input node. The Compositing node output socket was
also renamed from "RGBA" to "Color" following other nodes. This is a
5.0 breaking change as part of #96219

Pull Request: https://projects.blender.org/blender/blender/pulls/140495
2025-09-04 21:42:53 +02:00
Campbell Barton
7250eef0a3 Cleanup: pass const context to CTX_py_init_get 2025-09-04 23:05:17 +10:00
Falk David
866fcd0a09 VSE: Update Strip Modifier UI
This PR updates the VSE strip modifiers interface.
It now uses the same design as the object modifiers.

Changes:

* Except for the "Mask Input" subpanel, the modifier UIs are unchanged.
* Modifiers can now be rearranged using drag & drop.
* Additionally, there is now an active strip modifier. This is exposed
   though python via `strip.modifiers.active`.

This is in part for !139634 which needs the concept of an active modifier.

Notes:

* The `modifier.cc` file included all the implementation of all modifiers.
   With the addition of a another new callback in this PR, this file was
   getting quite big so I split everything out into individual files for all
  modifiers. The modifiers are getting registered at launch.
* The modifier panels are getting added using a UI template
  (`template_strip_modifiers`) very similar to the object modifiers.

Pull Request: https://projects.blender.org/blender/blender/pulls/145367
2025-09-04 15:01:57 +02:00
Hans Goudey
5418f0bc68 Fix: Geometry nodes reorders attributes in some cases
Currently attribute names are often added to a hash map that doesn't
maintain the original order. This is convenient for developers but it's
better for users if attributes aren't arbitrarily reordered. Instead,
use `VectorSet` which gives the benefit of a hash map but maintains the
insertion order. The main downside is the loss of O(1) removal which we
benefited from in a few cases. I used string comparison instead for now.

Fixes #144491, #122994

Pull Request: https://projects.blender.org/blender/blender/pulls/145668
2025-09-04 13:59:44 +02:00
Campbell Barton
75a3dad4b9 Fix #145714: mesh.validate() asserts editing immutable layers
Ensure corners layers are mutable, was only called on face-data.
2025-09-04 19:00:30 +10:00
Campbell Barton
16246d06d5 Fix: missing newlines loading 3D text from older blend files
Resolve regression in [0] which removed checks for `\r` without
versioning blend files.

[0]: c742a4b62b
2025-09-04 17:08:48 +10:00
Jacques Lucke
df68dc5768 Nodes: remove writing legacy node group interface
When panels in node groups were introduced, the interface data of a tree was
moved from `tree.inputs_legacy/outputs_legacy` to `tree.tree_interface`. For
forward compatibility, the old interface was still written. Since Blender 4.5
can read the new format and older versions are not able to open files created in
5.0 directly anymore, it's fine to remove this forward-compatibility code now.

Also fixes #145278.

Pull Request: https://projects.blender.org/blender/blender/pulls/145489
2025-09-04 06:45:32 +02:00
илья _
6c51993aa3 Geometry Nodes: COW Elision for attribute default filling
Avoid `*_for_write` calls if will not perform any write actions later.
This is a theoretical optimization, only in some fairly specific
situations though.

Pull Request: https://projects.blender.org/blender/blender/pulls/145540
2025-09-04 02:41:55 +02:00
Brecht Van Lommel
9d7330a223 Refactor: Color Management: Pass ImageFormatData to movie writing
Like image saving, this may be modified from the scene ImageFormatData
to contain the effective color management settings taking into account
overrides.

For upcoming changes, we will need to know the image buffer colorspace when
starting to write the video instead of only on the first frame.

Pull Request: https://projects.blender.org/blender/blender/pulls/145373
2025-09-03 16:32:01 +02:00
Brecht Van Lommel
3c9bc4070c Fix #145340: Object.to_mesh API change with subdivision and shape keys
Don't inherit shape keys in this case, as they are not valid.

This is to avoid an API breaking change that affects the glTF exporter.

Pull Request: https://projects.blender.org/blender/blender/pulls/145343
2025-09-03 16:17:49 +02:00
Campbell Barton
d1e0e32769 Cleanup: use more common abbreviation for ToolSettings 2025-09-03 20:10:49 +10:00
Omar Emara
3d3f0d1b64 Fix #145498: Cryptomatte assets are not selectable by name
Cryptomatte assets are not selectable by name in the Cryptomatte node
due to missing metadata. This patch adds he necessary meta-data to make
this work.

Pull Request: https://projects.blender.org/blender/blender/pulls/145643
2025-09-03 10:48:00 +02:00
Campbell Barton
d77aac594f Fix #145590: translations causing driver expressions to fail
Resolve regression in [0] where name was translated for the name but
not the Python expressions, it's possible to translate both but this
doesn't seem so simple as these functions don't necessarily run at
the same time.

[0]: 6926596174
2025-09-03 17:40:29 +10:00
Sean Kim
3c0f8b0def Refactor: Move paint cursor fields to runtime struct
* Moves the paint cursor pointer to `PaintRuntime`
* Removed the stored runtime color value - this was effectively
  hardcoded to a shade of red (255, 100, 100) with an alpha of 128.

The red color was only used for the smooth stroke overlay (the trailing
line) and the alpha value was only ever used for the *Line* stroke type.

Pull Request: https://projects.blender.org/blender/blender/pulls/145371
2025-09-03 07:13:11 +02:00
Toby Yang
5f8311f596 Paint: Add pressure mapping curves for size, jitter, and strength
This commit adds support for users to customize individual pressure
mapping curves for size, strength, and position jitter on a per-brush
basis to improve expression when using drawing tablets. This feature is
already implemented in Grease Pencil, and this PR adds the same
functionality to Texture/Image paint, Vertex/Weight paint, and Sculpt
modes.

The UI and functionality are the same as those in Grease Pencil.

Co-authored-by: Sean Kim <SeanCTKim@protonmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/144428
2025-09-03 05:34:38 +02:00
Hans Goudey
848ced8fe6 Curves: Parallelize nurbs custom knots offsets cache calculation
Build the size for each curve in parallel, then accumulate the sizes
to offsets afterwards. This way it's easy to parallel. Also only count
custom knots for NURBS.

Pull Request: https://projects.blender.org/blender/blender/pulls/145581
2025-09-03 04:29:08 +02:00
Campbell Barton
2ee1b0fa84 Cleanup: minor changes to target_project_edge error checking
- Move divide-by-zero check earlier.
- Operate on int before float conversion.
- Use float literals.
- Use const variables.
2025-09-03 10:40:06 +10:00
Sean Kim
709286ecc9 UV: Add forwards compatibility conversion for brush size
The prior change missed that `UvSculpt` brushes have their own isolated
`size` value stored at the `ToolSetting` level and not stored as either
brush assets or on the `UnifiedPaintSettings` struct

Similar to #139813

Pull Request: https://projects.blender.org/blender/blender/pulls/144837
2025-09-03 00:23:22 +02:00