It is possible for a mesh to change topology across frames but still be
detected as not needing a topology update.
Until we can make a finer-grained check against the before and after
topology, unconditionally ensure it's updated for now.
Adds a new test that checks a few frames of changing topology that is
similar, but not the same.
Pull Request: https://projects.blender.org/blender/blender/pulls/140253
Current NURBS evaluation handles corners or sharp angles poorly. Sharp
edges appear when a knot vector value is repeated `order - 1` times.
Users can make sharp corners by creating NURBS curve with `Bezier` knot
mode or by setting `order` to 2 for legacy curves. The problem occurs
because current algorithm takes all the curve's definition interval,
divides it into equal parts and evaluates at those points, but corners
are exactly on repeated knot's. To hit those, the resolution has to be
increased higher than required for the rest of the curve.
The new algorithm divides non zero length intervals between two adjacent
knots into equal parts. This way corners are hit with a resolution of 1.
This does change the evaluated points of NURBS curves, which is why some
test results have to be updated in this commit.
Pull Request: https://projects.blender.org/blender/blender/pulls/138565
This commit implements #125759.
It removes:
* Blender does not build on big endian systems anymore.
* Support for opening blendfiles written from a big endian system is
removed.
It keeps:
* Support to generate thumbnails from big endian blendfiles.
* BE support in `extern` or `intern` libraries, including Cycles.
* Support to open big endian versions of third party file formats:
- PLY files.
- Some image files (cineon, ...).
Pull Request: https://projects.blender.org/blender/blender/pulls/140138
This commit adds 9 tests that check each of the default brush curve
strength preset options to ensure that none of them cause NaN
propagation. In total this takes approximately 0.7s to run to run.
By design, these tests are very broad and are not a replacement for
other testing, but they should help in reducing the chance of potential
regressions.
Related to #140162
Pull Request: https://projects.blender.org/blender/blender/pulls/140242
when there is no uv, we call the function `map_to_sphere()` to create
temporary uv for computing the tangent. It could happen that a triangle
has vertices with the u coordinates going across the line where u wraps
from 1 to 0. In this case, just computing the difference of the u
coordinates results in the wrong triangle area.
To fix this problem, we compute distance in toroidal (wrap around)
space.
This is safe for coordinates generated by `map_to_sphere()` function,
because it is not supposed to map the positions of a triangle to u
coordinates that span larger than 0.5.
Pull Request: https://projects.blender.org/blender/blender/pulls/139880
This commit renames the python Brush properties that end with `_tool` to
`_brush_type` (e.g. `sculpt_tool` -> `sculpt_brush_type`) to better
distinguish the property from the concept of tools in a workspace
context.
Resolves#124201
Pull Request: https://projects.blender.org/blender/blender/pulls/139909
When dissolving an edge merges faces, use an angle threshold before
dissolving vertices from the face which have become chains as reult
of the merge (connected to 2 edges).
Also fix edge-flag handling when dissolving multiple edges
from a chain into a single edge, previously flags from the
resulting edge was effectively random.
Now flags from all edges are merged.
Resolves#100184.
Ref !134017
A small number of USD files in the wild contain invalid face index data
for some of their meshes. This leads to asserts in debug builds and
crashes for users in retail builds(sometimes). There is already an
import option to Validate Meshes but it turns out that we, and most
other importers, perform validation too late. We crash before getting to
that validate option (see notes).
This PR implements a cheap detection mechanism and will auto-fix if we
detect broken data. The detection may not find all types of bad data but
it will detect what is known to fail today for duplicate vertex indices.
We immediately validate/fix before loading in the rest of the data. The
downside is that this will mean no additional data will be loaded.
Normals, edge creases, velocities, UVs, and all other attributes will be
lost because the incoming data arrays will no longer align.
It should be noted also that Alembic has also chosen this approach. It's
check is significantly weaker though and can be improved separately if
needed.
If auto-fix is triggered, it will typically appear as one trace on the
terminal.
```
WARN (io.usd): <path...>\io\usd\intern\usd_reader_mesh.cc:684
read_mesh_sample: Invalid face data detected for mesh
'/degenerate/m_degenerate'. Automatic correction will be used.
```
A more general downside of these fixes is that this applies to each
frame of animated mesh data. The mesh will be fixed, and re-fixed, on
every frame update when the frame in question contains bad data.
For well-behaved USD scenes, the penalty for this check is between 2-4%.
For broken USD scenes, it depends on how many meshes need the fixup. In
the case of the Intel 4004 Moore Lane scene, the penalty is a 2.7x
slowdown in import time (4.5 s to 12.5 s).
Pull Request: https://projects.blender.org/blender/blender/pulls/138633
In the render test suite there is an OSL folder that contains tests that
need OSL to function.
Previously due to some missed logic, the OptiX OSL test suite would not run
tests in that folder because part of the test code assumed that if you aren't
testing on a CPU, then your device doesn't support OSL.
This commit fixes this issue.
Along with this change, some logic was changed in preparation for allowing
OptiX OSL camera tests to run without OSL shading enabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/139433
Handle the `DomeLight_1` schema for import and translate to a World
material like what was already done for the original `DomeLight` schema.
The primary difference is that the new schema provides a `poleAxis`
attribute that authoring applications can use to remove ambiguity for
the orientation of the HDRI texture. Some care was made to match
`usdview` with a set of hand-crafted files. However, after matching,
some real scenes ended up displaying differently. These were corrected
but this could mean there's still issues that will need investigation
and fixing in the future.
Co-authored-by: Nig3l <nig3lpro@gmail.com>
Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/137761
For Sculpt Undo, certain operators will modify the topology count of the
mesh. These operators are handled separately from normal brush strokes,
and so having tests for an operator that uses this functionality is
beneficial in detecting regressions.
Pull Request: https://projects.blender.org/blender/blender/pulls/139249
With the release of the brush assets project in 4.3, most brush
management moved out of the current .blend file into either the
essentials library or user-created libraries.
With this change, a number of workflows became more difficult:
* Handling a large library of texture and texture properties for brushes
due to ID linkage constraints.
* Having local tweaks to a brush without bloating the the asset library
and reducing discoverability.
This commit introduces an intermediate step to assist with both of the
preceding pain points. The `brush.asset_save_as` operator is extended
to allow saving into the current blend file via the `Duplicate Asset`
context menu entry.
Additionally, these features help ease authoring brush assets in general
from the UI instead of requiring manual datablock management.
This allows brushes to be stored alongside other data inside a specific
blend file.
Related to #129655 and [1].
[1] https://blender.community/c/rightclickselect/XYMA/
Pull Request: https://projects.blender.org/blender/blender/pulls/138105
Add support for the UsdPrimvarReader_TYPE templates for both import and
export. These are used by several USD test assets and support here
represents the last major piece of the UsdPreviewSurface spec to be
implemented.
On import these become `Attribute` nodes and on export the `Attribute`
nodes will become `UsdPrimvarReader_TYPE`'s accordingly.
Import:
- `UsdPrimvarReader_float` and `UsdPrimvarReader_int` will use the `Fac`
output
- `UsdPrimvarReader_float3` and `UsdPrimvarReader_float4` will use the
`Color` output
- `UsdPrimvarReader_vector`, `UsdPrimvarReader_normal`, and
`UsdPrimvarReader_point` will use the `Vector` output
Export (only `Geometry` Attribute types are considered):
- `Fac` will use `UsdPrimvarReader_float`
- `Color` will use `UsdPrimvarReader_float3`
- `Vector` will use `UsdPrimvarReader_vector`
- `Alpha` is not considered
MaterialX note:
Hydra-native support is a bit more involved and will have to be done
separately. Hydra w/USD sync is trivial to implement but those changes
have been left out here.
Pull Request: https://projects.blender.org/blender/blender/pulls/135143
When opening Geometry Nodes regression test files I always find a bit annoying
that the `expected_object` and not the `test_object` is active. That's because
only the `test_object` contains the modifier or node tree that is being tested.
Therefore, usually my first step when opening these files is to select the
`test_object` first.
This patch changes it so that when mesh tests are updated, the `test_object` is
made active in the end before the file is saved again.
Pull Request: https://projects.blender.org/blender/blender/pulls/139088
This commit adds a toggle functionality to the `brush.asset_activate`
operator that makes it behave similarly to the `paint.brush_select`
parameter of the same name.
When the operator has this option enabled, using the operator or
pressing the relevant key will either:
* Activate the specified brush and store it if the current brush does
not match the specified brush
* Activate the previously stored brush if it exists.
This option is exposed in the keymaps and enabled by default for the
Sculpt Mask brush.
This allows, for example, users to press 'M' to switch to the mask brush
and then press 'M' again to switch back to their previously active
brush.
Partially addresses this RCS submission: [1]
[1] https://blender.community/c/rightclickselect/1VwZ/
---
### Notes
This commit does not currently clear the `AssetWeakReference` when switching paint modes.
Pull Request: https://projects.blender.org/blender/blender/pulls/138845
Switch from Standard Surface to OpenPBR as the exported MaterialX surface,
since this is the new standard more renderers are adopting and it more closely
matches the Principled BSDF implementation.
Anisotropy support is improved though still not quite the same, as formulas
are different. Nodes are generated to apply anisotropic rotation to the
tangent vector, as there is no corresponding parameter in OpenPBR.
Fixes#138164
Authored by Apple: Lee Kerley
Pull Request: https://projects.blender.org/blender/blender/pulls/138165
The available mix modes on the Action Constraint only allowed
*combining* the Action's transforms with the input transforms, but
unlike most other constraints lacked a way to completely
override/replace those transforms.
This PR adds a "Replace" mix mode to the Action Constraint, bringing it
in line with most of the other constraints already in Blender.

