Community
FBX Forum
Welcome to Autodesk’s FBX Forums. Share your knowledge, ask questions, and explore popular FBX topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problems with Shader parameters import. API bug?

1 REPLY 1
Reply
Message 1 of 2
Anonymous
265 Views, 1 Reply

Problems with Shader parameters import. API bug?

Hi, I am an XNA developer, my primary experience with FBX has been via Microsoft's FBX Importer that they provide with the XNA framework. I have noticed that Microsoft's XNA importer does not like to read files that are written out with an FBX exporter that has been built with an SDK version newer than version 2012 (their importer was built with version 2011) this happens even if the file was written out with backwards compatibility to 2011.

In an effort to try to fix this, I have re-authored an importer similar to Microsoft's based on the 2013 SDK. I was hoping the updated SDK would solve this problem.

In doing so, I believe I have discovered the reason for this problem, and believe it may be an oversight in the SDK itself.

Here is a code snippet from the FBX SDK from ImportScene/DisplayMaterial.cxx, my code is essentially the same. The code is attempting to hook up shader parameters

const char* lEntrySrcType = lEntry.GetEntryType(true); 
if ( strcmp( FbxPropertyEntryView::sEntryType, lEntrySrcType ) == 0 )
{


In this code FbxPropertyEntryView::sEntryType is "FbxPropertyEntry", as defined in the SDK.

The problem is that for a file written out with the version 2012 exporter or below. lEntrySrcType ends up being "KFbxPropertyEntry". The values are unequal and the statement fails (silently)

This would correspond to the API change that occurred which dropped the "K" from all the class names. However this old class name seems to be embedded in the old files and the importer isn't smart enough to correct it.

This would also explain why a 2011 importer could not read a file that was written out with the 2013 SDK. Because the values would be reversed but still unequal. This is problematic because it essentially breaks backwards and forwards compatibility.

Is there a work around or a better way to check this state, aside from hard coding a new string there?

Thank You
1 REPLY 1
Message 2 of 2
rejhotom
in reply to: Anonymous

Same issue when trying to convert our internal models to FBX with use of HLSL shaders via FBX SDK 2012.2. Very annoying.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report