fix: use force_update_all_bone_transforms() instead of undeclared constant
NOTIFICATION_UPDATE_SKELETON is not accessible in GDScript scope. Use Skeleton3D.force_update_all_bone_transforms() which recomputes the full bone hierarchy and emits bone_pose_changed signals. Co-Authored-By: Hermes Agent <[email protected]>
This commit is contained in:
@@ -312,12 +312,12 @@ func _add_animation_to_player(ap: AnimationPlayer, anim_name: String, anim: Anim
|
|||||||
print("SkinnedPlayerModel: added '%s' (%d tracks)" % [anim_name, anim.get_track_count()])
|
print("SkinnedPlayerModel: added '%s' (%d tracks)" % [anim_name, anim.get_track_count()])
|
||||||
|
|
||||||
func _update_skin() -> void:
|
func _update_skin() -> void:
|
||||||
## Force skeleton skin update by notifying Skeleton3D that poses changed.
|
## Force skeleton skin update by recomputing all bone transforms.
|
||||||
## GLTF runtime loaded models need this because AnimationPlayer's internal
|
## GLTF runtime loaded models need this because AnimationPlayer's internal
|
||||||
## bone pose updates don't always trigger the visual pipeline's dirty flags.
|
## bone pose updates don't always trigger the visual pipeline's dirty flags.
|
||||||
## NOTIFICATION_UPDATE_SKELETON causes the Skeleton3D to recompute its
|
## force_update_all_bone_transforms() recomputes the full bone hierarchy
|
||||||
## bone transforms and notify attached MeshInstances to update vertex buffers.
|
## and emits bone_pose_changed, which causes MeshInstance to update vertex buffers.
|
||||||
skeleton.notification(NOTIFICATION_UPDATE_SKELETON)
|
skeleton.force_update_all_bone_transforms()
|
||||||
|
|
||||||
func _setup_first_person() -> void:
|
func _setup_first_person() -> void:
|
||||||
# In first person, hide the head and upper body so only arms/hands/legs show
|
# In first person, hide the head and upper body so only arms/hands/legs show
|
||||||
|
|||||||
Reference in New Issue
Block a user