Maniphest T71596

Fbx export writes the embedded textures paths with a .fbm extension after playing with 'pack/unpack textures into blend files'
Closed, Resolved

Assigned To
Bastien Montagne (mont29)
Authored By
Thomas Chollet (thomasch)
Nov 15 2019, 5:17 AM
Tags
  • Add-ons (Community)
  • Import/Export
Subscribers
Andrew Scott (cyberangel67)
Bastien Montagne (mont29)
Germano Cavalcante (mano-wii)
Thomas Chollet (thomasch)
Tyson Gersh (tysongersh)

Description

System Information
Operating system: unknown / irrelevant
Graphics card: unknown / irrelevant

Blender Version
Broken: 2.80
Worked: unknown / untested

Short description of error
When exporting to FBX with embedded media causes the referenced textures paths to have '.fbm' as a file extension rather than their original type ( ie : jpg or png ) in the FBX file.
This causes other applications like Unity or 3DsMax to fail importing the embedded textures.
Upon saving and reopening the blend file, the issue persits.

Exact steps for others to reproduce the error
0) open blender

  1. assign a texture to amaterial
  2. Pack texture into blend file
  3. Unpack all into files
  4. export to FBX with embedded textures
  5. Notice that the texture file name ends with .fbm in the FBX file. ( with FBX converter or just open the file in a text editor )

Revisions and Commits

rB Blender

Related Objects

Mentioned Here
rB26bd5ebd42e3: Update rest of submodules to correct commit for Blender 2.81 release

Event Timeline

Thomas Chollet (thomasch) created this task.Nov 15 2019, 5:17 AM
Germano Cavalcante (mano-wii) added a project: Import/Export.Nov 20 2019, 4:48 PM
Andrew Scott (cyberangel67) added a subscriber: Andrew Scott (cyberangel67).Nov 27 2019, 7:50 AM

Any progress on this as it is bit of a blocker for us in the Indie Games area who use Blender and import into Engines like Unity.

Germano Cavalcante (mano-wii) lowered the priority of this task from 90 to 30.EditedNov 27 2019, 1:53 PM
Germano Cavalcante (mano-wii) added a subscriber: Germano Cavalcante (mano-wii).

What do you mean by: "Using 'pack textures into blend files' then 'unpack files' seems to corrupt the blend file"?
Please describe only one bug per report.

Andrew Scott (cyberangel67) added a comment.Nov 27 2019, 2:56 PM

What he is saying, is that when you export to FBX with embedded textures, the texture in the FBX has an extension of FBM, which Unity3D will ignore.

Germano Cavalcante (mano-wii) added a comment.EditedNov 27 2019, 3:20 PM
In T71596#819501, @Andrew Scott (cyberangel67) wrote:

What he is saying, is that when you export to FBX with embedded textures, the texture in the FBX has an extension of FBM, which Unity3D will ignore.

If this is the case, I will remove that part in the description.

Germano Cavalcante (mano-wii) updated the task description.Nov 27 2019, 3:21 PM
Germano Cavalcante (mano-wii) added a subscriber: Bastien Montagne (mont29).Nov 27 2019, 3:25 PM

Not sure if this is a problem in Blender or if it is a limitation in Unity and 3DsMax.

@Bastien Montagne (mont29), what do you think?

Bastien Montagne (mont29) added a comment.Nov 27 2019, 4:02 PM

