Commit Graph

120068 Commits

Author SHA1 Message Date
Aras Pranckevicius
3cb52b0a01 ffmpeg: faster high-bpp/HDR video decoding
Videos that are higher bit depth than 8 bit are decoded into floating
point formats (so anything that uses 10/12 bits or HDR). Speedup:
- Multi-thread GBRA planar -> RGBA interleaved conversion.
- If video is rotated, do the rotation step while doing the above
  conversion directly, instead of a separate rotation afterwards. Cuts
  down on memory bandwidth usage.

Playing back two 1920x1080 video tracks, where both are rotated and
H.265 10 bit HDR, on my PC (Ryzen 5950X), average playback frame time
goes 47ms -> 32ms (so 21FPS -> 31FPS)

Pull Request: https://projects.blender.org/blender/blender/pulls/139439
2025-05-26 19:34:22 +02:00
Jacques Lucke
66a5469bcf Spreadsheet: support restoring temporarily unavailable data columns
Previously, columns were removed from a table in the spreadsheet if they are not
available anymore. This also meant that their position and width was lost. When
the same column became available again, it was inserted at the end.

This patch makes it so that each table also remembers the columns that are not
available currently (and flags them accordingly). This way, the position and
width can be restored once the data becomes available again.

Pull Request: https://projects.blender.org/blender/blender/pulls/139440
2025-05-26 19:16:20 +02:00
Jeroen Bakker
6b1ef63f4d Fix: Vulkan: Swapchain validation
On selected platforms there were some validation errors. It was caused by
platforms that returned a different number of swapchain images then were
requested. In that case the semaphores can get out of sync.

Current mechanism isn't future proof as the max number of images are
statically defined.

For this change the present semaphores is also separated from the frames
to better support out of order swapchain images.

Pull Request: https://projects.blender.org/blender/blender/pulls/139446
2025-05-26 16:31:02 +02:00
Omar Emara
bab308bfa2 Compositor: Turn Blur node options to inputs
This patch turns the Blur node options to inputs.

Size is now a 2D vector and replaces the Size X and Y option. Bokeh was
renamed to Separable to reflect its actual function. Relative was
removed in favor of the newly added Relative To Pixel node workflow.

There is a slight difference in variable size blurring due to float vs
integer computations, so two tests were updated.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/139329
2025-05-26 16:18:48 +02:00
Jacques Lucke
87c011f8bb Nodes: minify value input nodes
This removes redundant labels from various input nodes like the Value, Integer
and Object node.

Design wise, this is mostly straight forward except for two aspects:
* Some input nodes some have a gizmo icon. In this case I just added the gizmo
  icon on the same row.
* The checkbox in the Boolean input node should probably still have a label, so
  I kept that.

Implementation wise this adds a new function to socket declarations that allows
us to override the draw behavior of individual sockets per node.

Pull Request: https://projects.blender.org/blender/blender/pulls/139432
2025-05-26 15:47:54 +02:00
Jeroen Bakker
4f76c75da2 Vulkan: Add ghost.vulkan logging
GHOST backend didn't use logging. This PR adds an initial ghost.vulkan
logging and improves the reporting of logging in vulkan.

logging can be enabled by `blender --log "gpu.vulkan,ghost.vulkan" --log-level 2`
it shows the optional extensions that are enabled and information about swap chain
events.

Pull Request: https://projects.blender.org/blender/blender/pulls/139437
2025-05-26 12:55:00 +02:00
YimingWu
802e887a01 Fix: MSVC Type promotion errors
Looks like newer versions of c++ doesn't want to implicitely do type
promotions from int to float. The patch fixes them.

Also fixed a typo `outter` -> `outer`.

Pull Request: https://projects.blender.org/blender/blender/pulls/139435
2025-05-26 12:26:16 +02:00
Omar Emara
02a95d088e Nodes: Add support for 2D and 4D vector sockets
This patch adds support for 2D and 4D vector sockets. The default value
structure for vectors was extended to include a new dimensions input,
which can be 2, 3, or 4. The default value was also extended to be a
float4, but only some of its components might be used depending on the
dimensions members.

Each vector subtype now has three variants ending with 2D or 4D as a
prefix depending on its dimensions, and the 2D/4D prefix was taken into
account for the socket type RNA enum functions.

All node systems currently always treat the vectors as 3D, but support
for it in the compositor will shortly follow in another patch.

Depends on #138805.

