-
-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Godot fails to import glTF2 file with NaN values #21668
Comments
Support for glb exists and was tested at some point, wonder why It is not working |
Your project contains only corrupt gltf + bin files exported from Blender. You can check / validate your glTF files online here: https://gltf-viewer.donmccurdy.com/ |
@capnm Incorrect, the file is exported from Maya, and can be imported in both Maya and Blender (each with its own importer) without any issues. |
Please, as I said, test your files with https://gltf-viewer.donmccurdy.com/
Test Tree.gltf :
|
Why would i test something on a three.js importer? to be honest i trust the one from Blender more (both the official Khronos one and the community one, which both import the file correctly). |
Because I has a built-in validator. Sorry, whatever you opened was not that from your zip file. |
It is, the files, as provided in the zip, open in Blender (official and
community GLTF2 importer) and Maya.
Update: I think i identified the issue, will PR later.
…On Sat, Sep 1, 2018 at 9:03 PM Martin Capitanio ***@***.***> wrote:
Because I has a built-in *validator*. Sorry, whatever you opened was not
that from your zip file.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21668 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABv0Miy6OIjGS8mXE7CFep6j3g0ucRIEks5uWtn_gaJpZM4WWSHa>
.
|
Confirmed with GLTF2 developer and specification (https://github.com/KhronosGroup/glTF/tree/master/specification/2.0) NaN is a valid value for non floating point variables, Other importers (Blender and Maya as mentioned before) check on this case and either add a 0 or a null as a replacement variable. I have been trying to find where i can catch this case in the importer, but i have a bit of trouble finding where its caused while loading the file. |
If that's true, it sounds really crazy to me. In the spec is actually stated: and the JSON spec https://json.org/ is very clear about numbers: |
Been investigating and nan/inf/etc. are clearly not valid per JSON specification. We should probably raise this to the GLTF spec. |
Additionally, even in the GLTF spec it clearly states for binary data:
|
I dont mind adding support for them in our JSON parser, but I am not sure if this would be a mistake |
Personally, I think it would be a mistake ;-) it could only give a clearer error message. package main
import (
"encoding/json"
"fmt"
)
func main() {
var glft interface{}
data := []byte(`{
"bufferView" : 5,
"componentType" : 5126,
"count" : 4500,
"max" : [
NaN,
NaN
],
"min" : [
NaN,
NaN
],
"type" : "VEC2"
}`)
if err := json.Unmarshal(data, &glft); err != nil {
fmt.Println(err)
}
} go run main.go |
The Khronos Blender import/export has been corrected to disallow |
Thanks, closing. |
Godot version: 3.0.6
OS/device including version: Ubuntu 18.04 Intel UHD 620 Mesa 18.0.5
Issue description: Godot fails to import this asset exported with glb from Maya. It does import in Blender correctly using the gltf2 importer.
Steps to reproduce: Add to project, try to open file
Minimal reproduction project: DomeAssetTest.zip
The text was updated successfully, but these errors were encountered: