Skip to content

Commit 7fe6e37

Browse files
committed
fix gltf import root motion scale
1 parent 3b16e9a commit 7fe6e37

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

frontend/elements/io/gltfio.gd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ static func load_animation_from_file(file_path: String, bonemap: BoneMap = null,
3636

3737
# Remap the animation to the "%GeneralSkeleton" skeleton
3838
if do_remap:
39+
print("Remapping animation to %GeneralSkeleton")
3940
var to_delete: Array[int] = []
4041
for track_id in range(anim.get_track_count()):
4142
var track_path = anim.track_get_path(track_id) as String
@@ -47,12 +48,11 @@ static func load_animation_from_file(file_path: String, bonemap: BoneMap = null,
4748
anim.track_set_path(track_id, "%GeneralSkeleton:" + current_bone)
4849

4950
if anim.track_get_type(track_id) == Animation.TYPE_POSITION_3D:
50-
# Scale root transform by .01 to convert from cm to m
51-
# TODO: Make this configurable
51+
# TODO: Introduce a position scale factor
5252
if current_bone == "Hips":
5353
for key in range(anim.track_get_key_count(track_id)):
5454
var key_value = anim.track_get_key_value(track_id, key)
55-
anim.track_set_key_value(track_id, key, key_value * 0.01)
55+
anim.track_set_key_value(track_id, key, key_value)
5656
# Only allow the Hips bone to have a position track
5757
else:
5858
to_delete.append(track_id)

frontend/project.godot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ config/tags=PackedStringArray("gui")
1919
run/main_scene="res://main_editor.tscn"
2020
config/features=PackedStringArray("4.4")
2121
run/low_processor_mode=true
22-
config/icon="res://res/icons/CharacterBody3D.png"
22+
config/icon="uid://dst1l51rvpl67"
2323

2424
[autoload]
2525

0 commit comments

Comments
 (0)