Hi-
I'm trying to develop an Alembic exporter (only!) in C++ that would be part of an existing commercial product that runs on Windows, OS X, and Linux. I got the library itself to compile on each platform after several days work.*
It's been a VERY frustrating process trying to now write code with Alembic, far more so than the other libraries I use. I've been rummaging through code trying to reverse engineer it, but it's just not time-effective for me. I'm ready to throw in the towel and get back to productive work, but thought I'd ask here to see if I can get somewhere. Although I think it would be nice to support Alembic, I have limited time available to do so.
So here are a few specific questions. Apologies in advance for the length.
* Time index 0 is a fixed timescale starting at 0, stepping by 1. Is that something I should use? Or should I go with a more specific timescale that enumerates specific times and can start at a specific time. What do readers expect?
* If I have a "double xf[16]", what's the simplest way to create a corresponding transformation node? I see OXformSchema, XformOp, and XformSample, but no real explanation. What if it's a constant? What if it varies with time?
* What are the applicable conventions for the node names? Ie the relationship between the name of the mesh node and the transform node? Typically I'm going to expect one of them to be the "real" name, and the other to have "Mesh" or "Transform" appended to it.
* How do I instance a mesh into a whole lot of transforms? I can recreate it a bunch of times, and it sounds like Alembic might recognize the duplication, but that gets tedious and unnecessary after a couple hundred times.
* Is there a nice simple code block to apply an RGB color to a mesh, so that readers will render it with a simple Phong or whatever shader?
* Why do I have to do a getSchema after I create an object, then add sample to the *SCHEMA*, not the object itself? That's pretty much the opposite to the normal definition of a schema as a *description* of the data.
* What's going on with the various objects during exports: do the objects contain the data in RAM, or are they small references to the data sitting on disk? (seems like the former) The example code seems to emphasize passing things around as references instead of using new, delete, and pointers---the latter permits more flexible coding of dynamic hierarchies. I don't see objects being returned from functions, which would require new/delete/pointers.
* Any way to get SimpleAbcViewer to attach to a camera in the Alembic file?
Comments are appreciated.
I've included below some whine-y thoughts and observations from my experience below. I offer them in hopes they might be used to help make Alembic easier to pick up for others. (I know the Alembic developers have limited time too.)
Thanks,
Russ
General thoughts as an Alembic newbie:
* There's way too little documentation. The doxygen-generated stuff is useless, as the code isn't commented at all.
* There's nothing to tell me what or why I should be doing anything, at most, what a few low-level things do.
* Most of the code and description that is there is concerned with API issues, not about the data going into the file. The API isn't the end product, moving data successfully from one application to another is.
* Alembic and it's documentation shouldn't rely on unstated behaviours/properties/requirements of 3dsmax and maya etc.
* The coding style seems waaaay more complicated than necessary. I have no idea why there are all these schemas and templates, and thus what is going on under the hood to help me understand how to use it. What problems are they there to solve? If none, they shouldn't be there.
* I can't help but think that the Alembic API could be rewritten to a much simpler and easier to use form. Filmbox is much simpler, for example.
* The layered design is formally nice, but the source code is spread across different directories and it's time-consuming to sort through it. Overall there are a few too many layers of hierarchy everywhere, especially ALEMBIC_VERSION_NS ---there are 3 levels of namespace where 1 would suffice).
* Some of the "example" source code is located inside a "bin" directory.
* There are multiple files with the same name in different directories, an invitation to problems. (main.cpp, IArchive.cpp, OArchive.cpp)
* There need to be small examples that do small useful tasks---create and export an small fixed mesh, a moving mesh, an animated mesh, a camera, ... Filmbox has a lot of little examples like this that are a great help. It's nice to have the code for reference maya/prman/etc importers and exporters, but insufficient because they conflate the Alembic stuff with that of the other applications, so that you have to reverse-engineer two things, not just one.
* There need to be some sample files. Since my version of the library is Ogawa-only, I have NO example files. Not one. If I was developing an importer, I would.... not.
* The technique I used to get Alembic and some other open-source libraries to compile lately is to avoid the complex error-prone build processes that are delivered, and create simple flat makefiles, one for each platform. These makefiles depend on one target ("all"), and by adjusting a few variables you can easily retarget them. (You can turn them into scripts easily also.) You wouldn't *develop* this way, but I think open-source libraries would make their users' lives much easier by *delivering* in this fashion.
* Except SimpleAbcViewer on Win. And I have dropped HFS5 support, as this export-only.