Commit Graph

1378 Commits

Author SHA1 Message Date
Bastien Montagne
ada45519a7 Fix #146221: Concurrent access to IDPropertyGroup in liboverride code.
Crash seems to happen due to parallelized access of data in liboverride
diffing code (presumably when a same linked data is used as reference
for several local liboverrides?).

Since there is zero reason to actually create IDGroup properties there
(it's actually fairly bad, also adding useless overhead and trash data
in system IDProperties), add a new API to access a Pointer PropertyRNA,
`RNA_property_pointer_get_never_create`, which ensures that the call
never creates data, and simply returns `PointerRNA_NULL` instead.

Also reverts abd683fcb5 and re-enable liboverride unittests.

NOTE: This only addresses the case from the report, the current behavior
of `RNA_property_pointer_get` is simply wrong and needs to be rethought.
This is not a simple change though most likely. See also #147072.

Pull Request: https://projects.blender.org/blender/blender/pulls/146990
2025-10-01 15:14:28 +02:00
Habib Gahbiche
fb7818e55e Python: Create default node tree for new materials and worlds
The motivation is to keep backward compatibility after deprecating
 `material.use_nodes()` and `world.use_nodes`. For example the
following script would behave the same way in 4.5 and 5.0:
```python
mat = bpy.data.materials.new("My new mat")
mat.use_nodes = True
```

Pull Request: https://projects.blender.org/blender/blender/pulls/147052
2025-10-01 15:05:16 +02:00
Falk David
c08fccae53 Fix #146155: VSE: Too agressive sequencer scene versioning
The sequencer scene was set to the active scene in the window
in all cases. This is not great because we really only expect
the sequencer scene to be assigned when it was used.

The fix changes the versioning code to ensure that
1) The window has any VSE open.
2) The active scene uses an `Editing` struct (e.g. the user created
  strips, or interacted in some way with the VSE).

This also changes back the test that checks for the usages
of IDs. Before this test had to include the workspace for
the default scene. Now this scene is no longer used
by the workspace, because the versioning that sets
the sequencer scene is no longer run.

Pull Request: https://projects.blender.org/blender/blender/pulls/147044
2025-09-30 15:04:57 +02:00
Sybren A. Stüvel
dbcb701eb2 Anim: make it easier to convert from legacy to current Action API
The changes:

1. Add `group_name` to the `channelbag.fcurves.new()` and
   `action.fcurve_ensure_for_datablock()` RNA functions.
2. Add `anim_utils.action_ensure_channelbag_for_slot(action, slot)`.
3. Add `channelbag.fcurves.ensure()` RNA function.

This makes it possible to replace this legacy code:

```py
fcurve = action.fcurves.new("location", index=2, action_group="Name")
```

with this code:

```py
channelbag = action_ensure_channelbag_for_slot(action, action_slot)
fcurve = channelbag.fcurves.new("location", index=2, group_name="Name")
```

or replace this legacy code:

```py
fcurve = action.fcurves.find("location", index=2, action_group="Name")
if not fcurve:
    fcurve = action.fcurves.new("location", index=2, action_group="Name")
```

with this code:

```py
channelbag = action_ensure_channelbag_for_slot(action, action_slot)
fcurve = channelbag.fcurves.ensure("location", index=2, group_name="Name")
```

Note that the parameter name is different (`action_group` became
`group_name`). This clarifies that this is the name of the group, and
not a reference to the group itself.

This is part of #146586

Pull Request: https://projects.blender.org/blender/blender/pulls/146977
2025-09-30 14:43:56 +02:00
Bastien Montagne
1c64e403c4 Fix #146802: Py-defined property min/max handling is broken.
Regression from 469f54f484, somehow the clamping for default set of Int
properties was removed in this big refactor, merely add it back, and add
some unittests covering min/max handling.

