Blender Git Loki

Git Commits -> Revision e2c671e

Revision e2c671e by Kévin Dietrich (master)
May 3, 2021, 14:19 (GMT)
Alembic Procedural: refactor data reading

This splits the data reading logic from the AlembicObject class and moves it to
separate files to better enforce a separation of concern. The goal was to simplify
and improve the logic to read data from an Alembic archive.

Since the procedural loads data for the entire animation, this requires looping
over the frame range and looking up data for each frame. Previously those loops
would be duplicated over the entire code causing divergences in how we might
skip or deduplicate data across frames (if only some data change over time and
not other on the same object, e.g. vertices and triangles might not have the
same animation times), and therefore, bugs.

Now, we only use a single function with callback to loop over the geometry data
for each requested frame, and another one to loop over attributes. Given how
attributes are accessed it is a bit tricky to simplify further and only use a
ingle function, however, this is left as a further improvement as it is not
impossible.

To read the data, we now use a set of structures to hold which data to read.
Those structures might seem redundant with the Alembic schemas as they are
somewhat a copy of the schemas' structures, however they will allow us in the
long run to treat the data of one object type as the data of another object
type (e.g. to ignore subdivision, or only loading the vertices as point clouds).

For attributes, this new system allows us to read arbitrary attributes, although
with some limitations still:
* only subdivision and polygon meshes are supported due to lack of examples for
curve data;
* some data types might be missing: we support float, float2, float3, booleans,
normals, uvs, rgb, and rbga at the moment, other types can be trivially added
* some attribute scopes (or domains) are not handled, again, due to lack of example
files
* color types are always interpreted as vertex colors

Commit Details:

Full Hash: e2c671e34cd7d35477a8c2cde07e3b2af0d67a2a
Parent Commit: 3e48633
Lines Changed: +1268, -840

2 Added Paths:

/intern/cycles/render/alembic_read.cpp (+947, -0) (View)
/intern/cycles/render/alembic_read.h (+134, -0) (View)

3 Modified Paths:

/intern/cycles/render/alembic.cpp (+159, -813) (Diff)
/intern/cycles/render/alembic.h (+26, -27) (Diff)
/intern/cycles/render/CMakeLists.txt (+2, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021