facebookincubator / FBX2glTF

A command-line tool for the conversion of 3D model assets on the FBX file format to the glTF file format.
Other
2.1k stars 331 forks source link

Is FBX does not store its texture inside it and has to rely external source on disk? or is it? #140

Open JOELwindows7 opened 6 years ago

JOELwindows7 commented 6 years ago

Let's improve #136. to get you an idea, let me show you the error I am having now:

C:\Users\ASUS\Documents\Kolmotemp\Apps>FBX2glTF-windows-x64.exe "C:\Users\ASUS\Documents\starring codes\Unity Projects\MakeselfAttempt-UnityChan-Kidnapper\Assets\UnityChan\Models\unitychan.fbx"
ERROR: Failed to create folder: ./unitychan_out/'

C:\Users\ASUS\Documents\Kolmotemp\Apps>FBX2glTF-windows-x64.exe "C:\Users\ASUS\Documents\starring codes\Unity Projects\MakeselfAttempt-UnityChan-Kidnapper\Assets\UnityChan\Models\unitychan.fbx"
Warning: could not find a local image file for texture: FO_SKIN1_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/FO_SKIN1.tga
Warning: could not find a local image file for texture: face_tex1.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/face_00.tga
Warning: could not find a local image file for texture: eyeline_tex1.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/eyeline_00.tga
Warning: could not find a local image file for texture: eye_L_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/eye_iris_L_00.tga
Warning: could not find a local image file for texture: eye_R_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/eye_iris_R_00.tga
Warning: could not find a local image file for texture: FO_CLOTH1_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/FO_CLOTH1.tga
Warning: could not find a local image file for texture: hair_01_NRM_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/hair_01_NRM.tga
Warning: could not find a local image file for texture: hair_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/hair_01.tga
Warning: could not find a local image file for texture: ENV2_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/ENV2.tga
Warning: could not find a local image file for texture: hair_01_SPEC_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/hair_01_SPEC.tga
Warning: could not find a local image file for texture: body_01_NRM_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/body_01_NRM.tga
Warning: could not find a local image file for texture: body_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/body_01.tga
Warning: could not find a local image file for texture: body_01_SPEC_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/body_01_SPEC.tga
Warning: could not find a local image file for texture: skin_tex.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/skin_01.tga
Warning: could not find a local image file for texture: cheek_tex1.
Original filename: D:/Dropbox/Maya_Projects/UnityChan/140401_UnityChanModel/sourceimages/cheek_00.tga
Wrote 207432 bytes of glTF to ./unitychan_out/unitychan.gltf.
Wrote 1117320 bytes of binary data to ./unitychan_out/buffer.bin.

C:\Users\ASUS\Documents\Kolmotemp\Apps>

Let's break it down

Ignore the first attempt that says ERROR: Failed to create folder: ./unitychan_out/'. that's because I have activated the Anti-ransomware on Windows Security on my Windows 10 ROG laptop to prevent ransomware being accessing files. I simply add this program to whitelist and it works again.

Now take a look the second attempt that says Warning: could not find a local image file for texture: FO_SKIN1_tex. and down bellow Original filename: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages/FO_SKIN1.tga. Alright. the program expect that the source file is in that directory, as it is stated by the FBX file (FBX: This texture is over there, sir.). It appears that the guy who make Unity-chan model placed the texture files like that, on his second partition of the computer, where his Dropbox sync point is.

this FBX appears to rely on external texture files!

Or is it? is it possible to pack all those texture into the FBX that he (the guy who modeled Unity-chan), should have been doing?

Idea of strategy to handle this problem

Have a second disk drive that mounts to D:/, create fake structure and put those texture files accordingly. Which in this case like: D:/Dropbox/Maya_Projects/UnityChan/140301_unitychanmodel_Celsis/sourceimages .

I also have a favor to ask.

Can you please add custom option, that to select the existing texture file?

I mean, if the source file is not available in that location, User can instead Find File to the texture for their computer. Yes. My computer, obviously is not setup like his. unity chan texture file is included in the asset package But look at this image above! the texture file is included in the unity package, Which is great!!

So user should be able to proceed without warnings, by having user to select the same file on different location.

Thank you for your attention

Your response results are valuable in this issue.

JOELwindows7 commented 6 years ago

Q&A

JOELwindows7 commented 6 years ago

Update! not a fix. I did create a fake structure of source directories. I used my external hard drive that mounts to D:/. then created scenario like this:

D:\Dropbox\Maya_Projects\UnityChan\140301_unitychanmodel_Celsis\sourceimages
//And...
D:\Dropbox\Maya_Projects\UnityChan\140401_UnityChanModel\sourceimages

followed what does the error message says that file cannot be found.

then redo the same operation, it works! lol


C:\Users\ASUS\Documents\Kolmotemp\Apps>FBX2glTF-windows-x64.exe "C:\Users\ASUS\Documents\starring codes\Unity Projects\MakeselfAttempt-UnityChan-Kidnapper\Assets\UnityChan\Models\unitychan.fbx"
Wrote 207432 bytes of glTF to ./unitychan_out/unitychan.gltf.
Wrote 1117320 bytes of binary data to ./unitychan_out/buffer.bin.

C:\Users\ASUS\Documents\Kolmotemp\Apps>

no warning! yay. However, I have no idea how would she look's like later. spoiler: it turns bad.

Do not close this first!

Because, such method above is inconvenient! User should has an option and ability to patch the target source. like I said, because every computers are different. you can see, that is Unity chan modeler guy's setup. mostly not gonna be the same as his on every other computers. also, I do not have Autodesk Maya at all. My dropbox sync system is not installed on my PC at the momment. Plus, commonly, the sync point are by default set for single partition disk, and be usually put on User data folder like $HOME or %appdata% or even root of it such as C:/Users/yourUsername e.g. I appreciate your consideration for this problem. thank you.

zellski commented 6 years ago

Hi, wow, this is a very exhaustive bit of experimentation! To be honest, I did not read all the commentary in full detail... it's been a very busy time for me. You should certainly not have to create such an elaborate setup. The tool is supposed to look for your textures, e.g. face_00.tga, locally, not in absolute paths elsewhere. I will attempt to duplicate your scenario when I can.

It is also entirely plausible that the line

ERROR: Failed to create folder: ./unitychan_out/'

explains everything else. Anyway, apologies for this partial and ineffective response, but it's been two weeks since you posted and I felt I wanted to at least acknowledge receipt of the issue.