Hey @fruity, how did it go with this? Did you make any progress? :)

​I came to think of another constraint or method which to do what you’re
after - in regards to random access. That is, being able to query weights
for any given vertex, without (1) reading it all into memory and (2)
physically searching for it.

There’s a file format called HDF5 <https://support.hdfgroup.org/HDF5/>
which was designed for this purpose (which has Python bindings as well).
It’s written by the scientific community, but applies well to VFX in that
they also deal with large datasets of high precision (in this case,
millions of vertices and floating point weights). To give you some
intuition for how it works, I formulated a StackOverflow question
<https://stackoverflow.com/questions/22125778/how-is-hdf5-different-from-a-folder-with-files>
about it a while back that compares it to a “filesystem in a file” that has
some good discussion around it.

In more technical terms, you can think of it as Alembic. In fact Alembic is
a “fork” of HDF5, which was later rewritten (i.e. “Ogawa
<https://github.com/alembic/alembic/tree/master/lib/Alembic/Ogawa>“) but
maintains (to my knowledge) the gist of how things are organised and
accessed internally.

At the end of the day, it means you can store the results of your weights
in one of these hdf5 files, and read it back either as you would any normal
file (i.e. entirely into memory) or random access - for example, if you’re
only interested in applying weights to a selected area of a highly dense
polygonal mesh. Or if you have multiple “channels” or “versions” of weights
within the same file (e.g. 50 gb of weights), you could pick one without
requiring all that memory to be readily available.
​

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to python_inside_maya+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAguqu27GO0xDtEXJCubvPb%3DEpQaVa1xeSS7C4kAFVDSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to