You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +00:00
Remove REST transform influence in skeleton bones
* Animations and Skeletons are now pose-only. * Rest transform is kept as reference (when it exists) and for IK * Improves 3D model compatibility (non uniform transforms will properly work, as well as all animations coming from Autodesk products).
This commit is contained in:
@@ -104,6 +104,13 @@ void FBXSkeleton::init_skeleton(const ImportState &state) {
|
||||
print_verbose("working on bone: " + itos(bone_index) + " bone name:" + bone->bone_name);
|
||||
|
||||
skeleton->set_bone_rest(bone->godot_bone_id, get_unscaled_transform(bone->node->pivot_transform->LocalTransform, state.scale));
|
||||
{
|
||||
Transform3D base_xform = bone->node->pivot_transform->LocalTransform;
|
||||
|
||||
skeleton->set_bone_pose_position(bone_index, base_xform.origin);
|
||||
skeleton->set_bone_pose_rotation(bone_index, base_xform.basis.get_rotation_quaternion());
|
||||
skeleton->set_bone_pose_scale(bone_index, base_xform.basis.get_scale());
|
||||
}
|
||||
|
||||
// lookup parent ID
|
||||
if (bone->valid_parent && state.fbx_bone_map.has(bone->parent_bone_id)) {
|
||||
|
||||
Reference in New Issue
Block a user