Skip to content

Commit

Permalink
Changes to work with SkeletonModifier3D and the root motion patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Malcolmnixon committed Apr 10, 2024
1 parent 3201fd6 commit 72e49be
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
5 changes: 3 additions & 2 deletions demo.gd
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ func _on_skeleton_spin_box_value_changed(value: float) -> void:
%"Test-Kun/Armature/Skeleton3D".motion_scale = value


func _on_world_spin_box_value_changed(value: float) -> void:
XRServer.world_scale = value
func _on_avatar_spin_box_value_changed(value: float) -> void:
$"Chan".scale = Vector3(value, value, value)
$"Kun".scale = Vector3(value, value, value)
54 changes: 30 additions & 24 deletions demo.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,15 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -0.6,

[node name="XRFaceModifier3D" type="XRFaceModifier3D" parent="Chan"]
face_tracker = &"/vmc/head"
target = NodePath("../XRBodyModifier3D/Test-Chan/Armature/Skeleton3D/Body")
target = NodePath("../Test-Chan/Armature/Skeleton3D/Body")

[node name="XRBodyModifier3D" type="XRBodyModifier3D" parent="Chan"]
body_tracker = &"/vmc/body"
target = NodePath("Test-Chan/Armature/Skeleton3D")

[node name="Test-Chan" parent="Chan/XRBodyModifier3D" instance=ExtResource("1_lkeve")]
[node name="Test-Chan" parent="Chan" instance=ExtResource("1_lkeve")]
unique_name_in_owner = true

[node name="Body" parent="Chan/XRBodyModifier3D/Test-Chan/Armature/Skeleton3D" index="0"]
[node name="Skeleton3D" parent="Chan/Test-Chan/Armature" index="0"]
root_motion_target = NodePath("../..")

[node name="Body" parent="Chan/Test-Chan/Armature/Skeleton3D" index="0"]
blend_shapes/Cheek_Puff_Left = 1.28996e-05
blend_shapes/Cheek_Puff_Right = 1.28996e-05
blend_shapes/Eye_Left_Left = 0.297788
Expand Down Expand Up @@ -119,12 +118,16 @@ blend_shapes/mouthPressRight = 0.0310566
blend_shapes/mouthStretchLeft = 0.0145674
blend_shapes/mouthStretchRight = 0.00253638

[node name="GroundRing" type="MeshInstance3D" parent="Chan/XRBodyModifier3D"]
[node name="XRBodyModifier3D" type="XRBodyModifier3D" parent="Chan/Test-Chan/Armature/Skeleton3D" index="2"]
body_tracker = &"/vmc/body"
use_root_motion = true

[node name="GroundRing" type="MeshInstance3D" parent="Chan/Test-Chan"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0)
mesh = SubResource("TorusMesh_rbtmk")
skeleton = NodePath("")

[node name="Forward" type="MeshInstance3D" parent="Chan/XRBodyModifier3D/GroundRing"]
[node name="Forward" type="MeshInstance3D" parent="Chan/Test-Chan/GroundRing"]
transform = Transform3D(1, -8.74228e-08, -8.74228e-08, 8.74228e-08, -4.37114e-08, 1, -8.74228e-08, -1, -4.37114e-08, -5.96046e-08, 0, -0.6)
mesh = SubResource("SphereMesh_t4i7x")

Expand All @@ -133,16 +136,15 @@ transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0.6, 0

[node name="XRFaceModifier3D" type="XRFaceModifier3D" parent="Kun"]
face_tracker = &"/vmc/head"
target = NodePath("../XRBodyModifier3D/Test-Kun/Armature/Skeleton3D/Body")
target = NodePath("../Test-Kun/Armature/Skeleton3D/Body")

[node name="XRBodyModifier3D" type="XRBodyModifier3D" parent="Kun"]
body_tracker = &"/vmc/body"
target = NodePath("Test-Kun/Armature/Skeleton3D")

[node name="Test-Kun" parent="Kun/XRBodyModifier3D" instance=ExtResource("2_67k0v")]
[node name="Test-Kun" parent="Kun" instance=ExtResource("2_67k0v")]
unique_name_in_owner = true

[node name="Body" parent="Kun/XRBodyModifier3D/Test-Kun/Armature/Skeleton3D" index="0"]
[node name="Skeleton3D" parent="Kun/Test-Kun/Armature" index="0"]
root_motion_target = NodePath("../..")

[node name="Body" parent="Kun/Test-Kun/Armature/Skeleton3D" index="0"]
blend_shapes/Cheek_Puff_Left = 1.28996e-05
blend_shapes/Cheek_Puff_Right = 1.28996e-05
blend_shapes/Eye_Left_Left = 0.297788
Expand Down Expand Up @@ -185,12 +187,16 @@ blend_shapes/mouthPressRight = 0.0310566
blend_shapes/mouthStretchLeft = 0.0145674
blend_shapes/mouthStretchRight = 0.00253638

[node name="GroundRing" type="MeshInstance3D" parent="Kun/XRBodyModifier3D"]
[node name="XRBodyModifier3D" type="XRBodyModifier3D" parent="Kun/Test-Kun/Armature/Skeleton3D" index="2"]
body_tracker = &"/vmc/body"
use_root_motion = true

[node name="GroundRing" type="MeshInstance3D" parent="Kun/Test-Kun"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.05, 0)
mesh = SubResource("TorusMesh_rbtmk")
skeleton = NodePath("")

[node name="Forward" type="MeshInstance3D" parent="Kun/XRBodyModifier3D/GroundRing"]
[node name="Forward" type="MeshInstance3D" parent="Kun/Test-Kun/GroundRing"]
transform = Transform3D(1, -8.74228e-08, -8.74228e-08, 8.74228e-08, -4.37114e-08, 1, -8.74228e-08, -1, -4.37114e-08, -5.96046e-08, 0, -0.6)
mesh = SubResource("SphereMesh_t4i7x")

Expand Down Expand Up @@ -244,14 +250,14 @@ max_value = 2.0
step = 0.1
value = 1.0

[node name="WorldLabel" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer/GridContainer"]
[node name="AvatarLabel" type="Label" parent="PanelContainer/MarginContainer/HBoxContainer/GridContainer"]
auto_translate_mode = 1
layout_mode = 2
text = "World Scale
text = "Avatar Scale
"
horizontal_alignment = 2

[node name="WorldSpinBox" type="SpinBox" parent="PanelContainer/MarginContainer/HBoxContainer/GridContainer"]
[node name="AvatarSpinBox" type="SpinBox" parent="PanelContainer/MarginContainer/HBoxContainer/GridContainer"]
auto_translate_mode = 1
layout_mode = 2
min_value = 0.1
Expand All @@ -260,7 +266,7 @@ step = 0.1
value = 1.0

[connection signal="value_changed" from="PanelContainer/MarginContainer/HBoxContainer/GridContainer/SkeletonSpinBox" to="." method="_on_skeleton_spin_box_value_changed"]
[connection signal="value_changed" from="PanelContainer/MarginContainer/HBoxContainer/GridContainer/WorldSpinBox" to="." method="_on_world_spin_box_value_changed"]
[connection signal="value_changed" from="PanelContainer/MarginContainer/HBoxContainer/GridContainer/AvatarSpinBox" to="." method="_on_avatar_spin_box_value_changed"]

[editable path="Chan/XRBodyModifier3D/Test-Chan"]
[editable path="Kun/XRBodyModifier3D/Test-Kun"]
[editable path="Chan/Test-Chan"]
[editable path="Kun/Test-Kun"]

0 comments on commit 72e49be

Please sign in to comment.