Reading Alembic Vertex Cache Data using FBX SDK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to use the FBX SDK to pull vertex cache data out of Alembic files. (This is for a commercial product; it runs on normal FBX files.) The FBX SDK offers up an FbxVertexCacheDeformer and FbxCache, but the channel data isn't right. I see vertex cache deformer Channel.Get() is "/Object01/Box01/Box01Shape[P]" instead of the expected FbxVertexCacheDeformer::ePositions constant, ie "0". FbxCache::GetChannelIndex works (returning 0), but GetChannelDataType fails, returning false. Similarly I get bad results from GetChannelSamplingRate, SampleCount, and PointCount.
My understanding is that the primary purpose of the Alembic part of the FBX SDK is to be able to read vertex cache data, so I'm pretty much expecting this to work. Is there a magic incantation required? Thanks
if (!pCache->OpenFileForRead()) // OK
{
fprintf(logf, "*** Couldn't open the alembic cache for reading.\n");
errors++;
return;
};
lChannelIndex = pCache->GetChannelIndex(pVCD->Channel.Get());
if (lChannelIndex < 0) // returns zero
{
fprintf(logf, "*** Couldn't find the right alembic channel.\n");
errors++;
return;
};
pCache->GetChannelDataType(lChannelIndex, lChnlType); // this call returns FALSE, leaving lChnlType uninitialized
if (lChnlType != FbxCache::eFloatVectorArray)
{
fprintf(logf, "*** Data isn't float vectors.\n");
errors++;
return;
};