Previously, Repeat Zones with non-static iterations would be fully
disconnected.
With this patch, they behave as if they have 0 iterations.
Co-authored-by: Jacques Lucke
Pull Request: https://projects.blender.org/blender/blender/pulls/147211
Instead of modifying the active mesh in place, which means we can't
use the size of its data arrays when copying its data, and its caches
are immediately invalidated, copy data to a separate out-of-main
result mesh first. The only downside is that for a moment during
the operator the shape key array sizes will be out of sync with the
mesh size.
Also the custom data for multires layers wasn't copied properly
after the recent refactor that rewrote this code. Take the opportunity
to fix that too.
The motivation for this change is an improvement to copy different
kinds of custom normals properly to the joined mesh, which never
worked since free custom normals were introduced.
This contains a few changes to the expected results in the tests.
Those are edge cases, and the new results make more sense.
Explicitly set the transform of a grid.
The new transform can fail to be applied if the input transform isn't
invertible or for some extremes of scaling (0 or combinations of
negative and positive) and numerical errors with `openvdb`. If a
transform is not applied an error is raised and the `Is Valid`
returns false.
Pull Request: https://projects.blender.org/blender/blender/pulls/146824
Adds four new grid operator nodes that wrap OpenVDB's differential
operators. All nodes take a grid input and output a grid, potentially
with a different data type.
New nodes:
- Grid Curl: Calculate curl of vector field (Vec3 → Vec3)
- Grid Divergence: Calculate divergence of vector field (Vec3 → Float)
- Grid Gradient: Calculate gradient of scalar field (Float → Vec3)
- Grid Laplacian: Calculate Laplacian of scalar field (Float → Float)
These operators enable vector calculus operations on volume grids for
effects like flow analysis, vortex detection, etc.
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/146845
Adjust various unit tests so that they no longer use the legacy Action
API (which was deprecated in Blender 4.4 and will be removed in 5.0).
No functional changes.
This is part of #146586
Pull Request: https://projects.blender.org/blender/blender/pulls/147060
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
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
Adds a Join Bundle node with a multi-input Bundle socket. Bundles are
iterated on the top level of each input bundle and items added to the resulting
single bundle. While creating the final bundle existing items have priority and
new items with an already existing name are discarded.
There is an info message when there are duplicate keys in the input bundles.
Co-authored-by: Brady Johnston
Co-authored-by: Jacques Lucke
Pull Request: https://projects.blender.org/blender/blender/pulls/146750
When a strip modifier uses an adjustment layer that is above it
as the mask input, this leads to recursive rendering. Similar to the
fix in !146624, pass SeqRenderState to modifiers as well.
Pull Request: https://projects.blender.org/blender/blender/pulls/147029
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
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
This implements the Menu Switch node in shader nodes. It's the same node that is
used in Geometry Nodes and the Compositor.
The Menu Switch node is purely handled during preprocessing and thus builds on
top of #141936. Hence, it's input has to be a single value, just like the
iteration count for repeat zones. This limitation can be lifted in the future,
but currently there is no way to produce a non-single menu value in shader
nodes. This will become possible if other Switch nodes are added though.
Pull Request: https://projects.blender.org/blender/blender/pulls/146896
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
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
This node outputs tangent values for face corners. There are two methods:
- **Exact** is the same MikkTSpace calculation used elsewhere in Blender.
- **Fast** (from #131308) is over 4x faster, and useful in many of
the same situations, though not necessarily tangential to the surface.
The reason to include both methods is that there are use cases where the
quality of the tangents don't matter (though the results are actually very
similar visually), we just need some continuous values across faces.
Pull Request: https://projects.blender.org/blender/blender/pulls/145813
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
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
Previously it was only working for the single layer case. For multipart
we write the colorspace in each part. For single part we write the first
non-data colorspace, and hope data passes will be identified based on channel
name like Blender does (e.g. XYZ instead of RGB).
Reading is unchanged and still the same as before, in that it only reads the
colorspace from the first part. There is only one color space per image
datablock, so we can not store anything more currently. In practice it
would be unusual for all passes in a file not to either have the same
colorspace or be data.
All the compositor file output test images were updated to include the
metadata, so that the test will check if the metadata is there.
Ref #144911
Pull Request: https://projects.blender.org/blender/blender/pulls/146809
New "Interleave" option in image format settings, enabled by default in old
files and disabled by default in new files to write multi-part files.
By not storing all channels interleaved, it is possible for other applications
to load individual passes more efficiently. This might also work better with
compression.
We follow the OpenEXR docs in that the channel name is the full
Layer.Pass.Channel rather than just Channel. Some other renderers
(e.g. Houdini Karma) write just the channel and that is what our reading
code assumed so far.
I've verified that Nuke can read the multipart EXR files produced by Blender,
including multiview and cryptomatte.
Fix#123727
Pull Request: https://projects.blender.org/blender/blender/pulls/146650
* Add adaptive subdivision properties natively on the subdivision surface
modifier, so that other engines may reuse them in the future. This also
resolve issues where they would not get copied properly.
* Remove "Feature Set" option in the render properties, this was the last
experimental one.
* Add space choice between "Pixel" and "Object". The latter is new and can
be used for object space dicing that works with instances. Instead of
a pixel size an object space edge length is specified.
* Add object space subdivision test.
Ref #53901
Pull Request: https://projects.blender.org/blender/blender/pulls/146723
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
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.
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
When effect of adjustment layer strip is moved below the adjustment
layer, this causes infinite loop in strip rendering. Same happens when
you use multicam strip and set source channel to one of its effects.
This is fixed by passing `SeqRenderState` to the effects. If any strip
renders "seqbase" pointer of strip is stored in set in the render state
struct. If the pointer exists in this set, function returns without
rendering anything. In other words, The strip must never render itself.
Pull Request: https://projects.blender.org/blender/blender/pulls/146624
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
This patch removes the XY scale inputs from the Displace node. The
inputs were redundant since they were just multiplied by the vector.
This simplifies the node and improves performance slightly.
Additionally, the Vector input was renamed to Displacement since it no
longer specifies a direction.
Pull Request: https://projects.blender.org/blender/blender/pulls/146356
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
This patch reorders the inputs of some of the compositor nodes
accordingly to their importance. The importance is already quantified
internally using the domain priority of the input, so we needn't make
any subjective judgement and just order by the priority.
This breaks forward and backward compatibility if input indices were
used as opposed to input identifiers due to the different order.
Handling compatibility is not impossible, but is difficult, and it was
already ignored in many past node changes.
Pull Request: https://projects.blender.org/blender/blender/pulls/146311
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
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
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
On its own, the main functionality of the Radial Tiling node
is the ability to divide a 2D Cartesian coordinate system into
as many radial segments as specified by the "Segments" input.
Each segment has its own affinely transformed coordinate system,
provided through the "Segment Coordinates" output, which can be
used to tile textures in a radially symmetric manner.
Additionally, a unique index is provided for every segment through
the "Segment ID" output, the width of each segment at Y-coordinate
of the "Segment Coordinates" output without normalization = 0 is
provided through the "Segment Width" output and the rotation value
of the affine transformation of the coordinate system of each segment
is provided through the "Segment Rotation" output.
The roundness of the coordinate lines of the "Segment Coordinates"
output can be controlled through the "Roundness" inputs.
This can be used to make the coordinate systems of the segments
a mix of Cartesian and polar coordinates.
Lastly, the lines of points of the "Segment Coordinates" output with
constant Y-coordinates have the shape of polygon with rounded corners,
which can be used to procedurally create rounded polygons.
Pull Request: https://projects.blender.org/blender/blender/pulls/127711
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
These are causing quite a big difference in existing files, which is not
easy to address in versioning. Since the goal of removing this was to
simplify things for us and that's not the case, just revert this change.
This reverts commit ab21755aaf.
Ref #139923
Pull Request: https://projects.blender.org/blender/blender/pulls/146336