shrekshao / gltf-avatar-threejs

A glTF-based 3d avatar system
https://shrekshao.github.io/gltf-avatar-threejs/
MIT License
262 stars 74 forks source link

can't open merged.glb #5

Open j2l opened 5 years ago

j2l commented 5 years ago

This is great idea, congrats! I can't see model though in Godot 3.1b4 and Blender 2.8beta and Windows 3D Viewer.

shrekshao commented 5 years ago

I've also tried importing into Godot before. Doesn't work. Not sure what breaks down. But seems that currently Three.js and Babylon.js has the best support. https://gltf-viewer.donmccurdy.com/

On Tue, Feb 19, 2019 at 9:06 AM PM notifications@github.com wrote:

This is great idea, congrats! I can't see model though in Godot 3.1b4 and Blender 2.8beta and Windows 3D Viewer.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shrekshao/gltf-avatar-threejs/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AEzGrFR1A5Rz1CaKpwTDBRX94sfKpFsMks5vPC8MgaJpZM4bDcOx .

j2l commented 5 years ago

Thanks @shrekshao for replying fast.

I forked it, gltf files open with a weird behavior, illustrating "watch your back" literally :) image but merged output.gltf doesn't open at all.

I don't know gltf at all, but I like inquiries. May be I'm totally wrong here, but here's what I understand: After formatting JSON of models\gltf\merged-saber-maid\output.gltf, I can see stuff in it like:

"name": "accessor_buffer_F010_Saber.001_skin_1",
            "type": "VEC4"

this name is not foundable elsewhere in the file, hence missing the index to a .bin file I guess. If glb file is complete it should be right in the tool you wrote. But actually it throws 842 errors: image

Here's an excerpt:

MESH_PRIMITIVE_TOO_FEW_TEXCOORDS | Material is incompatible with mesh primitive:  Texture binding '/materials/2/pbrMetallicRoughness/baseColorTexture'  needs 'TEXCOORD_3' attribute. | /meshes/2/primitives/0/material
-- | -- | --
MESH_PRIMITIVE_TOO_FEW_TEXCOORDS | Material is incompatible with mesh primitive:  Texture binding '/materials/3/pbrMetallicRoughness/baseColorTexture'  needs 'TEXCOORD_4' attribute. | /meshes/3/primitives/0/material
FILE_NOT_FOUND | File not found. Node Exception: TypeError: NetworkError when attempting to fetch resource. | /images/2/uri
ACCESSOR_MAX_MISMATCH | Declared maximum value for this component (0) does not match actual maximum (-0.000010251998901367188). | /accessors/1/max/2

followed by numerous ACCESSOR_MAX_MISMATCH errors.

I just discovered VSCode has a gltf extension, pretty useful: image

It's 11pm so I stop here for now. Hope it helps narrow something.

shrekshao commented 5 years ago

Thx for the detailed info! (That look over shoulder is really creepy

I will try to find a time dig into this

On Tue, Feb 19, 2019, 13:56 PM <notifications@github.com wrote:

Thanks @shrekshao https://github.com/shrekshao for replying fast.

I forked it, gltf files open with a weird behavior, illustrating "watch your back" literally :) [image: image] https://user-images.githubusercontent.com/65325/53048046-24e06280-3494-11e9-8180-deb4b455dc70.png but merged output.gltf doesn't open at all.

I don't know gltf at all, but I like inquiries. May be I'm totally wrong here, but here's what I understand: After formatting JSON of models\gltf\merged-saber-maid\output.gltf, I can see stuff in it like:

"name": "accessor_buffer_F010_Saber.001_skin_1", "type": "VEC4"

this name is not foundable elsewhere in the file, hence missing the index to a .bin file I guess. If glb file is complete it should be right in the tool you wrote. But actually it throws 842 errors: [image: image] https://user-images.githubusercontent.com/65325/53048891-1abf6380-3496-11e9-930b-48f2c8809640.png

Here's an excerpt:

MESH_PRIMITIVE_TOO_FEW_TEXCOORDS Material is incompatible with mesh primitive: Texture binding '/materials/2/pbrMetallicRoughness/baseColorTexture' needs 'TEXCOORD_3' attribute. /meshes/2/primitives/0/material
MESH_PRIMITIVE_TOO_FEW_TEXCOORDS Material is incompatible with mesh primitive: Texture binding '/materials/3/pbrMetallicRoughness/baseColorTexture' needs 'TEXCOORD_4' attribute. /meshes/3/primitives/0/material
FILE_NOT_FOUND File not found. Node Exception: TypeError: NetworkError when attempting to fetch resource. /images/2/uri
ACCESSOR_MAX_MISMATCH Declared maximum value for this component (0) does not match actual maximum (-0.000010251998901367188). /accessors/1/max/2

followed by numerous ACCESSOR_MAX_MISMATCH errors.

I just discovered VSCode has a gltf extension, pretty useful: [image: image] https://user-images.githubusercontent.com/65325/53050354-6c1d2200-3499-11e9-817d-a3900b70c559.png

It's 11pm so I stop here for now. Hope it helps narrow something.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shrekshao/gltf-avatar-threejs/issues/5#issuecomment-465327088, or mute the thread https://github.com/notifications/unsubscribe-auth/AEzGrEorzxqfdrR21Lp9jLQfjG9mLkY3ks5vPHMFgaJpZM4bDcOx .

j2l commented 5 years ago

Thank you for your time on this! I tested multiple tools to understand (Blender gltf imports with different options, http://github.khronos.org/glTF-Validator/, ... ), most just don't validate and throw all 800+ errors.

I noticed that https://blackthread.io/gltf-converter/ on a merged model says: TypeError: normal.clone is not a function May be face.normal.clone() is not executed but written as is in the .bin file?

Could you please share your process to generate skeleton and accessories? Thanks again

shrekshao commented 5 years ago

Sorry about not making any progress so far. Let me try to fight with my laziness this weekend (facepalm

j2l commented 5 years ago

Thanks. Good to see you didn't forget :)

vpenades commented 5 years ago

Hi, I've just tried to export a merged GLB, and indeed, it's an invalid format, as others said, glTF validator throws lots of errors.

Checking the file, I noticed that a skins have invalid InverseBindMatrix accessors.

So far this is what I've found:

shrekshao commented 5 years ago

Hi. Sorry about the errors. Unfortunately I haven't visited this lib for some time. I don't think I have plans to fix this recently. 😭 If you are interested in opening a pull request I'd be loved to look at it and merge.