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

Wrong scaling in animation/armature export #828

Closed
youaresoomean opened this issue Dec 12, 2019 · 8 comments
Closed

Wrong scaling in animation/armature export #828

youaresoomean opened this issue Dec 12, 2019 · 8 comments
Labels
Animation exporter This involves or affects the export process question Further information is requested Skinning_&_Rigging

Comments

@youaresoomean
Copy link

Describe the bug
When importing a .fbx Model from Adobe's mixamo and then exporting it to GLTF, the scale of the model is wrong. In Blender 2.80 the scale was correct.

The armature has a scale factor of 0.01 apply to it when importing from .fbx. This might cause the scaling issue in 2.81.

To Reproduce
Steps to reproduce the behavior:

  1. Import [email protected] via Import > FBX in Blender 2.81 (default settings)
  2. Click on Export > GLTF (default settings, output to .gltf + bin.. but doesnt matter, also happens with .glb)
  3. View resulting .gltf -> scale is wrong

Expected behavior
Correct scale, same as in 2.80.

.blend file/ .gltf
The ybot from mixamo is in the attached zip file. It contains the .fbx downloaded from mixamo, the .blend file and the resulting .gltf.
gltf_armature_scale_issue.zip

Version

  • OS: Windows 10 (1909)
  • Blender Version 2.81
@julienduroure julienduroure added Animation duplicate This issue or pull request already exists exporter This involves or affects the export process Skinning_&_Rigging labels Dec 12, 2019
@julienduroure
Copy link
Collaborator

Hello,
This is a duplicate of #783
You can find a workaround on #783 comments before the bug/enhancement is fixed

@julienduroure
Copy link
Collaborator

(Closing, as #783 will remain open until this is fixed)

@julienduroure
Copy link
Collaborator

Was investigating this issue, and have some question:
What viewer are you using to check the scale issue ?

Because I found some weird stuff:

(tested with Blender 2.82 alpha)
Exporting ybot file and viewing in https://gltf-viewer.donmccurdy.com/ : Scale seems to be very big.

image

Exporting ybot file and viewing in https://sandbox.babylonjs.com/ : Scale seems to be OK.
image

Exporting ybot file and viewing in Godot 3.2 beta : Seems to be OK
image

Now, in ybot file, I added a cube near the character, to check scaling:

image

Viewing in https://gltf-viewer.donmccurdy.com/ :

image

Viewing in https://sandbox.babylonjs.com/ :

image

Viewing in Godot 3.2 beta :

image

So ... not sure there is some issue here in blender exporter (but maybe in viewer @donmccurdy ?)
Can you please confirm ?

@julienduroure julienduroure reopened this Jan 8, 2020
@julienduroure julienduroure added question Further information is requested and removed duplicate This issue or pull request already exists labels Jan 8, 2020
@youaresoomean
Copy link
Author

Used the built-in Windows 10 3D Viewer and our own engine to view the gltf data. Noticed the scale diff between 2.80 and 2.8x exports.

@julienduroure
Copy link
Collaborator

I added a cube in the .blend file, and exported scene, using 2.80 and 2.82 alpha.
I can't see any scale issue.
Can you please share some screenshots and corresponding glb or gltf files ?
Thanks

@donmccurdy
Copy link
Contributor

@julienduroure there is a known issue in my viewer (donmccurdy/three-gltf-viewer#147), that the skinning deformation is not taken into account for the default camera position. So if the skinning deformation applies a 100x scale (very possible if the model was converted from FBX), the camera will focus on an area 100x too small. Adding an unskinned cube at the same size fixes that issue, because the viewer will position the camera to include it.

You can get a rough sense of the "world scale" of the model by enabling the "Grid" option in my viewer's settings. Based on the grid sizing (1 unit / square), it looks like the object's scale is correct and it's just the default viewport choice that is wrong. See screenshot:

Screen Shot 2020-01-08 at 10 37 55 AM

@youaresoomean
Copy link
Author

The explaination regarding @donmccurdy 's viewer might also apply to the built-in Windows 10 3d viewer. If i place a box next to the model it looks ok. The grid also indicates camera/viewer distance is off.
I have to check our GLTF loading code to find out what scaling/transform i am missing.
The remaining question is why it changed between 2.80 <-> 2.81..or what changed?

gltf_armature_scale_issue_2.zip

@julienduroure
Copy link
Collaborator

@youaresoomean Between 2.80 and 2.81, we fixed some bugs regarding InverseBindMatrix, and how skin data are exported.
See #566 if you want some details about this discussion.

So, seems there is no bug here is exporter --> Closing this ticket

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Animation exporter This involves or affects the export process question Further information is requested Skinning_&_Rigging
Projects
None yet
Development

No branches or pull requests

3 participants