Pull Request: https://projects.blender.org/blender/blender/pulls/146975
2025-09-29 15:01:08 +02:00
Jacques Lucke
4d91f5c8ef Fix #146588: raise exception when attempting invalid idproperty renaming in Python
Each name has to be unique within a group, so when renaming an idproperty, one
has to make sure that the parent group does not contain duplicates afterwards.
This patch raises a `NameError` when setting the name to one that exists
already. Alternatively, one could delete the already-existing property, but that
seems unexpected and the user should rather do that explicitly.

This also adds a new unit test for this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/146892
2025-09-29 13:54:08 +02:00
Casey Bianco-Davis
d2269441bb Python: Rename bpy.data.grease_pencils_v3 to bpy.data.grease_pencils
This renames `bpy.data.grease_pencils_v3` to `bpy.data.grease_pencils`.

Part of #125058.

Pull Request: https://projects.blender.org/blender/blender/pulls/146904
2025-09-29 12:32:08 +02:00
Amogh Shivaram
2bd06093c7 Cycles: Thin film iridescence for metals
Applies thin film iridescence to metals in Metallic BSDF and Principled BSDF.

To get the complex IOR values for each spectral band from F82 Tint colors,
the code uses the parametrization from "Artist Friendly Metallic Fresnel",
where the g parameter is set to F82. This IOR is used to find the phase shift,
but reflectance is still calculated with the F82 Tint formula after adjusting
F0 for the film's IOR.

Co-authored-by: Lukas Stockner <lukas@lukasstockner.de>
Co-authored-by: Weizhen Huang <weizhen@blender.org>
Co-authored-by: RobertMoerland <rmoerlandrj@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/141131
2025-09-29 02:58:20 +02:00
Hans Goudey
3bed61b33c Fix #146497: Geometry Nodes: Don't display deprecated "Texture" socket type
Ideally we'll remove this socket type at some point,
but for now we should make sure not to display it.

Pull Request: https://projects.blender.org/blender/blender/pulls/146502
2025-09-27 19:52:18 +02:00
Jeroen Bakker
8409f81f9f Workbench: Use strip curve rendering during rendertests
This PR enables strip curve drawing when performing the workbench
rendertests. On Intel/vulkan the lines are to far off. Using strip will
reduce platform differences. Downside is that (basic) line rendering is not
covered anymore by a render test.

Pull Request: https://projects.blender.org/blender/blender/pulls/146820
2025-09-26 12:38:47 +02:00
Weizhen Huang
2b0a1cae06 Cycles: Add an option to use ray marching for volume rendering
Null Scattering currently has performance and noise issues, and it will
take time to address them. For now add the previous Ray Marching back as
an option.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/146317
2025-09-26 12:14:45 +02:00
Jacques Lucke
4e4976804e Core: Add packed linked data-blocks
This adds support for packed linked data. This is a key part of an improved
asset workflow in Blender.

Packed IDs remain considered as linked data (i.e. they cannot be edited),
but they are stored in the current blendfile. This means that they:
* Are not lost in case the library data becomes unavailable.
* Are not changed in case the library data is updated.

These packed IDs are de-duplicated across blend-files, so e.g. if a shot
file and several of its dependencies all use the same util geometry node,
there will be a single copy of that geometry node in the shot file.

In case there are several versions of a same ID (e.g. linked at different
moments from a same library, which has been modified in-between), there
will be several packed IDs.

Name collisions are averted by storing these packed IDs into a new type of
'archive' libraries (and their namespaces). These libraries:
* Only contain packed IDs.
* Are owned and managed by their 'real' library data-block, called an
  'archive parent'.

For more in-depth, technical design: #132167
UI/UX design: #140870

Co-authored-by: Bastien Montagne <bastien@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/133801
2025-09-26 10:53:40 +02:00
Brecht Van Lommel
ab644f2ecb Tests: Compare all subimages in compositor file output tests
For multilayer files it was only comparing the first pass, so any issues
with other passes would be missed.