FBX exporter is generating local paths like untitled.fbm/Screenshot from 2019-11-20 19-25-02.png for embedded data, which afaik follows FBX conventions (having a subdir next to the fbx file, named after that fbx file with 'fbm extension, and put all embedded data there)... In any case, it does not change extension of the file itself.

So unless you can demonstrate that this is a broken behavior, am afraid there is nothing wrong on our side of the code here...

Andrew Scott (cyberangel67) added a comment.Nov 27 2019, 4:17 PM

I will have to let the person who created this ticket explain, as he works for Unity. But what I can tell you is what he has told me, is that in Blender 2.8 when you export an FBX, Unity will no longer recognize the texture and will not export the embedded texture. from the FBX file. Blender 2.79, seems to not have this issue or at least I can't duplicate in with Blender 2.79 and I have maintained with Unity, that every other package that can read FBX files, does not have an issue with the FBX only Unity seems to.

But Unity have point blank said that this is a Blender 2.80 issue and wont budge on it.

Bastien Montagne (mont29) added a comment.Nov 27 2019, 4:23 PM

this third party communication is never going to work, if Unity believe there is a problem with Blender FBX exporter, they are more than welcome to make a proper report with proper technical explanations. Until I get that kind of info, there is nothing I can do. Besides losing time checking on things that are working as expected afaik.

Thomas Chollet (thomasch) added a comment.Nov 27 2019, 4:30 PM

Hi everyone, the issue I'm referring to is not that the file extension itself is changed but the path written in the FBX file ends up with a .fbm extension.

What do you mean with: "Using 'pack textures into blend files' then 'unpack files' seems to corrupt the blend file"?

That seems to be the action that causes the issue, what I mean by corrupt the file is that once this action has been made, the export bug occurs even after closing and reopening the .blend file.

I attached a video to illustrate the reproduction steps, I hope that clarifies it.

Andrew Scott (cyberangel67) added a comment.Nov 27 2019, 4:33 PM
In T71596#819592, @Thomas Chollet (thomasch) wrote:

Hi everyone, the issue I'm referring to is not that the file extension itself is changed but the path written in the FBX file ends up with a .fbm extension.

What do you mean with: "Using 'pack textures into blend files' then 'unpack files' seems to corrupt the blend file"?

That seems to be the action that causes the issue, what I mean by corrupt the file is that once this action has been made, the export bug occurs even after closing and reopening the .blend file.

I attached a video to illustrate the reproduction steps, I hope that clarifies it.

Just to be clear the pack all and unpack all, is not something I do either. In the video they are not what I do to export the FBX.

Andrew Scott (cyberangel67) added a comment.Nov 27 2019, 5:08 PM

And here is an image of the settings I always use when exporting an FBX into Unity and have been doing it this way for a long time. I do not, do that pack all and unpack all.

Bastien Montagne (mont29) added a comment.Nov 29 2019, 10:14 AM

Still cannot confirm that, exporting embedded image file still gives me proper full name:

["Texture", [545603934, "base_color_texture::Texture", ""], "LSS", [
    ["Type", ["TextureVideoClip"], "S", []],
    ["Version", [202], "I", []],
    ["TextureName", ["base_color_texture::Texture"], "S", []],
    ["Media", ["Screenshot from 2019-11-20 19-25-02.png::Video"], "S", []],
    ["FileName", ["/home/guest/Downloads/untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "S", []],
    ["RelativeFilename", ["untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "S", []],
    ["Properties70", [], "", [
        ["P", ["UseMaterial", "bool", "", "", 1], "SSSSI", []]]]]],
["Video", [238807933, "Screenshot from 2019-11-20 19-25-02.png::Video", "Clip"], "LSS", [
    ["Type", ["Clip"], "S", []],
    ["Properties70", [], "", [
        ["P", ["Path", "KString", "Url", "", "/home/guest/Downloads/untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "SSSSS", []]]],
    ["UseMipMap", [0], "I", []],
    ["Filename", ["/home/guest/Downloads/untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "S", []],
    ["RelativeFilename", ["untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "S", []],

Please attach here one of your problematic FBX files, but almost certain it's Unity which is acting up on the untilted.fbm/foobar.png kind of paths here...

Andrew Scott (cyberangel67) added a comment.Nov 29 2019, 10:42 AM
In T71596#820878, @Bastien Montagne (mont29) wrote:

Still cannot confirm that, exporting embedded image file still gives me proper full name:

["Texture", [545603934, "base_color_texture::Texture", ""], "LSS", [
    ["Type", ["TextureVideoClip"], "S", []],
    ["Version", [202], "I", []],
    ["TextureName", ["base_color_texture::Texture"], "S", []],
    ["Media", ["Screenshot from 2019-11-20 19-25-02.png::Video"], "S", []],
    ["FileName", ["/home/guest/Downloads/untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "S", []],
    ["RelativeFilename", ["untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "S", []],
    ["Properties70", [], "", [
        ["P", ["UseMaterial", "bool", "", "", 1], "SSSSI", []]]]]],
["Video", [238807933, "Screenshot from 2019-11-20 19-25-02.png::Video", "Clip"], "LSS", [
    ["Type", ["Clip"], "S", []],
    ["Properties70", [], "", [
        ["P", ["Path", "KString", "Url", "", "/home/guest/Downloads/untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "SSSSS", []]]],
    ["UseMipMap", [0], "I", []],
    ["Filename", ["/home/guest/Downloads/untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "S", []],
    ["RelativeFilename", ["untitled.fbm/Screenshot from 2019-11-20 19-25-02.png"], "S", []],

Please attach here one of your problematic FBX files, but almost certain it's Unity which is acting up on the untilted.fbm/foobar.png kind of paths here...

This is the file that I used to report this with Unity.

Nothing special with this model, but I certainly did not do the pack all and unpack all that the OP did.

All I did was switch to UV Editing and create an image, unwraped the cube and painted on the texture. Then saved the texture and did a standard shader node setup. I then exported this file with the settings I have in the image I posed above.

Unity says that the filename only has an Extension of FBM, as it is binary I can't confirm that.

Bastien Montagne (mont29) added a comment.Nov 29 2019, 2:33 PM

Indeed, that file has:

["Texture", [94811292, "base_color_texture::Texture", ""], "LSS", [
    ["Type", ["TextureVideoClip"], "S", []],
    ["Version", [202], "I", []],
    ["TextureName", ["base_color_texture::Texture"], "S", []],
    ["Media", ["CubeTexture.png::Video"], "S", []],
    ["FileName", ["E:\\Unity\\_pubgTest\\Assets\\CubeTest.fbm"], "S", []],
    ["RelativeFilename", ["CubeTest.fbm"], "S", []],
    ["Properties70", [], "", [
        ["P", ["UseMaterial", "bool", "", "", 1], "SSSSI", []]]]]],
["Video", [531937063, "CubeTexture.png::Video", "Clip"], "LSS", [
    ["Type", ["Clip"], "S", []],
    ["Properties70", [], "", [
        ["P", ["Path", "KString", "Url", "", "E:\\Unity\\_pubgTest\\Assets\\CubeTest.fbm"], "SSSSS", []]]],
    ["UseMipMap", [0], "I", []],
    ["Filename", ["E:\\Unity\\_pubgTest\\Assets\\CubeTest.fbm"], "S", []],
    ["RelativeFilename", ["CubeTest.fbm"], "S", []],

Can you please attach the .blend and texture files then? I still cannot reproduce that kind of broken path...

Andrew Scott (cyberangel67) added a comment.Nov 29 2019, 2:52 PM

sure

Bastien Montagne (mont29) added a comment.Nov 29 2019, 3:15 PM

Still cannot reproduce that, if I put the texture file one level up in dir hierarchy compared to the .blend file (since its relative path is //../), open your .blend, and export with copy+embed options, I still get expected results:

["Texture", [715784328, "base_color_texture::Texture", ""], "LSS", [
    ["Type", ["TextureVideoClip"], "S", []],
    ["Version", [202], "I", []],
    ["TextureName", ["base_color_texture::Texture"], "S", []],
    ["Media", ["CubeTexture.png::Video"], "S", []],
    ["FileName", ["/home/guest/Downloads/CubeTest_local.fbm/CubeTexture.png"], "S", []],
    ["RelativeFilename", ["CubeTest_local.fbm/CubeTexture.png"], "S", []],
    ["Properties70", [], "", [
        ["P", ["UseMaterial", "bool", "", "", 1], "SSSSI", []]]]]],
["Video", [362584945, "CubeTexture.png::Video", "Clip"], "LSS", [
    ["Type", ["Clip"], "S", []],
    ["Properties70", [], "", [
        ["P", ["Path", "KString", "Url", "", "/home/guest/Downloads/CubeTest_local.fbm/CubeTexture.png"], "SSSSS", []]]],
    ["UseMipMap", [0], "I", []],
    ["Filename", ["/home/guest/Downloads/CubeTest_local.fbm/CubeTexture.png"], "S", []],
    ["RelativeFilename", ["CubeTest_local.fbm/CubeTexture.png"], "S", []],
Andrew Scott (cyberangel67) added a comment.Nov 29 2019, 3:47 PM

Then how can I reliable do this for every FBX I create and only with Blender 2.80?

Andrew Scott (cyberangel67) added a comment.Nov 29 2019, 4:28 PM

Would using the mobile version of Blender (AKA the zip version) maybe behind this.

Because I can not see any difference to what I am doing with Blender 2.79, which works fine and Blender 2.80 and the only difference is Blender 2.80 is not installed and is the Zip version unpacked to a directory. And yes, Blender 2.81 does this same thing for me as well and it is also the zip version.

Andrew Scott (cyberangel67) added a comment.Nov 29 2019, 4:29 PM

and could it be a windows versus linux issue, I noticed you are not using the Windows version.

Thomas Chollet (thomasch) added a comment.Nov 29 2019, 5:33 PM

I tried again with the files attached by Andrew and reproduced the issue by following the same steps you did ( place the texture in the parent folder, open .blend and export as fbx copy+embed).
I then tried reinstalling Blender and redoing the same and reproduced it again,
Just to make sure, I deleted he files in /User/Me/AppData/Roaming/Blender Foundation/ and reinstalled Blender but it happened again :(.

I also tried again the repro steps I gave earlier with a fresh install and the same thing happens.

Here's the exported FBX.


Here's the file I used but it should be the exact same as I did not save it.

I'm using a fresh version downloaded today.
version: 2.81 (sub 16), branch: master, commit date: 2019-11-20 14:27, hash: 26bd5ebd42e3, type: Release
build date: 2019-11-20, 16:33:00
platform: Windows

I'm not sure what other info I could provide to help, let me know if there's anything I can do.

Thomas Chollet (thomasch) added a comment.Nov 29 2019, 5:42 PM

and could it be a windows versus linux issue, I noticed you are not using the Windows version.

That's a good point, I'll try to get my hands on a Linux machine and repro.

Andrew Scott (cyberangel67) added a comment.Nov 29 2019, 6:10 PM
In T71596#821233, @Thomas Chollet (thomasch) wrote:

and could it be a windows versus linux issue, I noticed you are not using the Windows version.

That's a good point, I'll try to get my hands on a Linux machine and repro.

I am just glad someone can duplicate it, other than just me.

Bastien Montagne (mont29) claimed this task.Nov 29 2019, 7:35 PM
Bastien Montagne (mont29) raised the priority of this task from 30 to 80.

That indeed looks like an OS-specific issue, will check. Thanks.

Bastien Montagne (mont29) lowered the priority of this task from 80 to 50.Dec 2 2019, 6:10 PM
Bastien Montagne (mont29) changed the task status from Unknown Status to Resolved by committing rBdf29e9c070a2: Fix T71596: Bug in io_utils api breaking only on windows..Dec 2 2019, 6:13 PM
Bastien Montagne (mont29) added a commit: rBdf29e9c070a2: Fix T71596: Bug in io_utils api breaking only on windows..
Tyson Gersh (tysongersh) added a subscriber: Tyson Gersh (tysongersh).Mar 2 2020, 7:39 AM

Definitely still an issue on my Windows 10 Pro. I've tried both in Unity and in Mixamo.

Oddly enough, this FBX file opens up in 3D viewer on my Windows just fine w texture, but other programs wont recognize the texture at all.

I also tried exporting as OBJ,MTL, and JPG, zipping, and uploading the zipped folder, but it failed as well. the model went from being darker grey to super bright white.

I'll attach the FBX, original Blend, and zipped OBJ, MTL, JPG in case it's useful