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
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
"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
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
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
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.
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
* 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
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
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
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
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
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 resolvestudio/flamenco#104423.
Pull Request: https://projects.blender.org/blender/blender/pulls/144874
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
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
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
- RNA Patterns Unknown to the Manual -- only print rna_ids that do not return a URL
- Undocumented Sections -- consider the case of types that do not have props (a lot of nodes were returning as false positives)
With the aim of removing `seqbasep` to remove the complicated logic for
repairing pointers within the `Strip` struct when loading files and undo
steps, this commit just moves access of the variable behind a function.
In the future the function will retrieve the list from a Strip pointer,
for now it just returns the existing pointer.
Overall motivation is that blend file pointer manipulation is incompatible
with the changes required for #127706.
Pull Request: https://projects.blender.org/blender/blender/pulls/144624
It's important that frozen types are immutable, add a generic
check that mathutils types can be resized and check the frozen flag.
Also correct the exception types when Vector's cant be resized,
using a ValueError instead of a TypeError as the type is correct.
Code checking for expected amount of local/linked/missing
linked/liboverrides IDs is now cleaner and more efficient.
Also add a test where the whole content of the source library is
removed, to validate that liboverrides using these linked IDs as
reference remain available as 'placeholders'.
If an item name (and ID) is provided, never successfully match only
based on the item index.
This can lead to matching to a complete different ID than the intended
one, which can be catastrophic for the integrity of the next resync.
Also, do not require sucessful match on both source and destination
data, this will always fail in case e.g. an item is removed from a
collection, and can prevent detecting required resync from that
collection then.
This commit also enables new 'harder' test in unittests, added in
previous commit, which is now expected to pass.
Pull Request: https://projects.blender.org/blender/blender/pulls/144429
Add some initial data to test proper handling of resync when there are
specific changes in the reference collection hierarchy (in particular,
when the last child of a given collection is moved somewhere else).
Also will check for correct handling of recursive liboverrides resync in
that case.
The current failing part is commented out for now, until fix is
committed.
Changing a node tree item property (such as the default value) was using a very
broad and generic "tag" function which invalidates the runtime items cache.
This also invalidates any python iterators due to the API using the runtime
cache. Changing node tree items in a loop will then crash.
It's not necessary to invalidate the runtime items cache when the actual item
pointers have not changed. Most RNA updates only change superficial properties,
or at most require a recursive node tree update due to change of identifiers or
types.
This PR introduces a simpler "tag" function to only tag for tree updates by not
rebuild the entire runtime items cache. It also renames existing functions and
docstrings to better explain what each of them does and should be used for.
The `NodeTreeInterfaceChangedFlag` is removed completely because it is only ever
used as a simple boolean indicator of "item changes" that require a cache
rebuild. It is replaced with an atomic bool like flags used for runtime caches.
Pull Request: https://projects.blender.org/blender/blender/pulls/143932
Move the existing USDZ export test from C++ to Python for better
validation. The resulting file is now run through the `usdchecker`
system and we also check the contents of the resulting archive for the
expected texture file. This helped uncover a pathing issue in the
resulting archive where the 'textures' directory was misnamed on win32;
though it was still functional.
Pull Request: https://projects.blender.org/blender/blender/pulls/144176
This test can't easily be updated because it relies on the old socket shape
design before #144119. Parts of it could be done from scratch again, but
most of this stuff is also tested by the new structure type inferencing test
in `bl_node_structure_type_inference.py`.
Pull Request: https://projects.blender.org/blender/blender/pulls/144185
Mixing dynamic data with other data always results in dynamic now. While this
wasn't true without lists, it is true now and also makes sense generally. Also
mixing lists and single values or fields results in a list now.
Pull Request: https://projects.blender.org/blender/blender/pulls/144183
The spec for .usdz permits only a small handful of file formats to be
contained in the archive, and HDR is not among those supported[1]. This
also causes validation errors with the `usdchecker` tool (will be
properly tested in a follow up change).
Ignoring the potential for a user to export a .usdz file with materials
referencing unsupported file formats, Blender itself should use only
the supported formats for its business.
[1] https://openusd.org/release/spec_usdz.html#usdz-specification
Pull Request: https://projects.blender.org/blender/blender/pulls/144101
This patch redesigns the File Output node to provide better UX and UI.
This is mainly achieved by allowing the user to create inputs by
dragging into an Extend socket and adjust existing inputs using the
familiar UI list design available in Blender. Additionally, various UI
changes were done:
- The Use Node Format option was renamed to Override Node Format for
clarity.
- Socket types are now fixed and do not change as new links are made,
allowing users to specify the exact output type and employ implicit
conversion if needed.
- The distinction between images and Multi-Layer EXR was made clearer.
- Final output paths are drawn in the UI to remove guess work.
- The Base Path was split into a Directory and a File Name.
- Panels were added to group options, include a panel for the node
format, items, and item formats.
Pull Request: https://projects.blender.org/blender/blender/pulls/141091