Also don't clear the filename for multilayer file output nodes, as that
doesn't work when there are multiple such nodes all writing to the same
file name. This will be used in an upcoming EXR multipart writing test.

Ref #146650

Pull Request: https://projects.blender.org/blender/blender/pulls/146726
2025-09-25 15:02:13 +02:00
Bastien Montagne
541f41c628 Tests: Split 'versioning' smoke-tests further.
While adding more tests does add a tiny bit of overhead, having tests
within the 10s range is better to ensure a good distribution of them
over many threads. It also helps narrowing down the actual blendfile in
case of issues.
2025-09-25 13:04:32 +02:00
Sean Kim
344040a891 Tests: Update workspace UI tests
* Removes unused entries for 2D Animation
* Adds 'Storyboarding' test

Pull Request: https://projects.blender.org/blender/blender/pulls/146760
2025-09-25 11:57:14 +02:00
Sean Kim
327a1925cf Paint: Rename curve and curve_preset
This commit renames the following DNA fields and corresponding RNA
properties to better represnt usage:

* `Brush.curve` to `Brush.curve_distance_falloff`
* `Brush.curve_preset` to `Brush.curve_distance_falloff_preset`

Pull Request: https://projects.blender.org/blender/blender/pulls/146254
2025-09-25 11:54:53 +02:00
Campbell Barton
84559f8bd4 Fix: trailing zeros added to the rounded value with split units
When units were split into larger and smaller values, the larger
value is rounded and should not show trailing zeros.
Trailing zeros should only be used for the smaller unit.

Ref !140790
2025-09-25 13:55:21 +10:00
Brecht Van Lommel
790527b149 Fix: Compositor test should ignore Software metadata with Blender version
OpenEXR files now write the Blender version, so this would fail
comparing metadata when we bump it.

Pull Request: https://projects.blender.org/blender/blender/pulls/146711
2025-09-24 18:08:44 +02:00
Jesse Yurkovich
7c75651b3b IO: Remove visible_objects_only property for USD and Alembic export
To help reduce confusion, remove this property as we believe it has
little to no actual utility. Visibility, instead, remains controlled
with the `evaluation_mode` option.

Ref #134012
See PR for discussion and description of what effect this option used to
have.

Pull Request: https://projects.blender.org/blender/blender/pulls/144600
2025-09-23 22:04:36 +02:00
Jeroen Bakker
6872fb1aaf Vulkan: Disable Workbench image log render tests
The image log render tests uses an EXR that contains INF. Workbench
with specular enabled will mix these INFs, but there is a difference
in behavior between OpenGL and Vulkan.

In OpenGL mix(0.05, INF, 0.0) will result in INF
In Vulkan this results in NaN.

This should eventually be solved in the engine to ensure consistency.
For now we disable the render test and document the limitation.

Pull Request: https://projects.blender.org/blender/blender/pulls/146648
2025-09-23 16:45:30 +02:00
Sean Kim
289d812712 Fix #146143: MacOS UI Test failures with multiple windows
This commit bumps up the time delay while running these tests from
1/60th of a second to 1/6th of a second to ensure that the new window
is created prior to the rest of the test running while.

Pull Request: https://projects.blender.org/blender/blender/pulls/146309
2025-09-23 15:56:15 +02:00
Jeroen Bakker
e0a056574d Fix: Vulkan: Volume Workbench Tests
Due to an incorrect assumption float buffers were converted to sRGB
values when uploading to an sRGBA8 texture. This is done when rendering
flames in workbench and resulted in to bright renders.

This PR removes sRGB encoding when uploading float values to sRGBA8 textures.

Fixes:
- render/openvdb/fire
- render/openvdb/principled_blackbody
- render/openvdb/smoke_fire

Pull Request: https://projects.blender.org/blender/blender/pulls/146636
2025-09-23 14:44:42 +02:00
Campbell Barton
705c868bb9 Cleanup: trailing space 2025-09-23 09:37:03 +10:00
Clément Foucault
aa95220576 Metal: Add workaround for imageAtomic synchronization issue
A compiler/driver bug makes so that we can't rely on image atomics.

