If we detect an unsupported point instancing setup, do not attempt to
still export it out. Depending on the number of instances this can spew
10's of thousands of USD warning traces to the console.
Pull Request: https://projects.blender.org/blender/blender/pulls/147253
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
"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 `relative_path` operator property on USD import was never wired up
completely. As such it would always write absolute paths when creating
MeshSequenceCache modifiers or Volume object file paths.
Obey this property and create relative paths as necessary.
Pull Request: https://projects.blender.org/blender/blender/pulls/145899
- "grease pencil" -> "Grease Pencil": title case.
- "Display type" -> "Display Type": title case for property name.
- "Bezier" -> "Bézier": proper noun.
- "Mem:%dM, Peak %dM" -> "Mem:%dM, Peak: %dM": missing colon.
- "cannot save image while rendering" -> "Cannot": Sentence case.
- "Linked data cannot text-space transform" -> "Cannot create
transform on linked data": rephrase strange sentence.
- "Unsupported object type for text-space transform" -> "... for
texture space transform": unnecessary abbreviation.
- "Cannot write to asset %s: %s": remove double space.
- "Failed to set tmpact" -> "temporary action": unclear abbreviation.
- "luminance at which the midetones of the image" -> "midtones: typo.
- "Line angle where the image should be split." -> trailing full stop.
- "... instances all the children in the collection" -> "... instances
of all the children...": missing "of".
- "Curves to generated rounded corners on" -> "generate": typo.
- "Instances that converted to a point per instance" -> "Instances to
convert to points": rephrase unclear sentence.
- "Great Pencil to set the depth order of" -> "Grease Pencil": typo.
- "Description to set the smoothness of" -> "Geometry to set the
smoothness of": typo.
- "A cannot use current file as library" -> "cannot use...": typo.
Pull Request: https://projects.blender.org/blender/blender/pulls/145840
Certain packed images, like those loaded directly into memory with
`BKE_image_packfiles_from_mem`, would cause USD to process the images as
"in memory" rather than as "packed" because the API was not removing the
IMG_GEN_TILE flag.
Additionally, be sure to use the packed filepath whenever possible
rather than the name given to the Image datablock as this ensures the
correct file names are used inside the USD file and for the resulting
file on disk after export.
This also fixes 2 render tests which now match when compared to the
native renders.
Pull Request: https://projects.blender.org/blender/blender/pulls/145749
Functions for convert between the color types and ostream support are
now outside the classes.
Many files were changed to fix cases where direct includes for headers
were missing.
Pull Request: https://projects.blender.org/blender/blender/pulls/145756
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
Found while trying to import an instanced point-instancer with the
operator setting `support_scene_instancing=false`.
The point-instancer Prototype would be partially processed but not
completely since the option was disabled. This caused a discrepancy
during the final portion of import where the view layer was synced and
we attempted to query for an object that was not present.
Pull Request: https://projects.blender.org/blender/blender/pulls/144845
The semantics of checking "has_value()" (etc.) are much better than
checking for an empty span when dealing with the result of an attribute
lookup. This mainly affects the Bezier curve handle position attributes
currently. Plenty of places assume those attributes exist now. In a
couple places the code is a bit safer now, otherwise it's just a bit
more obvious.
Pull Request: https://projects.blender.org/blender/blender/pulls/144506
This follows the other CMake "modernization" commits, this time for
`bf_intern_openvdb` and the OpenVDB dependency itself.
The difference with this one is that `intern/openvdb` becomes an
"optional" dependency itself. This is because downstream consumers often
want to include this dependency rather than openvdb directly, so this
target must also be optional. Optional, in this case, means the target
always exists but may be entirely empty.
Summary
- If you are using BKE APIs to access openvdb features, then use the
`bf::blenkernel` target
- If you are only using `intern/openvdb` APIs then use the
`bf::intern::optional::openvdb` target (rare)
- For all other cases, use the `bf::dependencies::optional::openvdb`
target (rare)
context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/137071
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
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
Replaces the `FPS` macro with `scene->frames_per_second()`.
The macro has two major issues:
* It hides that it depends on a `Scene *` variable named `scene`.
* It makes debugging harder.
This is now replaced with a member function on the scene.
Pull Request: https://projects.blender.org/blender/blender/pulls/144127
For cases where we've already checked that the property is holding a
particular type, use UncheckedGet to ensure the type isn't checked a
second time. This matches all the other call sites doing similar.
Pull Request: https://projects.blender.org/blender/blender/pulls/144084
This refactors the code for world to dome light to be shared between USD and
Hydra, and makes rotations work for Hydra the same way they do in USD.
One small behavior change is that missing image files now render black,
matching Cycles and EEVEE more closely.
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/143035
Use the form "Processing something..." (gerund, sentence case,
ellipsis) for running jobs progress label, according to Blender's
Human Interface Guidelines.
Pull Request: https://projects.blender.org/blender/blender/pulls/141573
Part of https://projects.blender.org/blender/blender/pulls/141278
Blend files compatibility:
If a World exists and "Use Nodes" is disabled, we add new nodes to the
existing node tree (or create one if it doesn't) that emulates the
behavior of a world without a node tree. This ensures backward and
forward compatibility.
Python API compatibility:
- `world.use_nodes` was removed from Python API => **Breaking change**
- `world.color` is still being used by Workbench, so it stays there,
although it has no effect anymore when using Cycles or EEVEE.
Python API changes:
Creating a World using `bpy.data.worlds.new()` now creates a World with
an empty (embedded) node tree. This was necessary to enable Python
scripts to add nodes without having to create a node tree (which is
currently not possible, because World node trees are embedded).
Pull Request: https://projects.blender.org/blender/blender/pulls/142342
All supported versions of Blender are capable of handling the Unicode
prim and property names now.
It's difficult to determine how much of the USD ecosystem is using
version 24.03 or greater so there is some risk of our files (when they
make use of Unicode names) not loading correctly for other DCC
applications.
Pull Request: https://projects.blender.org/blender/blender/pulls/142747
Use `BLI_strncpy_utf8` & `BLI_snprintf_utf8` for fixed size buffers in
DNA and screen data structures such as panels, menus & operators.
This could be considered a fix as copying a UTF8 string into a smaller
buffer without proper truncation can create an invalid UTF8 sequence.
However identifying which of these users are likely to run into would
be time consuming and not especially useful.
Ever since [0], ReportList is not actually used in any DNA structs.
That makes sense, since reports are conceptually only necessary
at runtime. Move the definition of the struct to BKE_report.hh, and
fix a bunch of include errors where types were previously available
transitively. Besides adding some clarity, theoretically this change
could reduce compile times because of less header parsing.
[0]: 1bf6d8b0b9
Pull Request: https://projects.blender.org/blender/blender/pulls/138872
The call to `BKE_keyblock_convert_from_mesh` can leave the KeyBlock's
data field null if the passed in mesh has no verts.
Continue to allow the shape keys to be created, but do not attempt to
actually fill them in with data. This seems to match the old FBX
importer's behavior.
Pull Request: https://projects.blender.org/blender/blender/pulls/142995
**How to reproduce the bug:**
Load the attached Blend File OR
1. Create a new World in python: bpy.data.worlds.new("Test")
2. Switch to this new world in the UI (but do nothing else to it)
3. Import in a USD file with a DomeLight (see attached file in PR)
4. Close Blender
5. Observe assert `BLI_assert(ELEM(owner_id, nullptr, id));`
The issue was caused by a assigning a regular node tree
`World->nodetree` whereas an embedded one is expected.
Pull Request: https://projects.blender.org/blender/blender/pulls/142367
This rename creates separation between USD primvars/Blender geometry
attributes - which are not controlled with this setting - and the
concept of USD attributes+userProperties/Blender custom object
properties - that this option deals with.
Ref #134012
Pull Request: https://projects.blender.org/blender/blender/pulls/142301
The repro file in question contained invalid paths for the USD Skeleton.
This was not detected in our import code which proceeded to create bones
with empty (`""`), incorrect, names and subsequently allowed the
rest-pose setup to use non-existent bones during processing.
The primary fix here is to ensure that all incoming joint paths are both
valid and unique[1]. A secondary fix is made to the rest-pose function
to use our joint-to-bone map to ensure we are using the correct bone
names.
[1] https://openusd.org/release/api/class_usd_skel_skeleton.html#aa6bf8297f4aae6de9fbf1b784c524d30
Pull Request: https://projects.blender.org/blender/blender/pulls/142133
Due to ambiguity when decomposing the incoming skeleton joint matrix,
it's possible for the returned quaternion rotation to be "flipped" from
the perspective of prior/future frames due to the quaternion
double-cover property. This would manifest as glitchy animations and
subtly incorrect motion blur results during render.
This PR implements the traditional mitigation of comparing with the
prior frame's rotation data and negating the quat if necessary. An
alternate method to instead compare with the rest positions was
attempted but it still allowed flipped/discontinuous rotations for
spinning objects like wheels and propellers.
Pull Request: https://projects.blender.org/blender/blender/pulls/142026