Blender Git Commit Log

Git Commits -> Revision 81cd790

April 20, 2021, 11:22 (GMT)
Refactor Alembic data reading

The logic to read data is now separated from the AlembicObject and moved to a
separate file to help separating concerns.

We use structures to gather which data to read from the Alembic schemas. Those
structures are a bit redundant with the actual schemas, however they allow us
to read data of one schema type as if it were of another type. For now this is
only used to treat subdivision objects as regular polygon meshes, but in the
future it could be used to treat curves or meshes as point clouds when rendering
points is supported.

This centralizes the logic to read data based on the frame range. Instead of
writing one loop for each schema type and requested attributes, we only have
two functions which abstract the logic to gather the relevant frame times and
to lookup the right sample for the time. It would be nice to go a step further
and only have a single entry point, but the differences in handling between
attributes and regular data makes this a bit tricky but not impossible. Those
loops also handle setting up the time sampling information in the cache to make
sure that we never forget to do so, as this was quite a source of bugs.

This solves a few design issues, and allows to deduplicate data across frames
for all types (thus reducing memory usage) and to read arbitrary attributes for
polygon and subdivision meshes. The code for curves attributes is already in
place, but will not work, that would have to wait until example files are made
available. For attribute types, we support bool, int, float, vectors, and colors.
If need be we could also support matrices and quaternions.

Commit Details:

Full Hash: 81cd790c1c1d7a6ce72210ce99d55dd1e96b75f9
Parent Commit: 45b5fd5
Lines Changed: +1321, -907

2 Added Paths:

/intern/cycles/render/alembic_read.cpp (+1018, -0) (View)
/intern/cycles/render/alembic_read.h (+143, -0) (View)

5 Modified Paths:

/intern/cycles/render/alembic.cpp (+149, -890) (Diff)
/intern/cycles/render/alembic.h (+6, -14) (Diff)
/intern/cycles/render/attribute.cpp (+2, -2) (Diff)
/intern/cycles/render/attribute.h (+1, -1) (Diff)
/intern/cycles/render/CMakeLists.txt (+2, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021