Adding a write that is never executed after the atomics tricks
the compiler to issue the correct synchronisation instruction.

This fixes a bunch of our render tests differences.

We will keep this workaround until this is fixed upstream.

Pull Request: https://projects.blender.org/blender/blender/pulls/146442
2025-09-22 11:45:27 +02:00
Hans Goudey
ea5bc15402 Tests: Add automated tests for mesh object joining
Basic tests for a few cases. Doesn't require a separte blend file.

Pull Request: https://projects.blender.org/blender/blender/pulls/145684
2025-09-21 19:11:27 +02:00
Ray Molenkamp
abd683fcb5 CMake: CTest: Disable blendfile_library_overrides test
This test is intermittently failing. Disable it for now to avoid other work
being incorrectly flagged as broken. Once issue #146221 is resolved this
test must be re-enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/146411
2025-09-17 17:38:40 +02:00
Sean Kim
3995359236 Tests: Add UI test for verifying all sculpt tool properties
This commit adds a UI test that activates each of the default tools for
a mesh in Sculpt Mode and verifies that no Python errors are emitted
when the corresponding tool settings are displayed to the user.

Note that this does not test all of the default bundled brushes.

Pull Request: https://projects.blender.org/blender/blender/pulls/144397
2025-09-16 16:15:47 +02:00
Habib Gahbiche
1b4daf9d2e Nodes: remove "Use Nodes" in Shader Editor for Object Materials
"Use Nodes" was removed in the compositor to simplify the compositing
workflow. This introduced a slight inconsistency with the Shader Node
Editor.

This PR removes "Use Nodes" for object materials.

For Line Style, no changes are planned (not sure how to preserve
compatibility yet).
This simplifies the state of objects; either they have a material or
they don't.

Backward compatibility:
- If Use Nodes is turned Off, new nodes are added to the node tree to
simulate the same material:
- DNA: Only `use_nodes` is marked deprecated
- Python API:
  - `material.use_nodes` is marked deprecated and will be removed in
6.0. Reading it always returns `True` and setting it has no effect.
  - `material.diffuse_color`, `material.specular` etc.. Are not used by
EEVEE anymore but are kept because they are used by Workbench.

Forward compatibility:
Always enable 'Use Nodes' when writing blend files.

Known Issues:
Some UI tests are failing on macOS

Pull Request: https://projects.blender.org/blender/blender/pulls/141278
2025-09-14 17:53:54 +02:00
Omar Emara
b10d767c4e Fix #134920: File Output writes frame for single render
The File Output node always appends the frame number even if the render
is not an animation. This patch makes it such that the frame number is
only written if the render is an animation. The user can use a frame
variable to manually append the frame number if needed.

The command line rendering interface already uses animation rendering in
all cases, so it should not be affected. However, rendering using the
render.render() operator with animation=False will see the behavior
change, however, setting animation=False and start_frame and end_frame
to the same frame number should be sufficient to restore the old
behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/141209
2025-09-12 09:01:31 +02:00
Christoph Neuhauser
2c9b273b74 Fix #145594: Tests: Check Windows command line length for batched tests
This PR adds a check that batched tests do not surpass the Windows
command line limit of 32,767 characters (including the terminating null
character). This could previously happen if long path names were used.

