Commit Graph

119622 Commits

Author SHA1 Message Date
Mattias Fredriksson
f9d3235291 Cleanup: Detect knot mode cyclic
Moving the cyclic mode check into a separate function simplifies the
code. Avoiding an additional local variable to track the result, and
better encapsulates the behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/138375
2025-05-09 03:44:28 +02:00
Guillermo Venegas
38c08b515f UI: Allow drag multiple files from Blender File Browser
After c00c8b1b37 its possible to handle drag-n-drop with multiple
paths, this commit enables Blender internal File Browser to have
support to start drag events with multiple files.

Pull Request: https://projects.blender.org/blender/blender/pulls/116474
2025-05-08 23:56:38 +02:00
Sean Kim
631c329d19 Fix: Incorrect versioning of brush tip_scale_x
The old versioning code was not guarded in a `MAIN_VERSION_FILE_ATLEAST`
check and the RNA hard minimum was not updated to prevent setting this
to an invalid value.

Pull Request: https://projects.blender.org/blender/blender/pulls/138572
2025-05-08 22:35:48 +02:00
Harley Acheson
40b64f7cb9 UI: Adjust Hitsize for Properties NavBar Region Edge
Recent increases in region edge hit sizes, to work better with tablet
pens, made the hitspace for Properties NavBar encroach into the tab
space. This PR just narrows it and moves it away from the tabs.