Pull Request: https://projects.blender.org/blender/blender/pulls/138824
2025-05-26 11:41:54 +02:00
Clément Foucault
eb37d19b41 GPU: Python: Raise error when creating shaders without create info
This is adding a hard error for backends do that do not supports it.
Even without this, the backend would return a nullptr. But the error
message in this case was just "see console for more details" without
any additional detail. Which was confusing.
2025-05-26 11:09:49 +02:00
Clément Foucault
8bba1c8056 Fix #139191: GPU: Blender crashes on startup with addons that use pyGPU shader
This was caused by missing `shader->constants`.
Creating an empty `SpecializationConstants` fixes the issue.
2025-05-26 11:09:49 +02:00
Brecht Van Lommel
afad355060 Fix: Properly free Vulkan interop handle for Cycles
Unlike OpenGL and Metal, this handle is not shared, but rather Cycles
has to take ownership of it. This required a fair amount of refactoring
to ensure the handle is closed, ownership is properly transferred, and
the handle is recreated once when the pixel buffer is modified.
2025-05-26 10:59:49 +02:00
Brecht Van Lommel
d2f883d8bc Fix: Cycles Metal graphics interop not working
It needs an MTLBuffer instead of a raw pointer.
2025-05-26 10:59:49 +02:00
Jeroen Bakker
505dd9249c Fix: EEVEE: Incorrect binding cryptomatte textures
The cryptomatte textures where optimized for samplers, but could trigger
UB as they are also used with load/store. This PR will change the
dynamic data type of the cryptomatte to always use RGBA32F.

Detected with Vulkan validation layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/139427
2025-05-26 10:48:02 +02:00
YimingWu
2ed21d7b90 Fix: Viewport: Assert when drawing fly navigation aim symbol.
The `immVertex2i` calls in `drawWalkPixel` will now cause an assert in
`immAttr2i` after 617858e453 because the component types are more
strictly enforced. Now switch to using floats to avoid asserts and
potentially drawing garbage in the viewport.

Pull Request: https://projects.blender.org/blender/blender/pulls/139429
2025-05-26 10:32:39 +02:00
Omar Emara
c9ed2c28f3 Compositor: Add Dimensions output to Image Info node
This patch adds a new Dimensions output to the Image Info node. Contrary
to the Resolution output, the Dimensions output takes transformations
into account. So an image of resolution 512x512 that is scaled up by 2
would have a Resolution of 512x512 but a Dimensions of 1024x1024.

Depends on #138935.

Pull Request: https://projects.blender.org/blender/blender/pulls/139211
2025-05-26 09:58:19 +02:00
Damien Picard
ba45498955 I18n: Use context for node panel translation in material properties
This is a follow-up to 9ce0a2d1d5 and uses the same logic. It allows
translation of node panel labels inside the material properties, using
their specified translation context. Not in use currently, but may be
needed in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/139367
2025-05-26 09:36:04 +02:00
Omar Emara
a4502f82c1 Compositor: Add Image Coordinates node
This patch adds a new Image Coordinates node for the compositor. The
Texture Coordinates and Pixel Coordinates outputs were removed from the
Image Info node and were added to the new node instead. Additionally, a
new Normalized Coordinates output was added.

The Pixel Coordinates output now no longer includes half pixel offsets.

Pull Request: https://projects.blender.org/blender/blender/pulls/138935
2025-05-26 08:25:06 +02:00
Habib Gahbiche
8485d8a33c Compositor: Rename default node tree to "Compositing Node Tree"
Currently only visible in the tree path, but will be more noticeable
when node trees are not embedded anymore (outline and node editor).

Pull Request: https://projects.blender.org/blender/blender/pulls/139358
2025-05-26 08:24:56 +02:00
Oscar Blumberg
aa413a05bf Fix: Vulkan: Threading issue when waiting for submission
Usage of conditional to fix threading and performance delays when
waiting for the submission fence to become valid. The previous
(faulty) implementation didn't work well on WoA devices.
2025-05-26 08:20:09 +02:00
Jacques Lucke
98b888c163 Cleanup: Geometry Nodes: simplify accessing socket usage 2025-05-26 08:04:54 +02:00
Jacques Lucke
024f8a9595 Fix #139388: Nodes: Frame node with text has wrong margins and line breaks
This was caused by an oversight in ae5b83e4ef.
It first removed the `aspect` and then brought it back later on, but forgot
to use it in all cases.
2025-05-26 06:01:53 +02:00
Jacques Lucke
f66aa6529a Geometry Nodes: support panels and attribute/layer search in node group operator
Previously, the node group operator only had fairly basic flat drawing for the
inputs. Due to previous refactors, it's now possible to reuse the drawing code
of the Geometry Nodes modifier. That way the redo panel now has all the features
that also exist in the modifier. Also, future improvements will benefit both
systems and potentially more in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/139389
2025-05-26 05:44:59 +02:00
John Kiril Swenson
6bd750bc01 Fix (unreported): VSE: Strips not deselected on press
With #128051, the default timeline tool changed to
a `sequencer.select` on press with no associated
properties (before, it had `deselect_all`).

