Skip to content
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

Some areas of meshes does not move with corresponding bones when using GLTF #10549

Closed
3 of 10 tasks
skalexey opened this issue Jan 10, 2017 · 10 comments
Closed
3 of 10 tasks

Comments

@skalexey
Copy link

skalexey commented Jan 10, 2017

Description of the problem

I have a 3D model exported from Blender to Collada and then converted to GLTF using collada2gltf converter. I have already fully described the problem here:
KhronosGroup/COLLADA2GLTF#13
Please, read this at first.
As figured out this is a problem somewhere in Three.js. May be in GLTF Loader, may be in GLTF Shader or somewhere else.
The problem is that vertices of some areas on mesh are not properly bound to corresponding
bones.

Three.js version
  • r76
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
@skalexey skalexey changed the title Some areas of meshes does not move with corresponded bones when using GLTF Some areas of meshes does not move with corresponding bones when using GLTF Jan 10, 2017
@takahirox
Copy link
Collaborator

Does this problem still occur on the latest revision r84 dev?

@skalexey
Copy link
Author

skalexey commented Jan 25, 2017

Yes. The problem is still occur in revision 84dev.
gltf_three_js_84dev_bugreport.mov.zip
You can see how it works in the attached zipped .mov file. The textures are not rendered, but you can see how mesh behaves differ than in the corresponding .dae file.

@donmccurdy
Copy link
Collaborator

donmccurdy commented Jan 26, 2017

There could be more going on, but most of the problem is #10366. Several KeyframeTrack instances are failing to validate because of '.' characters in the node names. Example track name: ICE.010.position. More discussion in that bug.


EDIT:

📦 Shooter glTF.zip

If I hack a fix to that, and rename the texture (the glTF file specifies Untitled.001.png for some reason), I get this. So, better, but definitely still broken.

48781354-537f-439c-9daf-ef925500f572-19444-0003114fc6711f48

@takahirox
Copy link
Collaborator

takahirox commented Jan 26, 2017

Hm, it looks that the gun position should correspond to the guy's right hand's/back's(before he grabs it) but it doesn't... Gun't rotation looks fine maybe tho.

@takahirox
Copy link
Collaborator

takahirox commented Jan 27, 2017

Does this glTF model work on other libraries?

I doubt if the conversion from Collada to glTF has done correctly
because Armature_GUN_pose_matrix-output-array parameter in glTF looks weird...

On .dae the translation value of that parameter fluctuates in the animation
while the value won't change on .gltf
(Compare Armature_GUN_pose_matrix-output-array in .dae with animation_animation_10 in .gltf)

@skalexey
Copy link
Author

skalexey commented Jan 27, 2017

I have not tried to use another libraries, but collada2gltf team have:
KhronosGroup/COLLADA2GLTF#13
Now it looks more like in JglTF and Cesium in the related issue.
Thanks a lot to donmccurdy for the explanation of the problem. I have replaced dots by slashes in names of all bones in blender project of the model and got the result maximally close to expectations:
gltf_shooter_in_three_js_r84dev.mov.zip
Something new with ice, but the gun bone seated in right position. In .dae file everything is fine as usual.

@takahirox
Copy link
Collaborator

takahirox commented Jan 27, 2017

Well, you mean replacing dots with slashes in the original project has fixed the gun transformation issue?
I (and probably @donmccurdy) edited them directly in .gltf but the gun transformation issue wasn't fixed.

So, it means the transformation issue was caused by converter, not Three.js?

@donmccurdy
Copy link
Collaborator

Cool. I think the converter got something wrong in the texture as well, at least when I ran it.

We'll be fixing #10366 in any case, that issue keeps coming up. I worked around this by trying one (of several) fixes for that issue rather than editing the file, but finding the right fix for that is a bit harder.

@skalexey
Copy link
Author

Underscores. Sorry). Yes. It looks like the problem of the gun is caused by collada2gltf. What about texture - it is composed of two problems: firstly Blender put old texture to .dae file after exportation which is already removed from the project and secondly - collada2gltf set that old texture as a texture by default.

@donmccurdy
Copy link
Collaborator

I believe this is now fixed. Importing your COLLADA file into Blender and exporting with the glTF-Blender-Exporter, I get a correctly-animated result:

d0a1932b-29c5-4ebc-adf5-af6960327639-37566-00008676735b272d

Note that the materials may take some tuning in Blender... there are particular material settings that the exporter needs.

@mrdoob mrdoob closed this as completed Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants