Call for Submission
NAB 2012 Best of the Best Show Reel
Submit your work today!
  • 1/3
You are here: Forum Home / Autodesk® FBX® / FBX SDK / Reading cache files
  RSS 2.0 ATOM  

Reading cache files
Rate this thread
 
35650
 
Permlink of this thread   Subscribe to this thread
avatar
  • Total Posts: 10
  • Joined: 02 September 2009 11:23 AM

hi all,
i am working on my importer and i’d like to add the cache file feature to my application.

I’ve taken a look at the viewscene example and i am using it
to write my own code.
Needless to say, i’ve got stuck at the very beginning.

In the viewscene example there is a funcion called:

void PreparePointCacheData (KFbxScene *pScene)

i’ve inserted this code in my application,
but while the view scene example runs smootly,
my application keeps crashing inside this function:

if(!lCache->ConvertFromMCToPC2(KTime::GetFrameRate(pScene->GetGlobalTimeSettings().GetTimeMode())0))
{
   
// Conversion failed, retrieve the error here
   
KString lTheErrorIs lCache->GetError().GetLastErrorString()
}

the crash is inside the fbxsdk library so i cant’t track it down, but it occurs in the
ConvertFromMCToPC2 function. In particular the last instruction that my debugger catches is an
assign in the xstring file to a pointer which value is 0xcdcdcdcd

My best guess is that i am missing to initialize something, but despite my endeavours,
i can’t understand what. Has anyone seen this same problem?

thanks
enrico



Replies: 0
avatar

Hi, Enrico,
Could you post more details about what did you do in your own application before you call PreparePointCacheData (KFbxScene *pScene), and it would be great to attach your test file and the call stack here too.



Jiayang Xu
Maya Data Platform
Autodesk

Replies: 0
avatar

hi Jiayang Xu,
thanks for the reply, but i’ve found the problem… When I’ve set the project libraries in my debug project, I’ve specified fbxsdk_md2005.lib instead of fbxsdk_md2005d.lib. Apparently that caused some memory mismatch and then the crash.

I’ve got a couple more questions, if i may :)
The first one is just a small detail. While i was looking for this error, I couldn’t help to notice a small difference between documentation and the tutorials shipped with the sdk.
In the docs it is stated that in the preprocessor definitions these flags must be present:

K_PLUGIN
K_FBXSDK
K_NODLL

but in the tutorials are defined these instead:

KFBX_PLUGIN
KFBX_FBXSDK
KFBX_NODLL

Are they the same?

And then, more specific about the cache file parsing:
I am looking at the KFbxCache class, but I can’t understand how many samples are present in the file. The function

int nSamples lCache->GetSampleCount ()

appears to be PC2 specific and besides in my app just returns 0. I am using the ExportScene03 output fbx and for now all the informations i can get are those relative to the start and stop time, sampling and channel number. Is there anything like the curve used in the transformation and morpher animations?

Thanks for the time,
E.



Replies: 1
/userdata/avatar/vx3501hqr_small.jpg

Wow, thanks for bring this up, for now please follow the tutorial part, the flags in Docs are outdated. And in the next release, these pre-defines will be removed.

For the second question, GetSampleCount() is a ePC2 Format Specific Functions, please refer to the KFbxCache doc, so sure it only works for PC2 file.
To get the sample count, I think if you get start and stop time and sampling rate, then you can calculate it like this:
(stop-start)/sampling rate.

Hope this helpful.

Author: Jiayang Xu

Replied: 21 October 2009 04:27 PM  




   
  Settings Choose Theme color: