Age | Commit message (Collapse) | Author |
|
|
|
Add check for the `arbGeomParams` property being valid, before attempting
to access a sub-property from it.
|
|
This adds support for importing UV sets which are defined per vertex,
instead of per face corners. Such UV sets can be generated when the
mesh is split according to UV islands, or when there is only one UV
island, in which cases only a single UV value can be stored per
vertex since vertices will never be on a seam.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D11584
|
|
|
|
Read and write generated coordinates (also known as "original
coordinates", "reference coordinates", or "orcos") from and to Alembic.
A custom geometry property named "Pref" is used for (hopefully)
interoperability with Maya and Houdini. For now it's only guaranteed for
Blender-to-Blender.
Export: writing generated coordinates is optional (on by default).
Import: generated coordinates are always read whenever the reading of
vertex data is enabled.
Manifest Task: T88081
|
|
|
|
As in the old Blender Internal baking code, this still relies on there being a
good mapping to the original vertices.
|
|
Export UV maps to Alembic on every frame. This makes the export of UV
maps consistent with mesh normals. In the case of static UV maps it may
cause a slight slowdown (since they're exported on every frame now), but
due to the deduplication performed by the Alembic library, the resulting
files will be the same size anyway.
Thanks to @CodyWinch for providing the solution to the problem, and
writing the original patch D8397.
Differential Revision: https://developer.blender.org/D8397
|
|
This removes a lot of unnecessary code that is generated by
the compiler automatically.
In very few cases, a defaulted destructor in a .cc file is
still necessary, because of forward declarations in the header.
I removed some defaulted virtual destructors, because they are not
necessary, when the parent class has a virtual destructor already.
Defaulted constructors are only necessary when there is another
constructor, but the class should still be default constructible.
Differential Revision: https://developer.blender.org/D10911
|
|
This reverts a part of rBd3960164163c910d5031a8f076c41b39e0a5503d.
It is not a `std::shared_ptr` but a `boost::shared_ptr`.
This could probably be fixed differently, but `NOLINT` is fine now.
|
|
|
|
Use newer `using` semantic for type definition.
Solves modernize-use-using Clang-Tidy warning.
|
|
|
|
Comment blocks not conforming to convention.
|
|
|
|
Remove DNA headers, using forward declarations where possible.
Also removed duplicate header, header including it's self
and unnecessary inclusion of libc system headers from BKE header.
|
|
Modernize loops by using the `for(type variable : container)` syntax.
Some loops were trivial to fix, whereas others required more attention
to avoid semantic changes. I couldn't address all old-style loops, so
this commit doesn't enable the `modernize-loop-convert` rule.
Although Clang-Tidy's auto-fixer prefers to use `auto` for the loop
variable declaration, I made as many declarations as possible explicit.
To me this increases local readability, as you don't need to fully
understand the container in order to understand the loop variable type.
No functional changes.
|
|
No functional changes.
|
|
No functional changes.
|
|
|
|
Replace `NULL` with `nullptr` in C++ code.
No functional changes.
|
|
Change `1 + current_mat++` to `++current_mat`.
No functional changes.
|
|
Refactor material assignment code such that:
- `build_mat_map()` just returns the built map (instead of relying on
modifying a map passed as parameter),
- `LISTBASE_FOREACH` is used to loop over a `ListBase` (instead of a
hand-crafted for-loop),
- just `return` when not enough material slots can be created (instead
of setting a boolean to false, then doing some useless work, then
checking the boolean),
- reorder some code for clarity, and
- rename `mat_map` to `matname_to_material` so that the semantics are
clearer.
No functional changes.
|
|
|
|
|
|
|
|
No functional change.
|
|
Corrects 34 miscellaneous misspelled words.
Differential Revision: https://developer.blender.org/D9248
Reviewed by Campbell Barton
|
|
Follow our code style guide by using C-comments for text descriptions.
|
|
Mark the `has_animated_geom_params()` function as `static`, as it's only
used in that particular compilation unit.
No functional changes.
|
|
colors
If the mesh was constant, no check was done if there were animated
vertex colors and thus creation of a MeshSequenceCache modifier was
skipped.
Thx @sybren for feedback!
Maniphest Tasks: T81330
Differential Revision: https://developer.blender.org/D9057
|
|
Add an option to disable Alembic vertex interpolation.
Bump subversion from 5 to 6.
Alembic stores mesh samples at specific time keys; when a frame in
Blender maps to a timecode between two samples, Blender will interpolate
the mesh vertex positions. This interpolation only happens when the mesh
has a constant topology, but sometimes this was not detected properly
when the vertices change order, but the number of mesh elements remains
the same. This would result in a mesh with jumbled up vertices (T71981).
With this patch, users have the ability to disable vertex interpolation.
An alternative would be to have better detection of topology changes,
but that that'll cause a considerable slowdown.
Maniphest Tasks: T71981
Differential Revision: https://developer.blender.org/D9041
|
|
Compare mesh loop count with number of loop normals before reading the
loop normals.
Houdini doesn't always write the correct loop normals to Alembic. When a
mesh is animated and then replaced by a fluid simulation, Houdini will
still write the original mesh's loop normals, but the mesh
verts/loops/polys are from the simulation. In such cases the normals
cannot be mapped to the mesh, so it's better to ignore them.
|
|
Write custom properties (aka ID properties) to Alembic, to the
`.userProperties` compound property.
Manifest Task: https://developer.blender.org/T50725
Scalar properties (so single-value/non-array properties) are written as
single-element array properties to Alembic. This is also what's done by
Houdini and Maya exporters, so it seems to be the standard way of doing
things. It also simplifies the implementation.
Two-dimensional arrays are flattened by concatenating all the numbers
into a single array. This is because ID properties have a limited type
system. This means that a 3x3 "matrix" could just as well be a list of
three 3D vectors.
Alembic has two container properties to store custom data:
- `.userProperties`, which is meant for properties that aren't
necessarily understood by other software packages, and
- `.arbGeomParams`, which can contain the same kind of data as
`.userProperties`, but can also specify that these vary per face of a
mesh. This property is mostly intended for renderers.
Most industry packages write their custom data to `.arbGeomParams`.
However, given their goals I feel that `.userProperties` is the more
appropriate one for Blender's ID Properties.
The code is a bit more involved than I would have liked. An
`ABCAbstractWriter` has a `uniqueptr` to its `CustomPropertiesExporter`,
but the `CustomPropertiesExporter` also has a pointer back to its owning
`ABCAbstractWriter`. It's the latter pointer that I'm not too happy
with, but it has a reason. Getting the aforementioned `.userProperties`
from the Alembic library will automatically create it if it doesn't
exist already. If it's not used to actually add custom properties to, it
will crash the Alembic CLI tools (and maybe others too). This is what
the pointer back to the `ABCAbstractWriter` is used for: to get the
`.userProperties` at the last moment, when it's 100% sure at least one
custom property will be written.
Differential Revision: https://developer.blender.org/D8869
Reviewed by: sergey, dbystedt
|
|
Replace nested `namespace blender { namespace io { namespace alembic {`
with `namespace blender::io::alembic {`.
No functional changes.
|
|
Add support for object data instancing. This is used when the objects
are instances, for example when duplicated by a particle system, or
instanced by the duplication system (collection-duplicating empties,
vertex/face duplis, etc.)
Since Alembic already deduplicates data, this doesn't make the resulting
Alembic files any smaller. They will be faster to write, though, when
there is a lot of instanced geometry, as the deduplication system won't
have to do any comparisons.
This instancing support is still limited, in the sense that only object
data is instanced and all transforms are still written explicitly. A
future improvement could be to support instancing entire collection
hierarchies.
Blender's Alembic importer has no understanding of these Alembic
instances yet, and will thus happily duplicate the data on import.
The USD Alembic plugin seems to have problems understanding the
instancing. There might also be other software with similar issues.
Because of this, instancing can be turned off in the exporter (it's on
by default).
|
|
Split `ABCHierarchyIterator::get_alembic_parent()` into two functions:
- For a given export path, find the Alembic object
- Ensure that that object is usable as parent object (Alembic uses a
specific 'top' object as parent to indicate "no parent").
The new function is `public` as it will be used in an upcoming feature,
and is required to be public then.
No functional changes.
|
|
Split the `ABCHierarchyIterator::create_data_writer()` function into two
functions. This is to prepare for the creation of writers not just by
object type, but also by goal, for example writers that reference other
Alembic data instead of writing their own (i.e. instancing).
No functional changes.
|
|
No functional changes
|
|
No functional changes.
|
|
Need to make sure node factories are initialized prior to the dependency
graph allocation.
The regression was initially introduced in 5b021dff4136
Thanks Brecht for testing!
|
|
Reviewers: sergey, sybren
Differential Revision: https://developer.blender.org/D8611
|
|
Reviewers: sergey
Differential Revision: https://developer.blender.org/D8613
|
|
Add a new depsgraph builder class that includes invisible objects and
use that in the Alembic exporter.
Alembic supports three options for visibility, "visible", "inherited",
and "hidden". This means that parents can be hidden and still have
visible children (contrary to USD, where invisibility is used to prune
an entire scene graph subtree). Because of this, the visibility is
stored on the transform node, as that represents the Object in Blender
and thus keeps the Alembic file as close to Blender's own structure as
possible.
Reviewed By: Sergey
Differential Revision: https://developer.blender.org/D8595
|
|
Move the object visibility check from Alembic/USD-specific code into the
`io/common` module.
No functional changes.
|
|
And make them part of the blender_test runner. The one exception is blenlib
performance tests, which we don't want to run by default. They remain in their
own executable.
Differential Revision: https://developer.blender.org/D8498
|
|
|
|
No functional changes.
|
|
|
|
In cases when the output file cannot be opened, an exception is thrown that
was not caught.
|