New issue 150 by ard...@gmail.com: OSchemaObjects don't support the
wrap-existing constructor
http://code.google.com/p/alembic/issues/detail?id=150
This makes me a sad panda.
This is going to be slightly less trivial than I thought. I think I've
made the required change to Abc::OSchemaObject
(http://code.google.com/r/ardent-embic/source/detail?r=311848ccff39787dd276179c9031a618366008fa),
but all the types in AbcGeom will need WrapExisting constructors that call
a "reinit()" method that checks each of their child Properties for
existence, and if they exist, calls those Properties' wrap-existing
constructors.
Not impossible, just not super straightforward.
Comment #2 on issue 150 by ble...@gmail.com: OSchemaObjects don't support
the wrap-existing constructor
http://code.google.com/p/alembic/issues/detail?id=150
(No comment was entered for this change.)
Comment #3 on issue 150 by scottmmo...@gmail.com: OSchemaObjects don't
support the wrap-existing constructor
http://code.google.com/p/alembic/issues/detail?id=150
Per today's call, noted this as a P2 (so a nice to have) for Milestone 1
(aka 1.0 release).
Comment #4 on issue 150 by scottmmo...@gmail.com: OSchemaObjects don't
support the wrap-existing constructor
http://code.google.com/p/alembic/issues/detail?id=150
After speaking with Shandra and Joe today, the current thought is to pass
on this for Milestone 1. I'll verify with Sony here momentarily.
If this issue isn't going to be resolved, I need a suggestion for an
alternative workflow. Specifically, what I'm trying to do is:
- take a model in a custom format
- generate an Alembic representation
- take an animated vert cache
- apply the animation to the Alembic representation
But I don't want to have to worry about what type of geometry it is (in the
last step). I am confident the schema will expose a P attribute, regardless
whether it's a Poly, Subd, Nurbs, etc.
If I look at the Maya exporter, it looks like there are specialized cases
for each type of schema object.
Does that make sense?
Or, worst-case, if I do need to worry about the schema type, I still want
to store the object in a generic way. For example:
genericAlembicClass obj = convertToAlembic( myFileInAFunkyFormat );
for( i = 1, 1000 )
addAnimatedPositions( obj, myAnimatedPositions[ i ] )
end
I'm happy to worry about the different types in convertToAlembic(), and
I'll grudgingly accept (if I absolutely have to) worrying about different
types in addAnimatedPositions(), but I really do want obj to be a generic
type, independent of which geo type I'm converting.
I see how the Maya exporter handles this with a generic MayaNode class,
with inherited versions that each store specific Alembic pointers, but I'd
really like to design my library such that it returns Alembic data types,
not custom wrapper classes.
Cheers!
You want to hold onto OPolyMeshSchema, OSubDSchema, etc.
Although it might be able technically feasible to hold onto the
OArrayProperty "P" for each shape, you won't generate correct self bounds
because you aren't doing your write via the schema.
Do it the harder way, other parts of your pipeline will thank you.
I think in your example genericAlembicClass could be a
boost::variant<OSubDSchema, OPolyMeshSchema, whatever other types you care
about>
I'd really like to hold onto it as an OGenericSchema (or something
similar), not an OPolySchema.
The object seems to advertise that it's a Poly/Subd via its properties, so
I was really hoping I could "recast"/"rewrap" it as such.
I'll have a look at boost::variant.
I'm not trying to be picky. I'm just confused about the design of this
aspect of Alembic. :)
Cheers!
As part of the confusion, the following seems to fit the exposed API but
crashes at runtime.
...
Alembic::Abc::OObject archiveTop = archive.getTop();
MPCGeo mpcGeo = mpcGeoLoad( "myGeo.geo" );
Alembic::Abc::OObject obj = OObjectFromMPCGeo()( mpcGeo, archiveTop, "geo1"
);
Alembic::AbcGeom::OSubD subd( obj.getPtr(), Alembic::Abc::kWrapExisting );
// CRASH!
Comment #12 on issue 150 by ble...@gmail.com: OSchemaObjects don't support
the wrap-existing constructor
http://code.google.com/p/alembic/issues/detail?id=150
(No comment was entered for this change.)
Comment #14 on issue 150 by ble...@gmail.com: OSchemaObjects don't support
the wrap-existing constructor
http://code.google.com/p/alembic/issues/detail?id=150
(No comment was entered for this change.)