Prior to version 3.5, when importing an Alembic file the default and
active color attributes were set to the first color layer. Since then,
as the default and active color attributes are stored as strings on the
Mesh object, importing an Alembic file leaves those uninitialized.
Note that this only worked prior to 3.5 as the indices for the active
and default layers were initialized by default to zero.
Remembering those default and active attributes is necessary after
an import for e.g. being able to visualize the colors using viewport
shading overlays.
As Alembic does not have a concept of default or active color
attribute, this writes the name of those attributes in the mesh user
properties during export.
During import, we lookup those properties and use them to set the
default and active color layers. If the properties do not exist, we
default to the first color layer.
This adds a test for the new export and import of the default and
active names, and updates old tests to check that the fallback to the
first layer works.
Pull Request: https://projects.blender.org/blender/blender/pulls/164075
Curves and points radii were read and written assuming they are always
defined on the vertex scope. This is a bit mistaken as those are
GeomParams in Alembic, which means that they could be defined on any
scope.
For export, we now write them on the Constant scope if the radius
attribute is a single value. Otherwise, we keep exporting on the vertex
scope.
For import, we read radii values properly according to the Alembic
scope. For Constant scope, we simply create a single value array.
This also adds some `get_sane_range` function to sanitize the range
used when iterating over Alembic data when reading curves widths.
This mirrors what is currently done for reading points widths.
Pull Request: https://projects.blender.org/blender/blender/pulls/164077
Should help finding regressions in modifier related UI operations and UI
drawing.
This test:
1. Creates test objects of different types (Mesh, Curve, Grease Pencil,
Lattice, Volume, Armature).
2. Adds all available modifiers to the objects dynamically.
3. Switches the Properties editor to the Modifiers tab for each object
type and redraws.
4. Adds all available constraints to the objects and bones.
5. Switches the Properties editor to the Constraints tab and redraws.
Pull Request: https://projects.blender.org/blender/blender/pulls/161642
This adds functionality to store world space data in a temporary file
on disk and paste it on other objects.
(technically `AnimTransformable`s, which is objects or bones, but for
simplicity I will be talking about "objects" here)
Compared to the existing functionality this can also copy a
range of frames. Because the data is stored on disk, it is possible
to copy and paste between files.
**Matching Logic**
* When 1 object copied and 1 selected -> paste no matter the naming
* When 1 object copied and 2:n selected -> paste the same data to
all selected
* When 2:n objects copied and 1:n selected -> paste based on naming.
It is possible to paste between objects and bones as long
as the name matches.
**Depsgraph**
* Introduces a new API function `DEG_foreach_dependent_component`
* this function iterates the outgoing links starting at a given ID
* it is used to find the order in which to paste world space transforms
since we have to paste in order of dependency -> dependent
for it to work correctly.
**UI**
Adding a new panel because the new operators are not compatible
with the existing ones. I cannot remove the existing operators because
they provide functionality that I don't yet provide.
To make it clear that they don't work together, they get their own panel.
**Limitations**
* objects with constraints may not end up at the correct world space.
That is expected for limit constraints, but additive constraints would
need to be inverse solved which is a job for another day.
* when the rotation mode is animated, pasting world space animation
will override all keys in the baked range to be the value at the
start of the range.
**Performance**
Testing in a file with 10.000 frames of dense keyframe data.
Copying a single bone:
* Copying ~1.6 seconds
* Pasting ~1.6 seconds
Copying 3 bones of the same armature
* Copying ~1.6 seconds
* Pasting ~4.8 seconds
The extra evaluation required when pasting makes this scale with the
amount of bones we are pasting.
Part of #156579
Pull Request: https://projects.blender.org/blender/blender/pulls/159390
Adds an attenuation factor inside the LTC evaluation, reducing light
leakage in our approximation. Further refactors surrounding code to
avoid recomputing light data that is in the caller.
Pull Request: https://projects.blender.org/blender/blender/pulls/161262
Command line overrides now define the default "Trusted Source"
for drop and the file-selector.
This is done so the default matches the behavior of opening
files in contexts where the option to trust source isn't shown.
"Recover Last Session" run without setting "use_scripts"
(from Python for e.g.) now disables auto-execution
unless a command line override is passed in,
as the path being recovered isn't known until the file is read.
This includes a refactor & tests.
Details:
- `bpy.path.is_autoexec(..., skip_overrides=False)`:
Can be used to check if the current environment would trust a file.
- Expose: `bpy.app.autoexec_override`,
set when `--enable-autoexec` & `--disable-autoexec` are passed in.
- `BKE_autoexec_default_trust_source`:
new function to more conveniently access the default trust for a file.
- Show when "Auto Run Python Scripts" preference is overridden.
- Add tests for the file selector, dropping & the command line.
Ref !163894
This adds UI tests for the Info Editor report functionality to improve
automated coverage of report-related operators and settings.
Tests cover report selection/deselection, deletion and operator polling
to ensure Info Editor operators are available in the expected context.
Pull Request: https://projects.blender.org/blender/blender/pulls/161091
While testing driver stack changes while moving our AMD GPU workers
from Rocky Linux 8 to Ubuntu 24.04 these tests came up as errors. Some
of these errors could be attributed to hardware differences (W7600 vs.
W7800).
Pull Request: https://projects.blender.org/blender/blender/pulls/163975
Based on the "Stochastic ray tracing of transparent 3D Gaussians" paper
by Xin Sun et. al. The basic idea: perform stochastic intersection with
the Gaussian splat based on its transparency.
Gaussian splats are implemented as a dedicated primitive type, but it
shares the same layout for position and radius as points, so a lot of
existing functions (positions, attributes, etc) work for both points
and splats.
For the Embree and hardware intersection it is implemented as a custom
primitive type.
The choice of using bounding spheres mainly comes from a balance between
performance and memory usage. More ideal would be to use OBB, but it is
not supported for custom primitive types in Embree and GPU HW-RT on all
backends.
There is a known limitation that comes from the fact that the datasets
are trained in sRGB space and Cycles work in Linear space: areas with
low opacity and high radiance render noticeably differently from the
ground-truth implementation.
Ref #159470
Pull Request: https://projects.blender.org/blender/blender/pulls/163103
The goal is to make it easy to import gsplats in geometry nodes,
without extra manual setup. Ideally, it should be possible to
drop PLY file into the node editor and it would import as either
mesh or gsplat depending on the actual file content.
The easiest way of doing so is to make the existing PLY node a
bit more flexible: name the output socket "Geometry" and detect
the PLY type automatically. This mimics the behavior when the
PLY file is imported via the File menu (or by dropping the file
into the viewport).
The alternative of either using separate node or an explicit
import type on the node was considered, but both approaches have
a downside due to the way how the import currently works: there is
currently no way to analyze the file before creating node, so it
will be quite tricky to implement logic which creates proper node
or sets the import type. There are also ease-of-use concerns.
The Mesh output was renamed to Geometry, but kept its old Mesh as
an identifier so that old files keep working without extra
versioning, and scripts do not break.
An utility was added to the PLY module to return result as a
GeometrySet component, making it easier to integrate into the
node.
Pull Request: https://projects.blender.org/blender/blender/pulls/163624
Expose SSBO through the Python API.
Come with `clear_to_zero` and `read`.
`GPU_BARRIER_SHADER_STORAGE` is also added to `pygpu_compute_dispatch`
However, this doesn't cover storage writes from a fragment or vertex
stage.
So we need to introduce a standalone method from the pyGPU module itself
(not linked to an object type). This will done in a follow up PR.
Ref #145179.
Pull Request: https://projects.blender.org/blender/blender/pulls/161447
Why:
Feature parity. Cycles has sun disk. EEVEE's atmospheric contribution
was incomplete without one.
How:
Should be pretty self explanatory. Grab the values from the Node.
Compute the values. Sum into the sky RGB. Designed to mimic the
convention Cycles uses. With the exception of the angular distance,
instead using the GLSL helper. Also removed the GUI warning as it was no
longer necessary.
For obvious reasons. The sun would not survive baking into the LUT. So
its summed to the final RGB.
Pull Request: https://projects.blender.org/blender/blender/pulls/163132
This adds support to export arbitrary attributes to Alembic, for
meshes, curves, and pointclouds.
All attribute types are exported except `float4` which is not supported
by Alembic. See code comments for potential solutions if this becomes a
problem in the future.
For the actual export, a single function is exposed to create a
`TypedGeomParam` for each attribute. To keep track of those
`TypedGeomParams` across frames, a class `AttributeParamMaps` is added.
This class holds a map for each type from attribute name to geom param.
An instance of this class is added to each object type writer and is
lazily created when exporting attributes. This class generalizes what
we have currently in `CDStreamConfig` for UVs, vertex colors, and
orcos.
Export of vertex colors is now done with this new mechanism. UVs are
not exported by this new code as they have the option to be
deduplicated and indexed, which is not supported for other attribute
types. Support for this for all attributes could be added in the future
though.
Finally, attributes consisting of a single value are exported as such
on the constant scope.
Fixes#157620Resolves#99293
Pull Request: https://projects.blender.org/blender/blender/pulls/163162
Open a blend file from a trusted & an excluded directory using the file
selector & the popup shown when dropping a file, checking
bpy.app.autoexec once the file is open.
Dropping can't be simulated yet, so bind the drop operator to a key.
Ref !163785
Command line tests use the arguments overriding the preference, with
relative paths, paths stepping into an excluded directory & globs.
Also tests the code-path for opening blend files from file-associations
on UNIX/WIN32, but macOS's event: GHOST_kEventOpenMainFile.
Ref !163781
test_open_editor_types opens many areas, each requiring its own
GLContext. The maximum number of available contexts is driver
implementation and cannot be queried. We disable the test on OpenGL
platforms.
It is safe to use on Vulkan/Metal as they don't have a context.
Pull Request: https://projects.blender.org/blender/blender/pulls/163736
Callers had to split the directory from a blend-file path before checking
it against the excluded paths. Add "canonicalize" & "strip_filename" to
BKE_autoexec_match & bpy.path.is_autoexec so this is done in one place.
Depending on the source of the filepath, we can't rely on it
being normalized, so canonicalize should be used when the path
comes from external sources such as command line arguments
or dropped paths.
Ref !163715
In Cycles we previously assumed that the IOR inversion, when hitting a
surface from the backside, for dielectric closures
(e.g., generalized_schlick, microfacet, refract, etc.) is done by the
user in the OSL code. While experimenting with the OSL code generated
by MaterialX and by looking at the example OSL shaders of the OSL
testrender it shows that OSL assumes that this inversion is done
implicitly, inside the closures. This change matches Cycles IOR
inversion behavior with the one expected by MaterialX and OSL
testrender.
Pull Request: https://projects.blender.org/blender/blender/pulls/162634
This patch blocklists the Fire2 and node_keying_matte tests on AMD
OpenGL Linux because they have been failing on the build-bot with way to
reproduce locally.
Pull Request: https://projects.blender.org/blender/blender/pulls/163661
In D16235[^1], Cycles MNEE was only enabled on macOS 13 and above due to
an inefficiency in the calculation of spill requirements (quoting from
the patch), following the minimum macOS deployment target bump to 13.0
in !163627, remove the now unneeded checks this patch introduced, both
on the Cycles feature side, UI side and Cycles test blocklist.
Additionally, as the `__KERNEL_METAL_MACOS__` global define introduced
by this patch didn't have any other additional users, it was also
removed.
[^1]: https://archive.blender.org/developer/D16235
Pull Request: https://projects.blender.org/blender/blender/pulls/163665
Adds `context.markers` and `context.selected_markers` to simplify
accessing the markers relevant for the current animcontext.
Uses the context's scene to retrieve the relevant markers,
taking into account the possibility that we're in an Action Editor
with pose markers visible.
Updates the F2 rename operator to use this (although it might later
be updated to operate on the active marker instead).
The new properties intentionally don't query the sequencer scene,
since that might be unexpected or undesired in some situations.
If needed, a context override can be used to access (selected) markers
from another scene:
```py
with context.temp_override(scene=context.sequencer_scene):
return context.markers
```
Adds python tests to retrieve markers from various sources using these
new context properties.
Pull Request: https://projects.blender.org/blender/blender/pulls/162157
This commit moves the experimental 3D Texture Paint brush implementation
out of Sculpt Mode and into Texture Paint mode.
Instead of overriding the "Paint" brush in Sculpt Mode, it now
corresponds to the "Draw" brush in Texture Paint.
This is achieved by extending the existing `PAINT_OT_image_paint`
operator to use a different `PaintStroke` implementation if a supported
brush is being used with the experimental flag toggled.
Part of #162290
Pull Request: https://projects.blender.org/blender/blender/pulls/163220
This adds a more generalized way to operators to activate text buttons in
regions; this first tries to activate the text button in the region, and
if it fails it tags to rebuild the layout so there is a second chance to
the button to become available for activation.
This refactors how some operators activate text buttons, most of them
assumed the button were visible, and others immediately redrew the
region so the buttons can be made available. This instead makes the
button activation part of the block layout build.
This will affect Preferences, Properties, Space Text and Outliner.
Pull Request: https://projects.blender.org/blender/blender/pulls/161477
# Implemented
- Panoramic camera types: equirectangular,
equiangular cubemap face, fisheye equidistant,
fisheye equisolid, fisheye lens polynomial,
central cylindrical, mirror ball.
- Render 6 subviews (fixed 90° FOV each, 5% overscan).
- Subview enable/disable masking (PanoramicViewBits)
to skip faces not needed for narrow FOV.
- Accumulate radial depth for panoramic projections.
- Film accumulation per owning face per pixel.
# Future tasks
### Turned off for now
- Depth of Field
- Volume temporal reprojection history state is shared
across all 6 subviews instead of per-view, so it's disabled
for now. Per-view history would be the real fix.
### Optimizations
- Per-face render resolution: scale each cubeface's resolution
to its actual angle contribution instead of a fixed size.
- Clip each subview's projection matrix to its actual visible FOV
instead of always rendering the full 90°. Needs care to clip to
exact pixel borders, or reprojection onto the film breaks.
- Stencil mask per subview to avoid computing weights.
(currently: pixels not owned by a face just copy their existing
value and return early).
### Known limitations
- Film sampling use nearest-texel only, not a proper filter kernel
(a 3x3 or plus-shaped 5-sample kernel would reduce
aliasing/banding)
- No antialiasing at boundaries.
- Screen-space raytracing hits subview boundaries and
creates artifacts. Possible fix: overscan parameter and make a
blend between the cubefaces.
Pull Request: https://projects.blender.org/blender/blender/pulls/159474
The test opens the Preferences window, switches through every value of
``preferences.active_section``, expands dynamic sections like Add-ons,
and yields after each change so the UI can redraw.
This lets us find UI errors in the many navigation sections of the
Preferences.
Pull Request: https://projects.blender.org/blender/blender/pulls/161693
---------
Co-authored-by: Pratik Borhade <25420+pratikpb2123@noreply.localhost>
Tests for Blender's drop handler system across the 3D Viewport, UI,
Scene, Window, and File Browser.
Does not cover OS-level drag and drop. Blender's `EVT_DROP` events are
generated internally by the window manager and cannot be produced
through `event_simulate`. As a result, these tests do not simulate the
complete physical workflow of dragging data from an external application
or the operating system into Blender.
Instead, the tests invoke the registered drop operators directly through
their `exec` or `invoke`-related paths and provide the context and drop
properties that Blender's internal drop handlers would normally supply.
This allows the tests to validate the drop-handler behavior and
resulting state changes while remaining deterministic and independent of
OS-level drag-and-drop support. Where an operator requires
cursor-position information from the actual drop event, the tests are
limited to verifying registration or poll behavior rather than
reproducing the complete interaction.
Pull Request: https://projects.blender.org/blender/blender/pulls/162949
This patch blocklists the node_integer_math, exr_to_png, and png_to_exr
tests on OpenGL Linux. They are failing due to unknown reasons and can't
be reproduced locally.
Pull Request: https://projects.blender.org/blender/blender/pulls/163321
Adds a new USD export test which guards against potential future changes
that impact how and when `AbstractHierarchyWriter` objects are written.
The test has mesh and curves(new) objects which contain no geometry for
frame ranges [1,3] and [7,9] but will contain geometry for frames [4,6].
This validates the exported geometry data is as expected for all frames.
Pull Request: https://projects.blender.org/blender/blender/pulls/163232
A new command line option `--debug-gpu-backend-no-fallback` is added
that skips the GPU backend support checks. This is primarily useful for
the GPU tests that should not fall back to another backend. This has the
useful side effect of skipping `vk_instance_create_for_platform_checks`,
which would otherwise create its own Vulkan instance. `vkCreateInstance`
can be an expensive function call depending on the used GPU driver (see
https://projects.blender.org/infrastructure/meta/issues/231).
Pull Request: https://projects.blender.org/blender/blender/pulls/163203
- Add a regression test verifying operator search respects poll() and
only exposes an operator when its poll condition is satisfied.
- Add a poll sweep test that checks registered operators across
supported editor types and verifies poll() always returns a `bool`
without raising exceptions.
- Add a `poll_sweep()` helper that reuses a single area while switching
editor types and runs each operator's `poll()` under the
appropriate window, area, and region context.
Pull Request: https://projects.blender.org/blender/blender/pulls/162764
If points or curves only had their widths or velocities animated we
would fail at detecting the need to automatically a cache modifier.
This is because the default `has_animations` function, which is used
for these types, checks whether the schema is constant but in those the
default checks done by Alembic only include a subset of the properties
held by the schema.
This adds overloads to `has_animations` for curves and points to also
verify if the widths or velocities attributes are animated. For curves,
we could also include checks for other attributes (like the curve
orders) but I'd rather see such animations in actual files, so this is
left for later.
Pull Request: https://projects.blender.org/blender/blender/pulls/162676
Dispersion is defined by two parameters:
Abbe Number and Dispersion Scale.
This corresponds to OpenPBR v1.1.1
Pull Request: https://projects.blender.org/blender/blender/pulls/162041
Note: dispersion is temporarily disabled when using MNEE (shadow caustics) on oneAPI, due to a compiler bug. Waiting for a fix from the oneAPI side.

Co-authored-by: Sebastian Herholz <sebastian.herholz@gmail.com>
This adds improved support for string sockets in shader nodes.
Before, strings were in a bit of a weird state: two nodes (Principled Volume and
Raycast) have string inputs but string sockets were not even allowed based on
`shader_node_tree_socket_type_valid`. I wanted to try to add string sockets
there in #118984 but it didn't really work well back then.
Now, with the shader nodes inlining, we can more easily support string sockets
because their evaluation is entirely handled at the inliner level. The final
strings just end up in the string inputs of the two mentioned nodes (and maybe
more in the future).
Improved string socket support also helps with the expression node (#149091)
since expressions are strings too.
This patch also makes various string nodes from Geometry Nodes and the
Compositor available in shader nodes to: Find in String, Format String, Special
Characters, Input String, Match String, Replace String, Reverse String, Set
String Case, Slice String, String Length, String to value, Trim String, Value to
String. This is basically the same set as was added in #155864 to the compositor
+ nodes that were added since then.
There are not that many use-cases for strings in shader nodes yet, but the
unification is nice and will probably become more useful over time.
The most difficult challenge here was dealing with
`should_preserve_repeat_zone_node`. The old logic just based on the socket types
was not enough anymore when there are nodes which only the inliner can evaluate
but not the renderers. The tricky thing is that it seems hard to impossible to
100% accurately detect whether a repeat zone can be preserved without trying
(especially when nested bundles/closures are passed into the repeat zone to be
expanded inside of it). The best solution I came up with so far is attempting to
preserve the repeat zone first and then having the option to backtrack that
decision and to end up inlining it when preserving it failed.
Pull Request: https://projects.blender.org/blender/blender/pulls/162643
Editor initialization by dynamically constructing a grid layout,
iterating through all settable editor variants, applying editor-specific
modes/subtypes, and validating successful initialization of each editor
instance.
These tests already proved themselves useful, we already found and fixed
a number of issues during development.
Pull Request: https://projects.blender.org/blender/blender/pulls/158780
This adds an `ABCPointCloudWriter` to export PointCloud objects to
Alembic. Only actual PointCloud objects (`OB_POINTCLOUD`) are exported
at the moment: those created by geometry nodes on other object types are
not supported.
Arbitrary attributes other that "id", "radius", and "velocity", are not
exported; support for this will be added later.
For converting positions and velocities to Alembic, routines from the
Mesh writer were reused, generalized, and moved to `abc_customdata.cc`.
Pull Request: https://projects.blender.org/blender/blender/pulls/162623
The compute-shader based function `update_mipmaps` can generate broken
mipmaps for Intel Arc Windows OpenGL. A workaround for falling back to
`generate_mipmap` is added to mitigate the issue. Furthermore, a render
test is added that catches the issue.
Pull Request: https://projects.blender.org/blender/blender/pulls/162524