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: 

Missing texture in FBX file

8 REPLIES 8
Reply
Message 1 of 9
claustres
783 Views, 8 Replies

Missing texture in FBX file

Hello,

I wrote a FBX importer that retrieves materials based on the DisplayTexture.cxx example.
However, I cannot properly get the texture in the attached file (I also provide my code).
NOTE : I removed the vertex data from the file because it is too big, it is just given as illustration
but do not try to open it (I have the original file/texture if one needs it to test).

I am not a FBX expert but it seems that the texture is attached to the geometry and not the material
within the file. I don't know why, maybe it is a different way than usual to manage texture in FBX...
Nevertheless, if I convert the file to OBJ with the FBX converter the output is fine, i.e. the material has a map_Kd.
So I suspect my code does not cover all possible cases and I hope that someone can help me extend it.

Thanks in advance.

13841_MeagqOAEM8iIXIg1gDqN.zip

8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: claustres

Why does this file crash the ViewScene.exe viewer from the 2006 FBX SDK?

Do all FBX files written with 2009.3 SDK now crash older viewers?
If so, why?
Message 3 of 9
Anonymous
in reply to: claustres

I don't really have time to look into this, but I do know the latest SDK allows some pointers to be NULL, where previously there has always been a value. Many programs that aren't coded to check for valid pointers are crashing. Sorry I can't help more right now, but am buried in non-FBX work at the moment, and was just trying to catch up on messages during compiles 🙂
Message 4 of 9
Anonymous
in reply to: claustres

The 2006 viewer program crashes when it calls the Import() function. All pointers are valid:
gImporter->Import(*gScene);

And both the 2006 and 2009 SDKs write out FBX 6.1.0 files, so the file format version has not changed.
Message 5 of 9
claustres
in reply to: claustres

Why does this file crash the ViewScene.exe viewer from the 2006 FBX SDK?

Do all FBX files written with 2009.3 SDK now crash older viewers?
If so, why?


As I previously said take care that I removed the content of the vertex data within the file to make it smaller for posting.
Indeed, I think that my problem is related to texture connections and it should be sufficient for illustration of this.

However, I have the full original file if you'd like to test it, and I've just tested to zip it twice and it seems to be small enough now (without the texture file though), so here it is...

13873_zRY0q1cNkEuRq4hsNPEk.zip

Message 6 of 9
Anonymous
in reply to: claustres


As I previously said take care that I removed the content of the vertex data within the file to make it smaller for posting.
Indeed, I think that my problem is related to texture connections and it should be sufficient for illustration of this.


Ah, you edited the file! Well, I guess that explains it. 🙂
Message 7 of 9
eric720
in reply to: claustres

Hi Luc,

I checked your file in ImportScene sample and max importer, and there is no problem. Also, the texture is attached
to the geometry node is normal in the file. Because the SDK with process the scene after importing and "push" the
textures to cooresponding properties in material.

So the file has no problem, and I suggest u to double check your code on convertMaterialToXML.
I am not sure how you get your material, but here is the code in DisplayTexture.cxx
 
KFbxProperty lProperty;
int lNbMat = pGeometry->GetNode()->GetSrcObjectCount(KFbxSurfaceMaterial::ClassId);
for (lMaterialIndex = 0; lMaterialIndex < lNbMat; lMaterialIndex++)
{
KFbxSurfaceMaterial *lMaterial = (KFbxSurfaceMaterial *)pGeometry->GetNode()->GetSrcObject(KFbxSurfaceMaterial::ClassId, lMaterialIndex);
bool lDisplayHeader = true;
if(lMaterial){
//Diffuse Textures
lProperty = lMaterial->FindProperty(KFbxSurfaceMaterial::sDiffuse);
FindAndDisplayTextureInfoByProperty(lProperty, lDisplayHeader, lMaterialIndex);

......
}
}



Hello,

I wrote a FBX importer that retrieves materials based on the DisplayTexture.cxx example.
However, I cannot properly get the texture in the attached file &#40;I also provide my code&#41;.
NOTE : I removed the vertex data from the file because it is too big, it is just given as illustration
but do not try to open it (I have the original file/texture if one needs it to test&#41;.

I am not a FBX expert but it seems that the texture is attached to the geometry and not the material
within the file. I don't know why, maybe it is a different way than usual to manage texture in FBX...
Nevertheless, if I convert the file to OBJ with the FBX converter the output is fine, i.e. the material has a map_Kd.
So I suspect my code does not cover all possible cases and I hope that someone can help me extend it.

Thanks in advance.
Message 8 of 9
claustres
in reply to: claustres


So the file has no problem, and I suggest u to double check your code on convertMaterialToXML.
I am not sure how you get your material, but here is the code in DisplayTexture.cxx


I was retrieving the material through the layer elements, I will try to use property connections instead but what is the difference actually ?
Message 9 of 9
luc.vovan
in reply to: claustres

Actually from 2006.11 to 2009.1 we have changed how the materials and textures are connected. They are now connected to the node instead of simply the scene!

Cheers,
Luc

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

Post to forums  

Autodesk Design & Make Report