This was never implemented. Adding support is relatively simple.
We either expose the path corresponding to the bake or the
path the bake will inherit from the modifier.
Because there are arbitrarily many metadata files and the connection
to the binary blob files is only clear at runtime when loading the bakes,
this PR just exposes the entire directory.
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/156380
Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/157175
The OpenImageIO version we use has broken CMYK to RGB conversion in
JPEG, this is a temporary workaround until we upgrade to a newer
version. Directly read the CMYK image with libjpeg.
Note that when we upgrade, we can remove the CMYK conversion code
entirely as OpenImageIO supports this natively nowadays.
---
NOTE: This is the backport for 5.1.1.
Pull Request: https://projects.blender.org/blender/blender/pulls/157146
Add two tests, one to check that sub-classing works as expected,
another for the operators callable types.
Written to validate fixes for #155928 & #155996 and ensure
there are no further regressions.
Ref !155994
This reverts commit 7375b837b0.
This commit causes issues with non-global transform orientations and
with hindsight now seems like the incorrect approach to take, given that
the original issue is specifically about non-uniform scale.
Pull Request: https://projects.blender.org/blender/blender/pulls/156055
Write intermediate file in the relevant test directory in the build
folder, rather than next to the blend file, so the OSL and SVM variants
don't interfere.
Started happening after a78585b00d re-renabled this test.
Pull Request: https://projects.blender.org/blender/blender/pulls/156700
BKE_view_layer_base_find returns null for objects from background scenes
since they have no base in the current view layer. As before, such
objects will not have holdout or indirect-only flags.
Regression from 244b154bb6.
Pull Request: https://projects.blender.org/blender/blender/pulls/155876
The fix in 2dc2e0b062 to discard flat/smooth flags if there are corner
normals didn't work well for displacement. Then the normals are fully
recomputed from displacement and for this the flat/smooth flag is
needed.
Rather than discarding the flags on conversion from Blender, do it
inside Cycles after displacement.
Pull Request: https://projects.blender.org/blender/blender/pulls/155522
Add an option to the HTTP downloader that sets a size limit (in bytes).
Any download that's larger than this will be rejected with a
`ContentLengthTooBigError` exception.
This is useful to prevent Blender from choking on the parsing of huge
JSON files, which can be served relatively cheaply via compression
techniques.
```py
from _bpy_internal.http import downloader as http_dl
downloader = http_dl.ConditionalDownloader(
metadata_provider=metadata_provider)
downloader.max_size_bytes = 100
downloader.download_to_file("https://example.com/huge.json",
Path("/tmp/huge.json"))
```
The `DownloaderOptions` dataclass has also been extended with a
`max_size_bytes` parameter, so that this can be passed to the background
downloader process as well.
Note: the HTTP downloader is not used in Blender 5.1 (it's intended
for the Remote Asset Libraries in 5.2). However, since this can be
considered a fix for a security issue (potential DOS of Blender), I
feel it's still warranted to include this in 5.1. See !154464 for this
change in context.
Pull Request: https://projects.blender.org/blender/blender/pulls/155259
In USD primvars can use ':' to namespace their primvar variables. It is
somewhat common, especially with USD files from more established DCCs,
to see primvars like `primvars:ri:attributes:user:MatteID0`.
During Import we would read this in correctly. However, Export would
sanitize the name and convert ':' to '_' unnecessarily. This PR allows
generic primvars, including UVs, to contain ':'.
Pull Request: https://projects.blender.org/blender/blender/pulls/155300
Transform tools in ```sculpt mode``` were working incorrectly when mesh
was scaled non-uniformly because transformation logic was calculating
```Translation Delta``` and ```Pivot Point``` in ```Local Space``` ,
thus causing the issue.
Fixed the issue by updating ```transform_matrices_init``` function :
- Converted start and final pivot position to **World space** before
calculating `Translation Delta` and `Pivot Matrix`.
- Multiplied the ```sculpt_matrix``` with ```object_to_world``` &
```world_to_object``` matrices respectively , ensuring correct
transformation to the **world space** and back to **local space**.
- Handle the pivot transformation in world and local space as well
Pull Request: https://projects.blender.org/blender/blender/pulls/154310
When removing a bone in edit mode, the drivers on
the pose bone stuck around. Thus when creating
a bone with the same name, the drivers would appear again.
This is now fixed by calling `BKE_animdata_drivers_remove_for_rna_struct`
when leaving edit mode.
The reason this call is not deeper in the code is because there is a
valid use case for freeing a bone without touching its animdata.
One example for that in Blender is mirroring where the bones on
one side are freed. It would be unexpected to lose drivers from mirroring.
This is also why the drivers are only removed when leaving edit mode.
That way it can be consistent between using the api and editing the
armature via the UI.
Pull Request: https://projects.blender.org/blender/blender/pulls/154571
Albedo and normal denoising features passes used several hard cutoffs
that lead to discontinuities in the passes and sometimes the denoised
render too. Use smooth transitions instead.
Specular roughness cutoff of 0.075 replaced by a smoothstep from 0.0
to 0.15. Specular and transparent 25% threshold replaced by diffuse to
specular ratio blend from 0.0 to 0.5.
Also stop using sample_weight which is meant for importance sampling
only.
Fix#150391Fix#85512Fix#78571
Pull Request: https://projects.blender.org/blender/blender/pulls/154988
To choose between:
* The smooth, undisplaced base surface normal and tangents, when you
have a displacement map and normal map that match.
* The displaced surface normal and tangents, when you want to apply a
normal map in addition to displacement.
This is Cycles only for now, to fix a regression in 5.0 regarding
adaptive subdivison. More unified handling with EEVEE is for another
time. This is an alternative solution to replace #122397.
Fix#153670
Pull Request: https://projects.blender.org/blender/blender/pulls/154031
An incorrect scaling vector was used that resulted in the positions of
the incoming and outgoing USD prims not being scaled accordingly.
There was already test coverage in place for the general code paths, but
none tested or verified the positions of the objects when scaling was
required. Added additional test coverage to prevent future regressions.
Pull Request: https://projects.blender.org/blender/blender/pulls/154780
We need to enable WITH_GPU_RENDER_TESTS_HEADED on the builder for the
Overlay tests (#154533).
However, since an early version of the tests is already on main/release
(without reference images), simply enabling the flag on the builder
would cause `+test_gpu_draw` to fail.
So the plan of action is:
1. Merge this PR into 5.1 and main (and LTS branches?).
2. Enable the `WITH_GPU_RENDER_TESTS_HEADED` flag on the builder.
(https://projects.blender.org/infrastructure/builder/pulls/23)
3. Revert this commit in #154533 and merge it only into main.
Pull Request: https://projects.blender.org/blender/blender/pulls/154885
The test explicitly requests an OSL script to be compiled, without
relying on possibly cached bytecode in a node, or an oso file on a
disk.
It is aimed to catch issues line the ones in the referenced issue
and pull-request.
The reason why the compilation error was not caught before is because
render tests were using bytecode that was cached in the node storage.
This change uses internal Cycles API to test OSL compilation. This
seems to be the easiest way to hook up to this API. The operators from
node or text editor requires a context override, which is a bit tedious
to setup.
Alternative could be to use an external OSL script, but the issue with
that is Cycles would store OSO next to the input, so we can't have a
script stored in the tests folder and it'll need to be saved in a temp
directory anyway.
The test code might be a bit too verbose, but it just follows the
typical boiler plate code from other Python tests, preparing for the
future where we might want to store input scripts outside of the
python script.
The reason why comment line compilation using oslc succeeded is because
it is not really required to pass include to the "system" `shaders`
directory: the oslc/liboslcomp has a special logic that looks for the
`share/OSL/shaders`: `oslc ~/script.osl -o ~/script.oso` works just
fine.
Ref #154476
Ref #154576
Pull Request: https://projects.blender.org/blender/blender/pulls/154623
The existing `OperatorSpecObjectMode` operator was unnecessarily
restrictive.
Prior to this change, it specifically handled setting the object to
Object mode and then calling a specific `bpy.ops.object` operator with
given parameters.
Instead of extending this to define one per-mode, and to allow calling
operators outside of the `object` module, this commit converts the class
and its usages to `OperatorSpec` where the target mode and containing
module are specified as parameters.
Pull Request: https://projects.blender.org/blender/blender/pulls/154625
Grouping a single node with hidden sockets can create links between the
group node input/output and the hidden sockets, which also hides the
new internal link.
This is a regression in #151894. Before this the make group operator
would always un-hide all sockets and un-collapse all panels of the
grouped node.
Make sure that created links in node group operators are always visible
and that panels are always uncollapsed. This is a little slower than
the previous approach of simply expanding everything, because we have
to slow-search through the panel hierarchy. But it is more consistent
behavior because we don't have to know which links the operator
creates, it just make anything visible that gets connected.
Pull Request: https://projects.blender.org/blender/blender/pulls/154264
Adds a new file for testing automask modes, specifically testing the
'Face Set' and 'Topology' modes.
This is achieved by performing a stroke on a Suzanne mesh with the face
sets initialized by loose parts (i.e. the eyes of the mesh).
Additionally, minor changes are included to the common paint test
helper to make testing easier.
Pull Request: https://projects.blender.org/blender/blender/pulls/154342
Currently, when using `sculpt.brush_stroke`, the raycast that updates
active attributes and certain properties on the `SculptSession` is not
executed, preventing certain brush features from working.
There were a few problems that prevented this from working correctly:
* When `test_start` was called, all non-`invoke` calls were considered
valid.
* We need to call `test_start` on each stroke step until we find the
actual starting point
* The wrong "mouse" event was passed to `test_start`
Additionally, this allows a handful of tests that formerly had to be
skipped to be ran as part of the sculpt brush test suite.
Pull Request: https://projects.blender.org/blender/blender/pulls/154341
A long standing confusion with the C/Python API is arguments
that are optional and documented as defaulting to "None" yet,
will fail with a type error if None is passed in.
This is confusing both for API users & developers,
as well as making the code difficult to properly type check.
The reason for this is PyArg_Parse* functions don't support
parsing arguments that can optionally be None for most types.
Resolve by adding our own argument parsing helpers.
Also rename bmesh 'example' parameter to 'source'
for verts/edges/faces.new and face_split.
To match BMesh internal naming, although this is only for documentation
purposes as it isn't a keyword argument.
Ref !154178
After refactoring to deduplicate code, the normal for the tangent frame was
no longer properly transform to object space. Revert code to how it was
before and add a more explicit function name and comment.
Pull Request: https://projects.blender.org/blender/blender/pulls/154102
The issue was that when renaming the bone, the function to fix the rna
paths on the Armature data checked for the `pose.bones` prefix (which
is on the Object data).
This is a simple fix, but to be sure this is still working
(and because we had a bunch of bugs in that area already)
I covered the case with a few unit tests.
I found another bug while writing the unit tests.
Driver targets don't get renamed.
The testing code is there, just commented out so we can quickly
get the test to fail once we start fixing the bug.
report mentioned in comment above the buggy line
#29822
Pull Request: https://projects.blender.org/blender/blender/pulls/153573
DWAA/DWAB lossy compression uses DCT-based encoding, where values near
HALF_MAX can overshoot to infinity after decompression, due to DCT ringing.
There are different ways to resolves it and it's not so clear what the ideal
solution would be and how it would be handled upstream. By default it
will already convert values > HALF_MAX to inf and it's up to the application
to clamp if they want to (like we do).
As a workaround, clamp half float values before writing with an empirically
determined value that takes into account that lower quality makes this
problem worse. The resulting files should then decompress without inf in
existing software.
Pull Request: https://projects.blender.org/blender/blender/pulls/154061
* Switch to more accurate half and float conversion supporting denormals
to match native instructions. This makes CPU and GPU match more
closely in some tests and avoids clipping some low values.
* Inf and NaN are not supported still, as we already filter these out
and there is no reason to have the overhead.
* Change avx2 kernel to require f16c. For all physical CPUs avx2 implies
f16c, and it's only for emulation and virtual machines that this would
not be the case. So it's fine to fall back to the sse4.1 kernel then.
* Assume half instructions are available with ARM NEON. There is no
defined minimum architecture, but Blender assumes the same and ARMv8.2-A
is relatively old.
* For everything else there are SIMD optimized fallbacks.
* New unit tests were added, coverting both native instructions and
fallback implementations, and half/half3/half4.
Fix#152763: Half float image low values are clipped
Pull Request: https://projects.blender.org/blender/blender/pulls/154042
To reduce memory usage, store in a 32 bit packed_normal.
This requires more processing to read the normals, which may or may not be
offset by reduced cache misses. For CPU there is SIMD to decode 3 normals at
once. Overall performance impact seems minimal.
Co-authored-by: Alex Fuller
Pull Request: https://projects.blender.org/blender/blender/pulls/153836
It can be used for saving HDR images that work in most web browsers and
image editors. Unlike HDR PNG, this can use lossy compression to make file
sizes much smaller.
The options are 8/10/12 bit and a quality percentage.
Pull Request: https://projects.blender.org/blender/blender/pulls/153540
The 5.1 Ceres / Eigen extern removal and update caused a single small
floating 0.001 floating precision difference to occur in this specific
FBX test on macOS compared to other platforms / the recorded reference
ground truth.
Temporarily disable this test for the 5.1 library update. Later, a
better solution could involve re-enabling this test and improving the
floating precision handling in the IO test data desc generation code.
This reduces the thumbnails generated by a tests run from about
5k to less than 10.
In practice, some tests can still reset this userpreference e.g. by calling
`bpy.ops.wm.read_factory_settings()`. Further tweaks are possible
should this still be an issue in the future.
See also blender/blender#153811 and infrastructure/meta#197
Co-authored-by: Bastien Montagne <bastien@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/153817
The code to compute the undisplaced flat normal was missing, it was always
assuming smooth shading. Includes minor refactor to deduplicate code.
The Metal workaround does not appear needed anymore.
Pull Request: https://projects.blender.org/blender/blender/pulls/153842