Jump to content

End of File and seek position outside of file bounds


CJO Games
 Share

Go to solution Solved by Josh,

Recommended Posts

The original fbx files are here so that you can convert them yourself - I can't send you the mats as the folder is too large and I'm not actually sure which atlas is the correct one for the model...

the only .bin file in the folder is attached - not sure if this is the correct one or not.

buffer.zip Yellow_Ladder_02.zip Yellow_Ladder_03.zip

Link to comment
Share on other sites

What you can do is open the model in the asset editor, then select the File > Save As option and save a glTF to the desktop or in another folder somewhere, then zip those files up.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I would but as soon as I get to the files that are in .gltf format in the editor (however I do it) the error boxes come up and then as of today the editor crashes to desktop.

If I use the editor to scroll the .fbx files it doesn't crash and no errors are present it is only once it reaches the .gltf files that the editor seems to have a problem.

  • Haha 1
Link to comment
Share on other sites

Oh, I bet I know what is happening...

Both these files are using "buffer.bin":

{
    "asset": {
        "generator": "FBX2glTF v0.9.7",
        "version": "2.0"
    },
    "scene": 0,
    "buffers": [
        {
            "byteLength": 32208,
            "uri": "buffer.bin"
        }
    ],

And:

{
    "asset": {
        "generator": "FBX2glTF v0.9.7",
        "version": "2.0"
    },
    "scene": 0,
    "buffers": [
        {
            "byteLength": 34608,
            "uri": "buffer.bin"
        }
    ],

Usually the bin file is named the same as the glTF, but your exporter is just saving it as "buffer.bin" for every file, overwriting the bin file used by other glTF files you export. So the editor is correctly reporting an error in the format because the data being read does not match one of the glTF files.

You can either change this setting in your glTF exporter, or save each glTF file into a separate subfolder.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Oddly enough, I was just writing to suggest this as the possible problem as I had isolated each model type within there own folders .fbx; .mdl & .gltf and the problem had gone away...

I also created a separate texture and materials folder with textures a sub folder of materials - I'm sure somebody better at code than me could explain how to do this automatically... 

thanks Josh!

Link to comment
Share on other sites

1 minute ago, Josh said:

So the Facebook FBX to glTF converter does this, right? I don't see any CLI switches to change it:

To be honest, I had no luck using that tool. I accidentally copied over my Cyclone fbx files and it just made a bunch of useless garbage. I have better luck exporting as a gltf right out of blender.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

The only immediate fix is to add the --binary switch to the command line in line 10 of FBX2glTF.lua:

    local arguments = "--binary -i \""..path.."\" -o \""..output.."\""

This will save the file as a .glb with bin and textures packed into a single file.

Reported this issue to Facebook here:
https://github.com/facebookincubator/FBX2glTF/issues/304

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Not sure if this is relevant but it would seem that Godot game engine are relying on their own build as the upstream is (according to their website) no longer maintained - link here: FBX Import (godotengine.org) perhaps there is some useful additions in their build that could be used to fashion something for Ultra?

FBX2glTF-master.zip

Link to comment
Share on other sites

  • 4 weeks later...
  • Solution

I added some code in the FBX convert script that loads the glTF file as JSON data, changes the name and location of the bin file, and resaves it. This fixes the problem and allows use of .gltf rather than .glb.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...