Closed Darkinggq closed 2 years ago
test model took from youtube tutorial https://www.youtube.com/watch?v=mdyRO8_q7lI
This is an issue with the mesh it self
The mesh transformations were not applied before exporting 👌
However, it's true that GLTF importer in godot has an issue with identifying bones orientation when creating physical bones
I can create a fixed version of this.
Using the gltf2 on 3.2 and the blender option set to "fortune".
this i made the result useless nothing has changed physical bones
I'm not able to dig deeply into [to] find the cause today. However, I can post the scene for my variation if it can help.
I can confirm it fails for rc2.
Are you able to retest on latest stable?
Still reproducible in Godot 3.2.4 beta 4
From what I understand, this issue could be from 2 different causes: error from the Create physical skeleton code, or error from the GLTF (parsing, or export from Blender). Given that GLTF seems to work well for animation, I have looked at the first cause.
In skeleton_editor_plugin.cpp, the code is assuming the bone direction is pointing to -Z, hence the physical bone body offset to put it in the middle:
body_transform.origin = Vector3(0, 0, -half_height);
But, when using GLTF model, it could point to completely another direction By setting the body offset using the bone rest vector instead, it partially fixes the issue:
Vector3 bone_rest_origin = skeleton->get_bone_rest(bone_child_id).origin;
body_transform.origin = bone_rest_origin * 0.5;
However, the physical bone rotation is not set along the bone, and for this, I had to use:
body_transform = body_transform.looking_at(Vector3(0, 0, 0), Vector3(0, 0, 1));
It is my first look at Godot's code so I don't know if it is the proper way to do the rotation...
It was not a good idea to rotate the physical bones since it creates issues with the physic engine. Instead, rotation the collision shape is much safer.
I have just created a PR for the Godot 4.0 version #48310. Please find here a reproduction project for Godot 4.0 containing 3 models, using DAE and GLTF (total 6 cases):
Just open one of the 6 scene, select the skeleton and click on Create physical skeleton.
Fixed by #48310.
Godot version: v3.2.1stable/v3.2.2rc2
OS/device including version: Debian 10.4
Issue description: Blender 2.83 export import format GLTF/DAE problem miscellaneous left or right
already tried godot 3.2.1stable and 3.2.2rc2 anyway it's useless who hasn't fixed physical bones
blender 2.83 the original modeling + skeletons
Minimal reproduction project: _cloth_phys.blend.zip only blender 2.83