----
Test file: [action_constraint_replace_mode.blend](/attachments/fc3417a8-b60a-4212-9840-5b59191e9ed9)
- The small bone at the top is the action constraint target (translating it right-left triggers the action constraint).
- Both two-bone chains are set up with action constraints. The base bones of each chain additionally have a copy location constraint to the small sideways bone, placed before the action constraint in their constraint stack.
- The chain on the left has the default mix mode, which allows you to manipulate the bones on top of what the action constraint does, and allows the copy location constraint on the base bone to work.
- The bones on the right have the new "Replace" mix mode, and therefore manipulating them does not affect the final constrained transformation, and the copy location on the base bone is overridden by the action constraint.
Pull Request: https://projects.blender.org/blender/blender/pulls/138316
This patch adds support for the Factor and Percentage subtypes for
vector sockets. This is needed by the compositor, since it has some node
inputs that specify locations and sizes relative to image size, and
having factor and percentage subtypes for those improves the UX quite a
bit according to user feedback.
Pull Request: https://projects.blender.org/blender/blender/pulls/138805
When building Blender WITH_MOD_FLUID=OFF, the OpenVDB render tests
would fail as some of them make use of the WITH_MOD_FLUID features.
This commit fixes this by disabling OpenVDB render tests unless
WITH_MOD_FLUID is active.
Pull Request: https://projects.blender.org/blender/blender/pulls/138728
- FBX "root bone" should become the Armature object itself, and not
an extra bone (follow same logic as Python importer did).
- "World to armature matrix" was not correct for armatures that are
parented under some other objects with transforms.
- Parenting imported meshes under an Armature was not taking into
account that the mesh bind transform might not be the same as the
current mesh node transform (i.e. was not setting "matrix parent
inverse" to compensate like the Python importer did).
- The repro file in #137768 also exposed an issue that importing custom
vertex normals was not working correctly in the new importer, when
mesh is partially invalid (validation alters the mesh, custom normals
have to be set afterwards).
Pull Request: https://projects.blender.org/blender/blender/pulls/138736
This change moves the tests data files and publish folder of assets
repository to the main blender.git repository as LFS files.
The goal of this change is to eliminate toil of modifying tests,
cherry-picking changes to LFS branches, adding tests as part of a
PR which brings new features or fixes.
More detailed explanation and conversation can be found in the
design task.
Ref #137215
Pull Request: https://projects.blender.org/blender/blender/pulls/137219
We recently pulled in the upstream patch to address the incorrect
validation error we were experiencing. This was the only test which
previously required the validator to be disabled.
Pull Request: https://projects.blender.org/blender/blender/pulls/138289
This change adds MaterialX version information to the exported MaterialX
USD materials.
Details:
In USD 25.02, the MaterialXConfigAPI schema was introduced to allow
recording the MaterialX version used to author a material. When loading
MaterialX documents into USD, this schema is automatically applied and
the associated version attribute is created on the material.
Due to how the MaterialX export works (via copying the composed
MaterialX spec from a temporary stage), the MaterialXConfigAPI needs to
be explicitly applied to the final material being exported.
This change applies this MaterialXConfigAPI schema and copies the
version attribute from the temporary MaterialX stage to the final stage.
Authored by Apple: Dan Knowlton
Co-authored-by: Dan Knowlton <d_knowlton@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/137974
Since commit 175686f2, the behavior of OSL now matches SVM, so instead of this
separate test this is handled by the regular test and the "does OSL match SVM"
checks.
Imports in the following animated data from UsdGeomCameras:
- Focal length
- DOF distance
- DOF fstop
- Clip start, Clip end
- Tilt shift x, Tilt shift y
- Aperture sizes (with caveats)
Implementation wise, it's more complicated than I'd like due to needing
to read in both non-animated and animated data for each property. And
because I've tried to reduce the duplication of various transforms we
have to do on each value. E.g. scaling values by "tenth of scene units"
or the extraction of the USD clipping range from a GfVec2f into 2
separate properties, and 2 separate fcurves, in Blender etc. The current
approach was the best I could come up with so far.
Aperture sizes remain problematic for import, with animation data and
without, due to how Blender selects the largest sensor dimension to base
downstream calculations on and for which there's no concept in USD to
strictly dictate which dimension to use. Additionally, changing the
sensor size will impact the Tilt values as well. This means that if the
Aperture sizes are animated, we must also animate the tilt values; leads
to more fcurves being created than perhaps expected.
The `projection` attribute (perspective and orthographic) remains
unchanged (non animated only) due to differences in how USD<>Blender
interoperate with the Orthographic projection method. Note: Blender only
exports perspective cameras due to the same reason.
Pull Request: https://projects.blender.org/blender/blender/pulls/137487
The `USE_EXPERIMENTAL_TESTS` variable was not exposed as an option, so
the two tests that use the option to check whether tests should be run
had to be manually enabled by changing `tests/python/CMakeLists.txt`.
This commit renames the variable to `WITH_TESTS_EXPERIMENTAL`, defaults
the option to `OFF`, and marks it as an advanced option.
Pull Request: https://projects.blender.org/blender/blender/pulls/133831
This was introduced during EEVEE-next developement
cycle to not make the buildbot fail because of EEVEE
render tests.
These have stabilized now and we can remove this option.
Pull Request: https://projects.blender.org/blender/blender/pulls/137545
Depending on internal details of how Blender is run, attempting to load
elements from the asset library may either execute as synchronous &
blocking or asynchronously.
When executing a script in background mode, prior to this commit,
operators that are dependent on the asset system will not execute
correctly due to the loading not being complete.
Busy-waiting for this by repeatedly calling the operator over and over
again in python does not resolve. To match behavior of other operators
when called from python scripts such as the quadriflow remesh, this
commit changes the `brush.asset_activate` operator and dependent code to
force a blocking call instead of optionally using the wmJob background
abstraction system.
Related to #117399
Pull Request: https://projects.blender.org/blender/blender/pulls/134203
Previously when an action was baked, the slot name was not retained.
This causes problems when switching between actions because the slot
will not automatically be assigned.
This is now fixed by ensuring that the name of the last assigned slot
is used to create the new slot.
Pull Request: https://projects.blender.org/blender/blender/pulls/136814