Hi everyone,
I'd like to propose a way to store a scatterer object into an Alembic
archive. The idea is to be able to save/load a scatterer to and from an
alembic without baking it.
The implementation I will be describing is obviously guided by our
needs, but I'm trying to keep it as modular/generic as possible.
In Clarisse Ifx, a scatterer is a procedural object and I need to keep
it that way through the export, as much as I can : a short video being
more effective than a long speech, here are two mini tutorials on
scatterers in Clarisse:
https://www.youtube.com/watch?v=GiDXPv0lU4g
https://www.youtube.com/watch?v=fHWT1LF2NV8
My idea is to create a new Scatterer object, and to export it as well as
all the objects it can reference, meaning that in the same archive, you
need to export the scatterer object, the object providing point
positions, and all the objects we want to scatter.
The contents of the Scatterer object could be like this:
+ ".pointCloud". A ScalarProperty that holds the path of an object that
would provide point positions (mandatory) and other properties like
normals, colors, etc... (optional). This object can be Points, Mesh or SubD.
+ ".instances". An array property that would tell which objects are
instanced. This array size would match the number of instances the
scatterer creates. We could either store paths to the objects (Mesh or
SubD), or UIDs.
+ ".parameters" A compound property that would contain the values of the
parameters that are needed for the procedural stuff. Given that each
application may have its own set of attributes/parameters, my idea was
that we would not dictate how parameters have to be named, but simply
make sure that they are all in the same CompoundProperty. I prefer this
solution to using arbGeomParam or userProperties as it may help to
standardize names over time. It may sound paradoxical to not want to
lock attribute names and hope that they would converge, but I feel that
we would not be able to agree on a fixed set of parameters names, and
having them in a specific compound should ease remapping.
Typically in this compound property we would store parameters that
control the variance, decimation, etc...
+ ".matrices" (optional) An array property that contains baked matrices
for each instance that the scatterer creates. Useful for application
that cannot recreate the scatterer internally.
Storing parameters allows any application to store a scatterer in a
cache a reuse it later, while having the possibility to bake the objects
matrices allows to transfer a scatterer from one application to another.
What's your opinion about this ?