Pull Request: https://projects.blender.org/blender/blender/pulls/138622
2025-05-08 21:47:02 +02:00
Hans Goudey
be2f772a2d Fix: Build error after recent UI layout refactor
Also add an include that was missing (presumably not noticed because
of unity builds).
2025-05-08 15:29:21 -04:00
Clément Foucault
a68ad1b676 Fix: GPU: C++ GLSL stubs: Swizzle in wrong list 2025-05-08 20:55:24 +02:00
Guillermo Venegas
dafdced6ab Refactor: UI: Replace uiItemR with class method uiLayout::prop
This converts the public `uiItemR` function to an object oriented
API (`uiLayout::prop`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138617
2025-05-08 20:45:37 +02:00
Miguel Pozo
140d0df2b8 Fix: EEVEE: Static Viewport Animation Render
Fix viewport animation renders where there has been no scene updates
between frames.
2025-05-08 20:23:56 +02:00
Miguel Pozo
66796ef9d4 Fix: Workbench: Static Viewport Animation Render
Fix viewport animation renders where there has been no scene updates
between frames.
2025-05-08 20:13:16 +02:00
Harley Acheson
9741ced8c0 UI: Hover Increment/Decrement For Strings & Toggles
This is loosely related to #136285, which allows changing numerical
values while in text entry mode. Outside of that, just hovering over
numerical inputs we are currently able to increment and decrement by
Ctrl + Mouse Wheel. This works for integers, floats, sliders. Current
code also allows cycling through expanded enums. This PR extends that
so Ctrl + Mouse Wheel also changes toggles and checkboxes and also
changes values inside of strings.

Pull Request: https://projects.blender.org/blender/blender/pulls/138344
2025-05-08 19:52:56 +02:00
Alexandre-Cardaillac
921c2b9d61 Shader: New Volume Coefficients Shader
Add a new shader node to control volume coefficients (scattering,
absorption and emission) directly, making it easier to model existing
volumes with measured data.

Pull Request: https://projects.blender.org/blender/blender/pulls/136287
2025-05-08 19:19:35 +02:00
Hans Goudey
d018c12b61 Cleanup: Draw: Use StringRef for function argument 2025-05-08 13:09:06 -04:00
Philipp Oeser
75f55a9e8e Fix #138493: Placeholders and Renders filenames dont match
... if only a single view is enabled

Logic for touching placeholder files in `RE_RenderAnim` uses
`BKE_scene_multiview_filepath_get` (no matter if only a single view is
enabled), but logic in `BKE_image_render_write` falls back to using the
"regular" filepath (once gotten from `BKE_image_path_from_imformat`) if
there are less than two views.

That would also break the behavior of "Skip Overwrite".

Digging in git history is a bit hard, so not exactly sure why this was
added, but this PR changes behavior so that
`BKE_scene_multiview_filepath_get` is always used (even for a single
(non-empty) view. Done by implementing `RE_ResultIsMultiView`

Pull Request: https://projects.blender.org/blender/blender/pulls/138507
2025-05-08 18:37:44 +02:00
Philipp Oeser
c86f5c2a64 Fix #138545: Grease Pencil connected proportional editing wrong
It would not use topological distances.

This was the case for Grease Pencil, Curves were right though (even
though both use the same code `curve_populate_trans_data_structs` /
`calculate_curve_point_distances_for_proportional_editing`)

So that calculation is actually right, the thing that made it fail for
Grease Pencil was that `init_proportional_edit` was calling
`set_prop_dist` with the `with_dist` argument as `true` [this would
overwrite the already calculated dist with the "plain", "non-
topological" distance again... leading to wrong values being used in
`calculatePropRatio`]

So to resolve, skip the `set_prop_dist` alltogether if T_PROP_CONNECTED
is used. Done for both Curves and Grease Pencil and move into own block.
Legacy Curve get their own codeblock (with a comment where their
topological distances are calculated).

Pull Request: https://projects.blender.org/blender/blender/pulls/138588
2025-05-08 18:37:19 +02:00
Miguel Pozo
992e7c95a7 GPU: Converge ShaderCompiler implementations
Part of #136993.

Share as much of the ShaderCompiler implementations as possible.
Remove the ShaderCompiler/ShaderCompilerGeneric split and make most of
its functions non virtual.
Move the `get_compiler` function from `Context` to `GPUBackend` and
creation/deletion to `GPUBackend::init/delete_resources`.
Add a `batch_cancel` function to `ShaderCompiler` (needed for the
GPUPass refactor).

As a nice extra, the multithreaded OpenGL compilation has become faster
too.
The barbershop materials + EEVEE static shaders have gone from 27s to
22s.

I have not observed any performance difference on Vulkan or Metal.

Pull Request: https://projects.blender.org/blender/blender/pulls/136676
2025-05-08 18:16:47 +02:00
Hans Goudey
12decaf13c Fix: Use after free after recent image pool lock cleanup
Caused by 9a5a5c35c7.
We need to release the lock before freeing it.
2025-05-08 11:46:22 -04:00
Jordan Henshaw
499eb133d7 Fix: Graph Editor with View Selected on 1 key
Expand the already-existing safety margin to correct for the implosion
scenario, by a factor of 100x. That way it doesn't zoom in too much,
and makes it easy for an animator to zoom out again if necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/138235
2025-05-08 17:21:39 +02:00
Guillermo Venegas
e5dcd0de99 Refactor: UI: Replace uiItemL with class method uiLayout::label
This converts the public `uiItemL` function to an object oriented
API (`uiLayout::label`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138608
2025-05-08 17:21:08 +02:00
Ray Molenkamp
f2b9dd3462 CMake: Windows: Use release libs of shaderc for debug builds.
While shaderc is a c++ library that normally requires debug libs
for ABI reasons, shaderc only exports a C interface, so it will
link release mode libs just fine even for debug builds.

This drops the time required for GPU_shader_compile_static in a
debug build from 5 mins to 3 sec for @pragma37

no changes for release configurations.
2025-05-08 09:14:03 -06:00
Hans Goudey
b21cb20eeb Refactor: Remove layer index from draw attribute request struct
The goal is to separate the draw attribute request from the
CustomData implementation. For the layer index this was
already started a while ago; it's only used in a couple places
and lookups are mostly name based anyway.

Conceptually the attribute request is just a request that the
extraction system create a buffer for a certain attribute name.
Information about where the attribute is stored doesn't fit.

Pull Request: https://projects.blender.org/blender/blender/pulls/138570
2025-05-08 16:55:23 +02:00
Christoph Lendenfeld
d30d4c0c04 Anim: Show action slots in the outliner
Add Slots to the outliner.
Slots can be renamed from the outliner.

Pull Request: https://projects.blender.org/blender/blender/pulls/126839
2025-05-08 16:09:31 +02:00
Nathan Vegdahl
e0beb7afe6 Templates for render output paths
This adds basic templating support to render output paths. By putting
"{variable_name}" in the path string, it will be replaced by the named
variable's value when generating the actual output path. This is similar
to how "//" is already substituted with the path to the blend file's
current directory.

This templating system is implemented for both the primary render output
path as well as the File Output node in the compositing nodes. Support
for using templates in other places can be implemented in future PRs.

In addition to the "{variable_name}" syntax, some additional syntax is
also supported:

- Since "{" and "}" now have special meaning, "{{" and "}}" are now
  escape sequences for literal "{" and "}".
- "{variable_name:format_specifier}", where "format_specifier" is a
  special syntax using "#", which allows the user to specify how numeric
  variables should be formatted:
  - "{variable_name:###}" will format the number as an integer with at
    least 3 characters (padding with zeros as needed).
  - "{variable_name:.##}" will format the number as a float with
    precisely 2 fractional digits.
  - "{variable_name:###.##}" will format the number as a float with at
    least 3 characters for the integer part and precisely 2 for the
    fractional part.

For the primary render output path: if there is a template syntax error,
a variable doesn't exist, or a format specifier isn't valid (e.g. trying
to format a string with "##"), the render that needs to write to the
output path fails with a descriptive error message.

For both the primary and File Output node paths: if there are template
syntax errors the field is highlighted in red in the UI, and a tooltip
describes the offending syntax errors. Note that these do *not* yet
reflect errors due to missing variables. That will be for a follow-up
PR.

In addition to the general system, this PR also implements a limited set
of variables for use in templates, but more can be implemented in future
PRs. The variables added in this PR are:

- `blend_name`: the name of the current blend file without the file
  extension.
- `fps`: the frames per second of the current scene.
- `resolution_x` and `resolution_y`: the render output resolution.

Pull Request: https://projects.blender.org/blender/blender/pulls/134860
2025-05-08 15:37:28 +02:00
Clément Foucault
388fcdb934 Cleanup: Overlay: Rename edit_text.hh to text.hh for consistency 2025-05-08 15:12:26 +02:00
Aras Pranckevicius
9c8a7b8d11 Cleanup: factor out 4.4 versioning code into versioning_440.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/138549
2025-05-08 14:52:21 +02:00
Aras Pranckevicius
bb79b4920f Cleanup: factor out 4.3 versioning code into versioning_430.cc 2025-05-08 14:52:20 +02:00
Aras Pranckevicius
9cc97dd42b Cleanup: factor out 4.2 versioning code into versioning_420.cc 2025-05-08 14:52:20 +02:00
Aras Pranckevicius
767cf78dda Cleanup: factor out 4.1 versioning code into versioning_410.cc 2025-05-08 14:52:20 +02:00
Aras Pranckevicius
c8e2dc4fc0 Cleanup: factor out 4.0 versioning code into versioning_400.cc 2025-05-08 14:52:20 +02:00
Aras Pranckevicius
b440b588ac Cleanup: Rename versioning_400.cc -> versioning_450.cc 2025-05-08 14:52:20 +02:00
Jeroen Bakker
7775883da2 Fix #138403: Overlay: Retopology offset not set for Image prepass
Image prepass pass didn't initialize the retopology offset, resulting in
clip test failures on Vulkan. Users noticed that the cycles rendering
didn't update during rendering, only when finihsed.

Pull Request: https://projects.blender.org/blender/blender/pulls/138596
2025-05-08 14:44:39 +02:00
Sybren A. Stüvel
23f720da68 Refactor: make bPoseChannel* parameter const in some functions
For some "get … from pose channel" functions, make its `bPoseChannel*`
parameter `const` as it's not being modified.

No functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/138590
2025-05-08 12:07:43 +02:00
Pratik Borhade
9249beb83f Fix: Outliner: Crash renaming GP effect base
Similar to other listbase tree-elements, skip GP_EFFECT_BASE from
renaming. Otherwise it crashes in `str_utf8_copy_max_bytes_impl`
due to assigning some other value to const char stream.

Pull Request: https://projects.blender.org/blender/blender/pulls/138484
2025-05-08 12:04:10 +02:00
Sybren A. Stüvel
27ad6b7c2b Fix #137407: Action properties not usable as driver variable
Add a `PARAMETERS` dependency graph component to Action data-blocks.
This is necessary for drivers to use an Action property as a variable.

Pull Request: https://projects.blender.org/blender/blender/pulls/138495
2025-05-08 10:36:30 +02:00
Jeroen Bakker
db10854e3c Fix #138304: DRAW: Texture wrapper not releasing texture views
When a texture wrapper wraps a second texture it doesn't free its
local resources based on  the previous texture. This resulted in texture
views still being used where the backed memory could already be reused
by other allocations.

In OpenGL this might be solved inside the driver by not freeing the
backed texture unless all views have been freed. However our Vulkan
backend doesn't do this, leading to crashes when resizing the viewport
when displaying a workbench volume. In OpenGL this could lead to small
resizing artifacts, although we haven't noticed them. Overlay also wraps
existing textures.

Pull Request: https://projects.blender.org/blender/blender/pulls/138582
2025-05-08 10:23:28 +02:00
Nathan Vegdahl
4e596d18c1 Fix #138201: Read, write, and copy pose marker custom properties
Custom properties on pose markers in Actions were not handled properly
in the following ways:

- They were not written to or read from blend files, which resulted in
  crashes (reported in #138201).
- They were not duplicated when the pose marker lists were duplicated
  (during Action duplication), which would leave the duplicate marker
  *sharing* custom properties with the marker it was duplicated from.

This PR fixes these issues by creating functions to handle the reading,
writing, and copying of marker lists which properly read/write/copy
custom properties as well, and using those functions in the relevant
places.

Pull Request: https://projects.blender.org/blender/blender/pulls/138494
2025-05-08 10:08:36 +02:00
Philipp Oeser
a5db664d61 Fix #138157: Image Editor Fill tool slight color inaccuracy
`ImagePaintMode` `paint_bucket_fill` does a double colorspace conversion
atm. (which is a lossy process).

Since this is lossy, painting with the same color as was used for
filling can give slight differences (very noticable though if painting
e.g. bump maps).

For comparison, `ProjectionPaintMode` `paint_bucket_fill` (so in the 3D
viewport) does not suffer the same issue (it keeps track of both sRGB
brush color and a linear version of such color).

Currently `paint_2d_bucket_fill` expects linear space color values, so
for filling byte images, we first convert the brush color to linear
(`srgb_to_linearrgb_v3_v3`) then inside `paint_2d_bucket_fill`, we
convert back (`linearrgb_to_srgb_v3_v3`).

We can avoid the double conversion though, make `paint_2d_bucket_fill`
expect sRGB space color values and only convert to linear if we a
filling float images.

Pull Request: https://projects.blender.org/blender/blender/pulls/138540
2025-05-08 08:07:22 +02:00
Philipp Oeser
9afae799e4 Fix #138537: Baking to Color Attribute not possible without UV Map
Caused by f3161149db

Should only check UV maps if we are actually baking to textures
(R_BAKE_TARGET_IMAGE_TEXTURES).

Pull Request: https://projects.blender.org/blender/blender/pulls/138542
2025-05-08 08:06:26 +02:00
Campbell Barton
63cdb7eae4 Cleanup: pass SelectPick_Params by reference instead of pointer
Also use a return value from ED_select_pick_params_from_operator.
2025-05-08 13:50:14 +10:00
Jacques Lucke
3e28dff8db Cleanup: add missing static on functions
This caused some compiler warnings because the functions are not
declared before.
2025-05-08 04:46:22 +02:00
Jacques Lucke
8a42e2b59a Nodes: support expanded menus in node group interface
Previously, menu sockets were always drawn as dropdown. This patch adds the
ability to draw them expanded instead.

As before, in the node editor, only the expanded menu is drawn, without the
label. There is simply not enough space for both. However, in the modifier and
operator settings the label is drawn currently. We'll probably need to add a
separate `Hide Label` option (similar to `Hide Value`) for group inputs that
support it. That would also help a lot with e.g. object sockets.

Pull Request: https://projects.blender.org/blender/blender/pulls/138387
2025-05-08 04:31:09 +02:00
Jacques Lucke
156a405dd5 Nodes: support searching for specific math operations in Add menu
Previously, it was possible to search for specific math operations in
link-drag-search but not in the normal add menu. This patch adds support for
searching for specific operations in various math nodes.

A good trick for adding e.g. a vector add node is to search for `vadd`
(similarly with `iadd`).

The menu itself looks unchanged. This patch only adds additional elements to the
search.

Pull Request: https://projects.blender.org/blender/blender/pulls/138534
2025-05-08 04:28:22 +02:00
Sean Kim
0e8e98016b Cleanup: Remove commented out forward declaration
Also remove unnecessary `enum` prefix

Pull Request: https://projects.blender.org/blender/blender/pulls/138576
2025-05-08 03:41:57 +02:00
Martin-Vignali
9049645d0f FFmpeg: Add support for 10/12 bits FFV1 output
FFV1 supports more than 8 bits by pixel. Add support for 10 and 12 bit
depth (FFV1 encoder uses planar pixel format for these bitdepths).
Fix pixel format for 8 bit output. Previously it was always RGBA.

Co-authored-by: mvji <33432858+mvji@users.noreply.github.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/138192
2025-05-08 02:34:56 +02:00
Harley Acheson
405d9bc0bb UI: Correct Width of Hyper Status Bar
If a keymap entry uses "Hyper" key as a modifier then it currently
shows oddly on the status bar because the text width is narrower than
the button width. This corrects that.

Pull Request: https://projects.blender.org/blender/blender/pulls/138575
2025-05-08 02:01:47 +02:00
Sean Kim
0f10ccd6b5 Fix: Clay Thumb front_angle can be NaN
Introduced in 4c38327ea2

Pull Request: https://projects.blender.org/blender/blender/pulls/138573
2025-05-08 01:10:45 +02:00
Harley Acheson
d2f6514686 UI: Status Bar Proportional Size Include MsPan
Currently while transforming with proportional editing we see an item
in the status bar for "MsPan: Adjust Proportional Influence". This is
actually for trackpad pan gesture (only available on some laptops).
This PR just combines this entry with those for Page Up and Page Down.

Pull Request: https://projects.blender.org/blender/blender/pulls/138574
2025-05-08 00:44:09 +02:00
Hans Goudey
51eab6b25a Cleanup: Use blender::Mutex for file list read job 2025-05-07 18:05:14 -04:00
Hans Goudey
9a5a5c35c7 Cleanup: Use blender::Mutex for image pool 2025-05-07 18:05:14 -04:00
Harley Acheson
48403607dd UI: Status Bar Event Icons for Trackpad Gestures
Adding three icons to represent panning, rotate, and zoom gestures
and using them for status bar event icons for
GHOST_kTrackpadEventScroll, GHOST_kTrackpadEventRotate, and
GHOST_kTrackpadEventMagnify.

Pull Request: https://projects.blender.org/blender/blender/pulls/138569
2025-05-07 23:57:03 +02:00
Guillermo Venegas
a76753ca55 Refactor: UI: Replace uiLayoutRadial with class method uiLayout::menu_pie
This converts the public `uiLayoutRadial` function to an object oriented
API (`uiLayout::menu_pie`), matching the python API.
This reduces the difference between the C++ API with the python version,
its also helps while converting code from python to C++ code (or vice-versa),
making it almost seamless.

`uiLayout::menu_pie` now returns an `uiLayout` reference instead of a pointer.
New calls to this method should use references too.

Part of: #117604

Pull Request: https://projects.blender.org/blender/blender/pulls/138563
2025-05-07 23:29:49 +02:00