Pull Request: https://projects.blender.org/blender/blender/pulls/145792
2025-09-10 17:57:01 +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
Jeroen Bakker
a057a29ef7 Vulkan: Pass EEVEE render tests
EEVEE render tests were failing in aov_transparency. This is a known
file to be failing for Metal and AMD hardware. This PR increases the
fail threshold to let the test pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/145917
2025-09-08 14:33:42 +02:00
Campbell Barton
acac786db8 Cleanup: use str.format for bl_rna_manual_reference test 2025-09-06 04:36:12 +00: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
Jeroen Bakker
84e2795ee2 Fix: Vulkan: Workbench rendertest were not reported
The Vulkan workbench rendertests were not included to the overall
report due to a typo.
2025-09-05 14:34:14 +02:00
Brecht Van Lommel
c984f6b67a Fix: Python error creating new reference renders for tests
Pull Request: https://projects.blender.org/blender/blender/pulls/145755
2025-09-05 11:11:32 +02:00
Campbell Barton
a590e4fa6b Cleanup: correct comments, add __all__ to bl_pyapi_prop_array.py 2025-09-04 16:55:41 +10:00
Falk David
3978908c98 Python: VSE: Remove deprecated "sequence" context API
Remove APIs that have been deprecated since Blender 4.4.
See https://developer.blender.org/docs/release_notes/4.4/python_api/#deprecated_1.

Pull Request: https://projects.blender.org/blender/blender/pulls/145597
2025-09-03 19:31:30 +02:00
Brecht Van Lommel
5cc6ad6afe Video: Save colorspace metadata based on display, remove HDR option
Now that there are Rec.2100 PQ and HLG displays, the additional HDR option
for video export is redundant. Typically you would now select a HDR display
early on and do all your video editing with it enabled.

For saving a HDR video, the encoding panel will now show the name of the color
space, and warn when the video codec or color depth is incompatible.

Since this is now based on interop IDs for the dislpay color spaces, we can
map more of those to the appropriate CICP code. This works fine for Display P3,
in my tests it looks identical to sRGB except that the wide gamut colors are
preserved.

However Rec.1886 and Rec.2020 are problematic regarding the transfer function,
although the latter at least has the correct primaries now. So it should be
a net improvement and this could be looked at later if anyone wants.

---

Background:

* Rec.1886 and Rec.2020 display color spaces in Blender use gamma 2.4.
* BT.709 trc is almost the same as gamma 2.4, so seems like the correct choice.
* We already write sRGB with BT.709 trc, which seems wrong.
* Yet sRGB matches exactly between Blender display and QuickTime, while
  Rec.1886 and Rec.2020 do not.
* Display P3 with BT.709 trc matches sRGB with BT.709 trc, just adding the wide
  gamut colors. So that is what is used for now. Also using the sRGB trc the
  file is not recognized by QuickTime.

There is apparently a well known "QuickTime gamma shift" issue, where the
interpretation of the BT.709 trc is different than other platforms. And you need
to do workarounds like writing gamma 2.4 metadata outside of CICP to get
things to display properly on macOS.

Not that QuickTime is necessarily the reference we should target, but just to
explain that changing the previous behavior would have consequences, and so
it this commit leaves that unchanged.

Pull Request: https://projects.blender.org/blender/blender/pulls/145373
2025-09-03 16:32:33 +02:00
Bastien Montagne
469f54f484 BPY: Implement get_transform and set_transform for runtime-defined RNA properties.
Improve handling of runtime defined python RNA properties. Mainly:
* Add `get_transform` and `set_transform` new callbacks.
  These allow to edit the value, while still using the default
  (IDProperty-based) storage system.
* Read-only properties should now be defined using a new `options` flag,
  `READ_ONLY`.
* `get`/`set` should only be used when storing data outside of the
  default system now.
  * Having a `get` without a `set` defined forces property to be
    read-only (same behavior as before).
  * Having a `set` without a `get` is now an error.
* Just like with existing `get/set` callbacks, `get_/set_transform`
  callbacks must always generate values matching the constraints defined
  by their `bpy.props` property definition (same type, within required
  range, same dimensions/sizes for the `Vector` properties, etc.).
* To simplify handling of non-statically sized strings, the relevant
  RNA API has been modified, to use `std::string` instead of
  (allocated) char arrays.

Relevant unittests and benchmarking have been added or updated as part
of this project.

Note: From initial benchmarking, 'transform' versions of get/set are
several times faster than 'real' get/set.