This meant that retiming key selection broke (as
reported in #129892) and strips would only deselect
on release if clicking into empty space (due to a separate
keymap item in the global sequencer keymap).

This patch reverts 97e44901b4 while keeping its fix,
in favor of a more robust solution (just add `deselect_all`
to the keymap item properties in the box select tool).
2025-05-25 16:22:16 -05:00
Jacques Lucke
64a13f4be2 Refactor: BLI: simplify extending get_default_hash function
This simplifies extending `blender::get_default_hash` to more than 4 parameters
by just adding extra factors to the list. The behavior should be the same as
before.

Pull Request: https://projects.blender.org/blender/blender/pulls/139392
2025-05-24 21:01:05 +02:00
Bastien Montagne
4baf428e5b Fix (unreported) BLO: Missing some blendfile version info in some Library Mains.
Readfile code would not always properly set the main file version number
in 'split' Mains created for a library, and would also not detect
'future versions' blendfiles.

This info is currently not used by linking code, so this should be a
no-op change in current main.
2025-05-24 20:55:42 +02:00
Jacques Lucke
a6486d11c2 Cleanup: add missing include 2025-05-24 18:55:53 +02:00
Jacques Lucke
d35351fdc8 Fix #139364: FileHandler example for shader editor does not work 2025-05-24 18:46:42 +02:00
Jacques Lucke
8ea045d299 Refactor: Geometry Nodes: extract modifier dependency from UI code
The goal is to simplify reusing the same code to draw the inputs of the node
tool operator.

This patch simply extracted all the modifier-specific code into callbacks which
are passed in from a higher level. The operator drawing code would basically
just need to provide different callback functions. Although some more additional
cleanups may become necessary to make that fully work.

Pull Request: https://projects.blender.org/blender/blender/pulls/139384
2025-05-24 17:11:25 +02:00
Guillermo Venegas
eed8e10b91 Refactor: UI: Remove uiItemIntO API
This function has not python equivalent, using the
returned pointer to write properties seems enough
as equivalent as how is done in python.

Also, this removes the unused `uiItemFloatO` API.

Pull Request: https://projects.blender.org/blender/blender/pulls/139355
2025-05-24 16:15:51 +02:00
Aras Pranckevicius
4e7acc4be8 Fix #138834: FBX import improved pivot handling
This does not fully fix the issue (pivots are still not handled
correctly when an object contains negative scale -- filed upstream
ufbx issue https://github.com/ufbx/ufbx/issues/218), but for regular
cases the pivots are in much better places now.

Pull Request: https://projects.blender.org/blender/blender/pulls/139381
2025-05-24 15:22:19 +02:00
Hans Goudey
9ffb474e07 Fix #139330: Incorrect offset grouping nodes inside frame
Similar to c52da69dfb
2025-05-24 09:17:39 -04:00
Jacques Lucke
26ce934148 Refactor: Geometry Nodes: extract modifier UI code to separate file
The goal is to be able to reuse parts of this code in all the places that call
Geometry Nodes. Currently, that's only a modifier and an operator. More places
may follow in the future though.

This patch does not implement any of the code-reuse yet, it just extracts the
code into a separate file. Follow-up patches will work towards better
code-reuse.

Note, this extracts the entire modifier drawing, including error messages,
baking etc. I found this to be easier, because they still often share a common
core (like getting the logged data).

Pull Request: https://projects.blender.org/blender/blender/pulls/139379
2025-05-24 12:50:02 +02:00
Jacques Lucke
656eaeb0c4 Fix: missing include 2025-05-24 11:45:06 +02:00
Jacques Lucke
680e53fcee Cleanup: Geometry Nodes: rename GeoModifierLog to GeoNodesLog
Nowadays, Geometry Nodes is not only evaluated by a modifier, but also by an
operator and in the future potentially by brushes. Therefore, the old name was
misleading because it sounded like it was specific to the modifier.

Pull Request: https://projects.blender.org/blender/blender/pulls/139378
2025-05-24 10:39:36 +02:00
Jacques Lucke
70ce733b8c Refactor: Nodes: add general NodeComputeContext
This is used as base class for the compute contexts for group and evaluate
closure nodes. Furthermore, in the future this can be used for the compute
context that is passed into field evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/139377
2025-05-24 10:39:24 +02:00
Clément Foucault
8257fcb62f Fix #139354: Metal: AgX turns rendered image into black white
Caused by the initializer list syntax. Using the constructor
explicitly fixes the issue.
2025-05-23 18:28:05 +02:00
Omar Emara
ffbcb23db9 Cleanup: Missing include 2025-05-23 18:01:52 +03:00
Jeroen Bakker
bd139fef14 Fix: Vulkan: Validation error on devices without external memory
Qualcomm devices don't support external memory, but there an external
memory pool was still being constructed. This PR skips the creation and
asserts when using external memory on those devices.

Pull Request: https://projects.blender.org/blender/blender/pulls/139326
2025-05-23 15:59:29 +02:00
Bastien Montagne
ebefbcaeb0 Cleanup: Fix incorrect comment about name size of BLODataBlockInfo. 2025-05-23 15:55:39 +02:00
Campbell Barton
8ab1a2bd13 Fix array size for NodeImageMultiFileSocket::layer
Regression from [0] this was meant to be `EXR_TOT_MAXNAME - 2`,
but wasn't updated when `EXR_TOT_MAXNAME` changed.

Also use UTF8 string copying since it's expected to be UTF8.

[0]: 2c8db87897
2025-05-23 13:49:40 +00:00
Omar Emara
6c62fb5ff6 Compositor: Turn Color Balance options to inputs
This patch turns the options of the Color Balance node into inputs.

In the process, each of the wheels were split into two inputs, a base
float and a color. For instance, Gain is controlled using both a Base
Gain and Color Gain, the former controls the gain for all channels while
the latter controls it per channel.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/138610
2025-05-23 15:42:54 +02:00
Miguel Pozo
4f00a470cd Core: VectorList improvements
- Add a custom Iterator, so it can be iterated as a 1D list.
- Add missing functions like `first`, `is_empty`, `clear`, and
  subscript operator.
- Add a `size_` member variable for faster `size` calls.
- Add compile-time asserts to ensure the Capacity sizes are valid.
- Add unit tests.

See #138947 for the motivation behind this.

Pull Request: https://projects.blender.org/blender/blender/pulls/139102
2025-05-23 15:34:26 +02:00
Jeroen Bakker
a44c515844 Cleanup: Vulkan: Use blender::Mutex
Only the queue mutex owned by ghost is still a std::mutex.

Pull Request: https://projects.blender.org/blender/blender/pulls/139344
2025-05-23 14:40:28 +02:00
Jeroen Bakker
9a6ae548a1 Cleanup: Vulkan: Remove unused getters. 2025-05-23 14:19:46 +02:00
Hans Goudey
8fdf37cd50 Fix #139114: Node insert auto offset broken with frames
Caused by 4bf34d9591.

Quite a bit of complexity used to avoid moving both nodes and their
frame parents is redundant now, since all connected nodes should
be moved and moving frames doesn't also affect the nodes inside
anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/139306
2025-05-23 14:18:09 +02:00
Falk David
4901f38400 Fix: GPU: Crash in pygpu_batch_draw
Introduced by `3d8854b021195fdb253c85133b1db350d3d4c753`.
`py_shader` could still be `nullptr` and needs to be checked.
2025-05-23 12:31:08 +02:00
Pratik Borhade
0ad79ca541 Fix #139170: Regression: The Linked Node Group Socket Name is Editable
This probably have occured after migration from UIList. When nodetree ID
is linked form another file, disable the layout for individual rows and
the add/remove operator. Also tweak `supports_renaming()` function so that
individual tree element cannot be renamed when linked.

Pull Request: https://projects.blender.org/blender/blender/pulls/139269
2025-05-23 12:19:41 +02:00
Pratik Borhade
23bddef11a Fix #139179: Shader node panels are not translated in the material properties
Missed in 613bb9771b. To fix translation of panel header, use `IFACE_` macro).

Pull Request: https://projects.blender.org/blender/blender/pulls/139262
2025-05-23 12:18:17 +02:00
Aras Pranckevicius
a4b76dbb09 IO: more strongly indicate that Collada is deprecated
- Add "(Deprecated)" to Collada I/O tooltips
- Move the import/export menu items to be the last ones from the
  built-in items

Pull Request: https://projects.blender.org/blender/blender/pulls/139303
2025-05-23 12:02:38 +02:00
Jacques Lucke
363eff4f59 Fix: Nodes: missing null check
This caused a crash when creating a group from a node which has
a virtual input socket (e.g. Menu Switch).
2025-05-23 09:21:18 +02:00