Blender Git Commit Log
Git Commits -> Revision 81cd790
Revision 81cd790 by Kévin Dietrich (cycles_procedural_api) 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)
/intern/cycles/render/alembic_read.h (+143, -0) (View)