Implements #141042.

Pull Request: https://projects.blender.org/blender/blender/pulls/141303
2025-09-02 11:30:09 +02:00
Campbell Barton
75d878a107 Correct error updating the tests in last commit
Correct error in 9ff2ccd350
2025-08-29 22:21:46 +10:00
Campbell Barton
9ff2ccd350 Fix: incorrect handling of 3x3 matrices with RNA get/set callbacks
Thanks to @mont29 for spotting the error.
2025-08-29 22:16:39 +10:00
Jesse Yurkovich
7111e95527 USD: Import UsdNurbsCurves as Curves instead of old Curve
Refactor and revamp import and export of `UsdGeomNurbsCurves` prim
objects.

Fixes #130056, among other things.

Summary of changes and enhancements:
- Export:
  - Write out `nurb_weight` attribute as the USD `pointWeights` primvar
  - Properly write out cyclic NURBS curves data (* see notes)
- Import:
  - Import using the new `Curves` datablock rather than the old `Curve`
  - Properly read in cyclic NURBS curves data (* see notes)
  - Tries harder to match incoming knot vector to standard `knots_mode`,
    will use Custom otherwise
  - Support import of all custom primvars and data attached to the prim
    (for use with Geometry Nodes etc.) (* see notes)

Tests were added which check a variety of point count, order, knot_mode,
and cyclic combinations (generated through Geometry Nodes). A small
number of hand-crafted curves were used to test the Custom knots_mode
support on import. Additionally, the tests cover the case when there are
multiple curves defined for a single object.

Notes:
- Cyclic NURBS support is reliant on the current, under-spec'd, USD
  documentation. Changes may be required in the future if/when the USD
  spec is clarified: https://github.com/PixarAnimationStudios/OpenUSD/issues/3740
- Some Cyclic x knots_mode combinations are not correct and would
  require more research to determine how to properly address.
- Custom attributes are not imported for Cyclic NURBS curves yet. Those
  will require additional work to function correctly and are also
  reliant on seeing how the USD spec changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/143970
2025-08-27 19:34:46 +02:00
Bastien Montagne
65e9b99e85 Tests: Minor update to systematic tests of numerical bpy.props-defined props. 2025-08-26 15:01:55 +02:00
Lukas Tönne
12f0bc7736 Fix #138388: Use grid voxel corners as value locations like OpenVDB
Blender grid rendering interprets voxel transforms in such a way that the voxel
values are located at the center of a voxel. This is inconsistent with OpenVDB
where the values are located at the lower corners for the purpose or sampling
and related algorithms.

While it is possible to offset grids when communicating with the OpenVDB
library, this is also error-prone and does not add any major advantage.
Every time a grid is passed to OpenVDB we currently have to take care to
transform by half a voxel to ensure correct sampling weights are used that match
the density displayed by the viewport rendering.

This patch changes volume grid generation, conversion, and rendering code so
that grid transforms match the corner-located values in OpenVDB.

- The volume primitive cube node aligns the grid transform with the location of
  the first value, which is now also the same as min/max bounds input of the
  node.
- Mesh<->Grid conversion does no longer require offsetting grid transform and
  mesh vertices respectively by 0.5 voxels.
- Texture space for viewport rendering is offset by half a voxel, so that it
  covers the same area as before and voxel centers remain at the same texture
  space locations.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/138449
2025-08-26 12:27:20 +02:00
Sybren A. Stüvel
3016cf650d Geometry Nodes: implement file path callback for import nodes
Add geometry file import nodes support to the for-each-path logic.
This will make `bpy.data.file_path_map()` report the input files for
OBJ, PLY, etc. import nodes (and any other node that has a string
property of subtype `PROP_FILEPATH`).

Currently this only supports static file paths, so where the file path
is set as the input socket's default value. When the path is
determined via any noodle, this is ignored and the default value is
reported anyway.

