This patch leverages the `AbstractHierarchyIterator` to restructure the Alembic exporter. The produced Alembic files have not changed much (details below), as the Alembic writing code has simply been moved from the old exporter to the new. How the export hierarchy is handled changed a lot, though, and also the way in which transforms are computed. As a result, T71395 is fixed.
Differences between the old and new exporter, in terms of the produced Alembic file:
- The old exporter always exported a mesh object to `{object.name}/{object.name}Shape`. Now it exports to `{object.name}/{mesh.name}` instead.
- Duplicated objects now have a unique numerical suffix.
- Transforms are always exported as inheriting, because Blender doesn't have a concept of parenting without inheriting the transform.
The `AbstractHierarchyIterator` (AHI) has changed as well, to support all the features of the Alembic exporter:
- The Alembic exporter allows different sampling rates for transforms and for shapes. This is necessary, for example, to have control over motion blur: when only using rigid objects, it's enough to export sub-frame samples of transforms. The AHI now has a concept of "export sets" where writers can be grouped into sets and used selectively.
- The Alembic exporter allows exporting a flattened hierarchy, i.e. with every object a direct child of the top node. The AHI has been adjusted to allow a subclass to exert such control over the exported hierarchy.
Also extracted axis conversion functionality from `abc_utils.{h,cc}` into `abc_axis_conversion.{h,cc}`. My longer-term goal is to remove `abc_utils.{h,cc}` completely, and move its functionality into files with more specific names.
Compared to the old Alembic exporter, Subdivision modifiers are now disabled in a cleaner, more efficient way (they are disabled when exporting with the "Apply Subdivisions" option is unchecked). Previously the exporter would move to a new frame, disable the modifier, evaluate the object, and enable the modifier again. This is now done before exporting starts, and modifiers are only restored when exporting ends.
Some issues with the old Alembic exporter that have NOT been fixed in this patch:
- Exporting NURBS patches and curves (see T49114 for example).
- Exporting flattened hierarchy in combination with dupli-objects. This seems to be broken in the old Alembic exporter as well, but hasn't been reported.
There are some changes that I plan to do after this patch is accepted. Most notably, the `AbstractHierarchyIterator` code is now still part of the USD exporter module (hence also the `USD` namespace). Since it is meant to be used by more exporters, it should be moved into a generic module, for example `io/abstract`.
The unit tests require some changes to the files in SVN (I renamed object data so that it has a different name than the object, to ensure the correct name is used in the export). As I didn't want to create a branch in SVN, I will attach these files to this diff:
{F8520389}
{F8520390}