This is necessary for the new version of Blender Asset Tracer, which
in turn is needed to resolve studio/flamenco#104423.

Pull Request: https://projects.blender.org/blender/blender/pulls/144874
2025-08-26 11:03:27 +02:00
Bastien Montagne
8bb8bff4bf Tests: bpy props: Add systematic tests for non-array types.
Fairly basic tests still, would need to be extended to check invalid
cases handling too.

Pull Request: https://projects.blender.org/blender/blender/pulls/145136
2025-08-25 18:47:37 +02:00
Jesse Yurkovich
8078dcddf9 Tests: Adjust rounding in USD crease value test
Mistake in a8f543f6a8 where I believed the default Python `round`
function would use at least 2 decimal places by default. In reality it
uses 0 by default.

Round to 5 places to match other places in the test suite.

Pull Request: https://projects.blender.org/blender/blender/pulls/145088
2025-08-25 17:51:32 +02:00
Falk David
1122a05cb6 VSE: Scene Selector & Scene Time Synchronization
Implements the proposed design (with some modifications) in #135058.

## Sequencer Scene

This adds a new property called `sequencer_scene` to workspaces. This scene is used
by the video sequence editors in the current workspace for their context.
This is a first step towards "detaching" the VSE from the active scene in the window.

Each sequencer timeline editor shows the sequencer scene that is being used.
By default, when no sequencer scene is selected, the timeline and preview are empty.

Pressing the "new" button will add a new scene and assign it to the sequencer
scene for the current workspace.

## Contextual Playback

Pressing `Space` (by default) for starting the animation playback is now contextual:
depending on the context (where your mouse cursor is), the scene that is played back
might be different. E.g. with a 3D Viewport and a Sequencer open, pressing "play"
in the 3D Viewport will play the _active scene_ of the window, while pressing "play"
in the sequencer will play the _sequencer scene_.

## Time & Scene Synchronization

Additionally, this adds a toggle called "Sync Active Scene".
With the property turned on, the active scene & scene time in the window will be
synced with the time & scene of the current scene strip in the sequencer.

Note that this is _not_ bi-directional. The sequencer can change the active scene
and map time, but it's not possible the other way around since it one can have
multiple strips using the same scene (+camera, and even time!).

Currently this setting is exposed in the footer of the sequencer timeline as well
as in the workspace settings.

This allows for one of the core concepts that the story tools projects aims at: Working
in a scene (e.g. in the 3D viewport) while also working with the edit
(in the sequencer timeline).

## Some technical notes

* Undoing while playback is running will now cancel playback. This is to avoid the timer,
   that points to the scene and viewlayer that are playing, to get de-synced after loading
   the memfile undo step.
* When the sequencer scene is not the same as the active scene, we ensure it has
   a depsgraph.
* Normally, when a `NC_SCENE` notifier points to a specific scene, the notifier is dropped
   if that scene doesn't match the active one in the window. We now also check that it
   doesn't match the sequencer scene in the active workspace.
* When loading older files, we need to make sure that the active workspace in a window
   uses the active scene as the sequencer scene. This is to make sure that the file opens with
   the same sequences open.
* Tool settings are stored per scene. To make sure the sequencer uses the tool settings for
   the sequencer scene, the "context.tool_settings" and `CTX_data_tool_settings` members
   are overridden in the sequence editors.

Pull Request: https://projects.blender.org/blender/blender/pulls/140271
2025-08-25 11:58:17 +02:00
Bastien Montagne
1028879ffa Test: Extend runtime-defined bpy props array unittests.
This add systematic tests for bool/int/float 'Vector' bpy props for:
* Index access
* Slice access
* 1d, 2d and 3d arrays
* default storage and custom storage (get/set)

NOTE: Non-vector prop types also need some systematic testing, they do
not appear to have any currently?

Pull Request: https://projects.blender.org/blender/blender/pulls/144998
2025-08-22 18:37:41 +02:00