diff --git a/addons/godot-xr-tools/functions/function_pose_detector.gd b/addons/godot-xr-tools/functions/function_pose_detector.gd new file mode 100644 index 00000000..3d7fe315 --- /dev/null +++ b/addons/godot-xr-tools/functions/function_pose_detector.gd @@ -0,0 +1,108 @@ +class_name XRToolsFunctionPoseArea, "res://addons/godot-xr-tools/editor/icons/hand.svg" +extends Spatial + + +## XR Tools Function Pose Area +## +## This area works with the XRToolsHandPoseArea to control the pose +## of the VR hands. + + +## Collision mask to detect hand pose areas +export (int, LAYERS_3D_PHYSICS) var collision_mask : int = 1 << 21 setget set_collision_mask + + +## Hand controller +var _controller : ARVRController + +## Hand to control +var _hand : XRToolsHand + + +# Called when the node enters the scene tree for the first time. +func _ready(): + # Find controller and hand + _controller = get_parent() as ARVRController + _hand = _find_hand() + + # Connect signals (if controller and hand are valid) + if _controller and _hand: + if $SenseArea.connect("area_entered", self, "_on_area_entered"): + push_error("Unable to connect area_entered signal") + if $SenseArea.connect("area_exited", self, "_on_area_exited"): + push_error("Unable to connect area_exited signal") + + # Update collision mask + _update_collision_mask() + + +# This method verifies the pose area has a valid configuration. +func _get_configuration_warning(): + # Verify hand can be found + if !_find_hand(): + return "Node must be a child of an ARVRController with a hand" + + # Pass basic validation + return "" + + +func set_collision_mask(mask : int) -> void: + collision_mask = mask + if is_inside_tree(): + _update_collision_mask() + + +func _update_collision_mask() -> void: + $SenseArea.collision_mask = collision_mask + + +## Signal handler called when this XRToolsFunctionPoseArea enters an area +func _on_area_entered(area : Area) -> void: + # Igjnore if the area is not a hand-pose area + var pose_area := area as XRToolsHandPoseArea + if !pose_area: + return + + # Set the appropriate poses + if _controller.controller_id == 1 and pose_area.left_pose: + _hand.add_pose_override( + pose_area, + pose_area.pose_priority, + pose_area.left_pose) + elif _controller.controller_id == 2 and pose_area.right_pose: + _hand.add_pose_override( + pose_area, + pose_area.pose_priority, + pose_area.right_pose) + + +## Signal handler called when this XRToolsFunctionPoseArea leaves an area +func _on_area_exited(area : Area) -> void: + # Ignore if the area is not a hand-pose area + var pose_area := area as XRToolsHandPoseArea + if !pose_area: + return + + # Remove any overrides set from this hand-pose area + _hand.remove_pose_override(pose_area) + + +func _find_hand() -> XRToolsHand: + # Get the parent + var parent := get_parent() + if !parent: + return null + + # Make sure it's a controller + var controller := parent as ARVRController + if !controller: + return null + + # Look for hands under the controller + for child in controller.get_children(): + var hand := child as XRToolsHand + if hand: + return hand + + # No hand found + return null diff --git a/addons/godot-xr-tools/functions/function_pose_detector.tscn b/addons/godot-xr-tools/functions/function_pose_detector.tscn new file mode 100644 index 00000000..fa02b684 --- /dev/null +++ b/addons/godot-xr-tools/functions/function_pose_detector.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://addons/godot-xr-tools/functions/function_pose_detector.gd" type="Script" id=1] + +[sub_resource type="CapsuleShape" id=1] +radius = 0.08 +height = 0.08 + +[node name="FunctionPoseDetector" type="Spatial"] +script = ExtResource( 1 ) + +[node name="SenseArea" type="Area" parent="."] +collision_layer = 0 +collision_mask = 2097152 +monitorable = false + +[node name="CollisionShape" type="CollisionShape" parent="SenseArea"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.04, 0.08 ) +shape = SubResource( 1 ) diff --git a/addons/godot-xr-tools/hands/animations/left/Sign_Point.anim b/addons/godot-xr-tools/hands/animations/left/Sign_Point.anim index fe8b236c..7df7863a 100644 Binary files a/addons/godot-xr-tools/hands/animations/left/Sign_Point.anim and b/addons/godot-xr-tools/hands/animations/left/Sign_Point.anim differ diff --git a/addons/godot-xr-tools/hands/animations/right/Sign_Point.anim b/addons/godot-xr-tools/hands/animations/right/Sign_Point.anim index 33d4965f..529ce8e7 100644 Binary files a/addons/godot-xr-tools/hands/animations/right/Sign_Point.anim and b/addons/godot-xr-tools/hands/animations/right/Sign_Point.anim differ diff --git a/addons/godot-xr-tools/hands/hand.gd b/addons/godot-xr-tools/hands/hand.gd index 1f9dc9db..637538c6 100644 --- a/addons/godot-xr-tools/hands/hand.gd +++ b/addons/godot-xr-tools/hands/hand.gd @@ -3,90 +3,44 @@ class_name XRToolsHand, "res://addons/godot-xr-tools/editor/icons/hand.svg" extends Spatial +## XR Tools Hand Script ## -## XR Hand Script -## -## @desc: -## This script manages a godot-xr-tools hand. It animates the hand blending -## grip and trigger animations based on controller input. -## -## Additionally the hand script detects world-scale changes in the ARVRServer -## and re-scales the hand appropriately so the hand stays scaled to the -## physical hand of the user. +## This script manages a godot-xr-tools hand. It animates the hand blending +## grip and trigger animations based on controller input. ## +## Additionally the hand script detects world-scale changes in the ARVRServer +## and re-scales the hand appropriately so the hand stays scaled to the +## physical hand of the user. + ## Signal emitted when the hand scale changes signal hand_scale_changed(scale) -## Override the hand material -export (Material) var hand_material_override setget set_hand_material_override - -## Hand extends - -export (Animation) var open_hand setget set_open_hand -export (Animation) var closed_hand setget set_closed_hand - -func set_open_hand(p_new_hand : Animation): - open_hand = p_new_hand - if is_inside_tree(): - _update_hands() - -func set_closed_hand(p_new_hand : Animation): - closed_hand = p_new_hand - if is_inside_tree(): - _update_hands() - -func _update_hands(): - # our first child node should be our hand - var hand_node : Spatial = get_child(0) - if !hand_node: - print("Couldn't find hand node") - return - - var animation_player : AnimationPlayer = hand_node.get_node_or_null("AnimationPlayer") - if !animation_player: - print("Couldn't find animation player") - return - var animation_tree : AnimationTree = get_node_or_null("AnimationTree") - if !animation_tree: - print("Couldn't find animation tree") - return - - var tree_root : AnimationNodeBlendTree = animation_tree.tree_root - if !tree_root: - print("Couldn't find tree root") - return - - if open_hand: - var open_name = animation_player.find_animation(open_hand) - if open_name == "": - open_name = "open_hand" - if animation_player.has_animation(open_name): - animation_player.remove_animation(open_name) +## Override the hand material +export var hand_material_override : Material setget set_hand_material_override - animation_player.add_animation(open_name, open_hand) +## Default hand pose +export var default_pose : Resource setget set_default_pose - var open_hand_obj : AnimationNodeAnimation = tree_root.get_node("OpenHand") - if open_hand_obj: - open_hand_obj.animation = open_name - if closed_hand: - var closed_name = animation_player.find_animation(closed_hand) - if closed_name == "": - closed_name = "closed_hand" - if animation_player.has_animation(closed_name): - animation_player.remove_animation(closed_name) +## Pose-override class +class PoseOverride: + ## Who requested the override + var who : Node + + ## Pose priority + var priority : int - animation_player.add_animation(closed_name, closed_hand) + ## Pose settings + var settings : XRToolsHandPoseSettings - var closed_hand_obj : AnimationNodeAnimation = tree_root.get_node("ClosedHand1") - if closed_hand_obj: - closed_hand_obj.animation = closed_name + ## Pose-override constructor + func _init(w : Node, p : int, s : XRToolsHandPoseSettings): + who = w + priority = p + settings = s - closed_hand_obj = tree_root.get_node("ClosedHand2") - if closed_hand_obj: - closed_hand_obj.animation = closed_name ## Last world scale (for scaling hands) var _last_world_scale : float = 1.0 @@ -97,22 +51,39 @@ var _transform : Transform ## Hand mesh var _hand_mesh : MeshInstance +## Hand animation player +var _animation_player : AnimationPlayer + +## Hand animation tree +var _animation_tree : AnimationTree + +## Animation blend tree +var _tree_root : AnimationNodeBlendTree + +## Sorted stack of PoseOverride +var _pose_overrides := [] + + ## Called when the node enters the scene tree for the first time. func _ready() -> void: # Save the initial hand transform _transform = transform - - # Find the hand mesh and update the hand material - _hand_mesh = _find_mesh_instance(self) - _update_hand_material_override() + + # Find the relevant hand nodes + _hand_mesh = _find_child(self, "MeshInstance") + _animation_player = _find_child(self, "AnimationPlayer") + _animation_tree = _find_child(self, "AnimationTree") # As we're going to make modifications to our animation tree, we need to do # a deep copy, simply setting resource local to scene does not seem to be enough - var tree_root = $AnimationTree.tree_root.duplicate(true) - $AnimationTree.tree_root = tree_root - - # Make sure we're using the correct poses - _update_hands() + if _animation_tree: + _tree_root = _animation_tree.tree_root.duplicate(true) + _animation_tree.tree_root = _tree_root + + # Apply all updates + _update_hand_material_override() + _update_pose() + ## This method is called on every frame. It checks for world-scale changes and ## scales itself causing the hand mesh and skeleton to scale appropriately. @@ -136,8 +107,9 @@ func _process(_delta: float) -> void: var grip = controller.get_joystick_axis(JOY_VR_ANALOG_GRIP) var trigger = controller.get_joystick_axis(JOY_VR_ANALOG_TRIGGER) - # Uncomment for workaround for bug in OpenXR plugin 1.1.1 and earlier giving values from -1.0 to 1.0 - # note that when controller are not being tracking yet this will result in a value of 0.5 + # Uncomment for workaround for bug in OpenXR plugin 1.1.1 and earlier + # giving values from -1.0 to 1.0. Note that when controllers are not + # being tracking yet this will result in a value of 0.5 # grip = (grip + 1.0) * 0.5 # trigger = (trigger + 1.0) * 0.5 @@ -147,6 +119,30 @@ func _process(_delta: float) -> void: # var grip_state = controller.is_button_pressed(JOY_VR_GRIP) # print("Pressed: " + str(grip_state)) + +# This method verifies the hand has a valid configuration. +func _get_configuration_warning(): + # Check hand for mesh instance + if not _find_child(self, "MeshInstance"): + return "Hand does not have a MeshInstance" + + # Check hand for animation player + if not _find_child(self, "AnimationPlayer"): + return "Hand does not have a AnimationPlayer" + + # Check hand for animation tree + var tree : AnimationTree = _find_child(self, "AnimationTree") + if not tree: + return "Hand does not have a AnimationTree" + + # Check hand animation tree has a root + if not tree.tree_root: + return "Hand AnimationTree has no root" + + # Passed basic validation + return "" + + ## Set the hand material override func set_hand_material_override(material : Material) -> void: hand_material_override = material @@ -154,22 +150,127 @@ func set_hand_material_override(material : Material) -> void: _update_hand_material_override() +## Set the default open-hand pose +func set_default_pose(pose : Resource) -> void: + default_pose = pose + if is_inside_tree(): + _update_pose() + + +## Add a pose override +func add_pose_override(who : Node, priority : int, settings : XRToolsHandPoseSettings) -> void: + # Insert the pose override and update the pose + _insert_pose_override(who, priority, settings) + _update_pose() + + +## Remove a pose override +func remove_pose_override(who : Node) -> void: + # Remove the pose override and update the pose + _remove_pose_override(who) + _update_pose() + + func _update_hand_material_override() -> void: if _hand_mesh: _hand_mesh.material_override = hand_material_override -func _find_mesh_instance(node : Node) -> MeshInstance: - # Test if the node is a mesh - var mesh := node as MeshInstance - if mesh: - return mesh +func _update_pose() -> void: + # Skip if no blend tree + if !_tree_root: + return + + # Select the pose settings + var pose_settings : XRToolsHandPoseSettings = default_pose + if _pose_overrides.size(): + pose_settings = _pose_overrides[0].settings + + # Get the open and closed pose animations + var open_pose : Animation = pose_settings.open_pose + var closed_pose : Animation = pose_settings.closed_pose + + # Apply the open hand pose in the player and blend tree + if open_pose: + var open_name = _animation_player.find_animation(open_pose) + if open_name == "": + open_name = "open_hand" + if _animation_player.has_animation(open_name): + _animation_player.remove_animation(open_name) + + _animation_player.add_animation(open_name, open_pose) + + var open_hand_obj : AnimationNodeAnimation = _tree_root.get_node("OpenHand") + if open_hand_obj: + open_hand_obj.animation = open_name + + # Apply the closed hand pose in the player and blend tree + if closed_pose: + var closed_name = _animation_player.find_animation(closed_pose) + if closed_name == "": + closed_name = "closed_hand" + if _animation_player.has_animation(closed_name): + _animation_player.remove_animation(closed_name) + + _animation_player.add_animation(closed_name, closed_pose) + + var closed_hand_obj : AnimationNodeAnimation = _tree_root.get_node("ClosedHand1") + if closed_hand_obj: + closed_hand_obj.animation = closed_name + + closed_hand_obj = _tree_root.get_node("ClosedHand2") + if closed_hand_obj: + closed_hand_obj.animation = closed_name + + +func _insert_pose_override(who : Node, priority : int, settings : XRToolsHandPoseSettings) -> void: + # Construct the pose override + var override := PoseOverride.new(who, priority, settings) + + # Iterate over all pose overrides in the list + for pos in _pose_overrides.size(): + # Get the pose override + var pose : PoseOverride = _pose_overrides[pos] + + # Insert as early as possible to not invalidate sorting + if pose.priority <= priority: + _pose_overrides.insert(pos, override) + return + + # Insert at the end + _pose_overrides.push_back(override) + + +func _remove_pose_override(who : Node) -> void: + var pos := 0 + var length := _pose_overrides.size() + + # Iterate over all pose overrides in the list + while pos < length: + # Get the pose override + var pose : PoseOverride = _pose_overrides[pos] + + # Check for a match + if pose.who == who: + # Remove the override + _pose_overrides.remove(pos) + length -= 1 + else: + # Advance down the list + pos += 1 + + +static func _find_child(node : Node, type : String) -> Node: + # Iterate through all children + for child in node.get_children(): + # If the child is a match then return it + if child.is_class(type): + return child - # Check all children - for i in node.get_child_count(): - mesh = _find_mesh_instance(node.get_child(i)) - if mesh: - return mesh + # Recurse into child + var found := _find_child(child, type) + if found: + return found - # Could not find mesh + # No child found matching type return null diff --git a/addons/godot-xr-tools/hands/poses/hand_pose_settings.gd b/addons/godot-xr-tools/hands/poses/hand_pose_settings.gd new file mode 100644 index 00000000..d8ece425 --- /dev/null +++ b/addons/godot-xr-tools/hands/poses/hand_pose_settings.gd @@ -0,0 +1,15 @@ +class_name XRToolsHandPoseSettings, "res://addons/godot-xr-tools/editor/icons/hand.svg" +extends Resource + + +## XR Tools Hand Pose Settings Resource +## +## This resource defines the settings for hand poses such as the poses for +## hand-open and hand-closed. + + +## Hand-open pose +export var open_pose : Animation + +## Hand-closed pose +export var closed_pose : Animation diff --git a/addons/godot-xr-tools/hands/poses/pose_default_left.tres b/addons/godot-xr-tools/hands/poses/pose_default_left.tres new file mode 100644 index 00000000..e47cb2b3 --- /dev/null +++ b/addons/godot-xr-tools/hands/poses/pose_default_left.tres @@ -0,0 +1,10 @@ +[gd_resource type="Resource" load_steps=4 format=2] + +[ext_resource path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" type="Script" id=1] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=2] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=3] + +[resource] +script = ExtResource( 1 ) +open_pose = ExtResource( 2 ) +closed_pose = ExtResource( 3 ) diff --git a/addons/godot-xr-tools/hands/poses/pose_default_right.tres b/addons/godot-xr-tools/hands/poses/pose_default_right.tres new file mode 100644 index 00000000..9b18b4f6 --- /dev/null +++ b/addons/godot-xr-tools/hands/poses/pose_default_right.tres @@ -0,0 +1,10 @@ +[gd_resource type="Resource" load_steps=4 format=2] + +[ext_resource path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" type="Script" id=1] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=2] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=3] + +[resource] +script = ExtResource( 1 ) +open_pose = ExtResource( 2 ) +closed_pose = ExtResource( 3 ) diff --git a/addons/godot-xr-tools/hands/poses/pose_point_left.tres b/addons/godot-xr-tools/hands/poses/pose_point_left.tres new file mode 100644 index 00000000..50f7ad1b --- /dev/null +++ b/addons/godot-xr-tools/hands/poses/pose_point_left.tres @@ -0,0 +1,9 @@ +[gd_resource type="Resource" load_steps=3 format=2] + +[ext_resource path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" type="Script" id=1] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Sign_Point.anim" type="Animation" id=2] + +[resource] +script = ExtResource( 1 ) +open_pose = ExtResource( 2 ) +closed_pose = ExtResource( 2 ) diff --git a/addons/godot-xr-tools/hands/poses/pose_point_right.tres b/addons/godot-xr-tools/hands/poses/pose_point_right.tres new file mode 100644 index 00000000..1207f707 --- /dev/null +++ b/addons/godot-xr-tools/hands/poses/pose_point_right.tres @@ -0,0 +1,9 @@ +[gd_resource type="Resource" load_steps=3 format=2] + +[ext_resource path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" type="Script" id=1] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Sign_Point.anim" type="Animation" id=2] + +[resource] +script = ExtResource( 1 ) +open_pose = ExtResource( 2 ) +closed_pose = ExtResource( 2 ) diff --git a/addons/godot-xr-tools/hands/scenes/highpoly/left_fullglove_hand.tscn b/addons/godot-xr-tools/hands/scenes/highpoly/left_fullglove_hand.tscn index fe963f9f..c55fe17b 100644 --- a/addons/godot-xr-tools/hands/scenes/highpoly/left_fullglove_hand.tscn +++ b/addons/godot-xr-tools/hands/scenes/highpoly/left_fullglove_hand.tscn @@ -1,20 +1,48 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_L.gltf" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/materials/cleaning_glove.material" type="Material" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=7] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" type="Resource" id=5] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -798.981, 58.67 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 20 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="LeftHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 6 ) -closed_hand = ExtResource( 5 ) +default_pose = ExtResource( 5 ) [node name="Hand_L" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, -0.05, 0.15 ) @@ -28,7 +56,7 @@ material/0 = ExtResource( 4 ) [node name="AnimationPlayer" parent="Hand_L" instance=ExtResource( 1 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 7 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_L/AnimationPlayer") active = true parameters/Grip/blend_amount = 0 diff --git a/addons/godot-xr-tools/hands/scenes/highpoly/left_fullglove_physics_hand.tscn b/addons/godot-xr-tools/hands/scenes/highpoly/left_fullglove_physics_hand.tscn index 412a713b..6a784a10 100644 --- a/addons/godot-xr-tools/hands/scenes/highpoly/left_fullglove_physics_hand.tscn +++ b/addons/godot-xr-tools/hands/scenes/highpoly/left_fullglove_physics_hand.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_L.gltf" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" type="PackedScene" id=2] @@ -7,17 +7,45 @@ [ext_resource path="res://addons/godot-xr-tools/hands/materials/labglove.material" type="Material" id=5] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=6] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=7] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=8] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=9] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=10] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" type="Resource" id=8] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -798.981, 58.67 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 20 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="LeftPhysicsHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 9 ) -closed_hand = ExtResource( 8 ) +default_pose = ExtResource( 8 ) [node name="Hand_L" parent="." instance=ExtResource( 1 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, -0.05, 0.15 ) @@ -25,28 +53,6 @@ __meta__ = { "_editor_description_": "" } -[node name="Skeleton" parent="Hand_L/Armature" index="0"] -bones/0/bound_children = [ NodePath("BoneRoot") ] -bones/1/bound_children = [ NodePath("BoneThumbMetacarpal") ] -bones/2/bound_children = [ NodePath("BoneThumbProximal") ] -bones/3/bound_children = [ NodePath("BoneThumbDistal") ] -bones/5/bound_children = [ NodePath("BoneIndexMetacarpal") ] -bones/6/bound_children = [ NodePath("BoneIndexProximal") ] -bones/7/bound_children = [ NodePath("BoneIndexMiddle") ] -bones/8/bound_children = [ NodePath("BoneIndexDistal") ] -bones/10/bound_children = [ NodePath("BoneMiddleMetacarpal") ] -bones/11/bound_children = [ NodePath("BoneMiddleProximal") ] -bones/12/bound_children = [ NodePath("BoneMiddleMiddle") ] -bones/13/bound_children = [ NodePath("BoneMiddleDistal") ] -bones/15/bound_children = [ NodePath("BoneRingMetacarpal") ] -bones/16/bound_children = [ NodePath("BoneRingProximal") ] -bones/17/bound_children = [ NodePath("BoneRingMiddle") ] -bones/18/bound_children = [ NodePath("BoneRingDistal") ] -bones/20/bound_children = [ NodePath("BonePinkyMetacarpal") ] -bones/21/bound_children = [ NodePath("BonePinkyProximal") ] -bones/22/bound_children = [ NodePath("BonePinkyMiddle") ] -bones/23/bound_children = [ NodePath("BonePinkyDistal") ] - [node name="mesh_Hand_L" parent="Hand_L/Armature/Skeleton" index="0"] material/0 = ExtResource( 5 ) @@ -178,7 +184,7 @@ anims/closed_hand = ExtResource( 7 ) anims/open_hand = ExtResource( 6 ) [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 10 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_L/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/highpoly/left_hand.tscn b/addons/godot-xr-tools/hands/scenes/highpoly/left_hand.tscn index 8fabcb62..a72b8d39 100644 --- a/addons/godot-xr-tools/hands/scenes/highpoly/left_hand.tscn +++ b/addons/godot-xr-tools/hands/scenes/highpoly/left_hand.tscn @@ -1,20 +1,48 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_Nails_L.gltf" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/hand.gd" type="Script" id=3] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=5] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" type="Resource" id=4] [ext_resource path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" type="Material" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=7] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -798.981, 58.67 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 20 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="LeftHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 4 ) -closed_hand = ExtResource( 5 ) +default_pose = ExtResource( 4 ) [node name="Hand_Nails_L" parent="." instance=ExtResource( 1 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, -0.05, 0.15 ) @@ -28,7 +56,7 @@ material/0 = ExtResource( 6 ) [node name="AnimationPlayer" parent="Hand_Nails_L" instance=ExtResource( 2 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 7 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_Nails_L/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/highpoly/left_physics_hand.tscn b/addons/godot-xr-tools/hands/scenes/highpoly/left_physics_hand.tscn index 28717788..5efadd2a 100644 --- a/addons/godot-xr-tools/hands/scenes/highpoly/left_physics_hand.tscn +++ b/addons/godot-xr-tools/hands/scenes/highpoly/left_physics_hand.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=11 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_Nails_L.gltf" type="PackedScene" id=2] @@ -7,17 +7,45 @@ [ext_resource path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" type="Material" id=5] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=6] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=7] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=8] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=9] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=10] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" type="Resource" id=8] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -798.981, 58.67 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 20 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="LeftPhysicsHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 9 ) -closed_hand = ExtResource( 8 ) +default_pose = ExtResource( 8 ) [node name="Hand_Nails_L" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, -0.05, 0.15 ) @@ -25,28 +53,6 @@ __meta__ = { "_editor_description_": "" } -[node name="Skeleton" parent="Hand_Nails_L/Armature" index="0"] -bones/0/bound_children = [ NodePath("BoneRoot") ] -bones/1/bound_children = [ NodePath("BoneThumbMetacarpal") ] -bones/2/bound_children = [ NodePath("BoneThumbProximal") ] -bones/3/bound_children = [ NodePath("BoneThumbDistal") ] -bones/5/bound_children = [ NodePath("BoneIndexMetacarpal") ] -bones/6/bound_children = [ NodePath("BoneIndexProximal") ] -bones/7/bound_children = [ NodePath("BoneIndexMiddle") ] -bones/8/bound_children = [ NodePath("BoneIndexDistal") ] -bones/10/bound_children = [ NodePath("BoneMiddleMetacarpal") ] -bones/11/bound_children = [ NodePath("BoneMiddleProximal") ] -bones/12/bound_children = [ NodePath("BoneMiddleMiddle") ] -bones/13/bound_children = [ NodePath("BoneMiddleDistal") ] -bones/15/bound_children = [ NodePath("BoneRingMetacarpal") ] -bones/16/bound_children = [ NodePath("BoneRingProximal") ] -bones/17/bound_children = [ NodePath("BoneRingMiddle") ] -bones/18/bound_children = [ NodePath("BoneRingDistal") ] -bones/20/bound_children = [ NodePath("BonePinkyMetacarpal") ] -bones/21/bound_children = [ NodePath("BonePinkyProximal") ] -bones/22/bound_children = [ NodePath("BonePinkyMiddle") ] -bones/23/bound_children = [ NodePath("BonePinkyDistal") ] - [node name="mesh_Hand_Nails_L" parent="Hand_Nails_L/Armature/Skeleton" index="0"] material/0 = ExtResource( 5 ) @@ -178,7 +184,7 @@ anims/closed_hand = ExtResource( 7 ) anims/open_hand = ExtResource( 6 ) [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 10 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_Nails_L/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/highpoly/right_fullglove_hand.tscn b/addons/godot-xr-tools/hands/scenes/highpoly/right_fullglove_hand.tscn index cd7327c8..85371661 100644 --- a/addons/godot-xr-tools/hands/scenes/highpoly/right_fullglove_hand.tscn +++ b/addons/godot-xr-tools/hands/scenes/highpoly/right_fullglove_hand.tscn @@ -1,20 +1,48 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_R.gltf" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/AnimationPlayer.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/materials/cleaning_glove.material" type="Material" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=7] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_right.tres" type="Resource" id=5] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -753.664, -85.6991 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 40 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 40 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="RightHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 5 ) -closed_hand = ExtResource( 7 ) +default_pose = ExtResource( 5 ) [node name="Hand_R" parent="." instance=ExtResource( 1 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.05, 0.15 ) @@ -28,7 +56,7 @@ material/0 = ExtResource( 4 ) [node name="AnimationPlayer" parent="Hand_R" instance=ExtResource( 2 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 6 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_R/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/highpoly/right_fullglove_physics_hand.tscn b/addons/godot-xr-tools/hands/scenes/highpoly/right_fullglove_physics_hand.tscn index 7edfb3ff..d0e5da8e 100644 --- a/addons/godot-xr-tools/hands/scenes/highpoly/right_fullglove_physics_hand.tscn +++ b/addons/godot-xr-tools/hands/scenes/highpoly/right_fullglove_physics_hand.tscn @@ -1,17 +1,49 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_R.gltf" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/AnimationPlayer.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/physics_hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/hand_physics_bone.gd" type="Script" id=4] [ext_resource path="res://addons/godot-xr-tools/hands/materials/labglove.material" type="Material" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=6] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_right.tres" type="Resource" id=6] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -753.664, -85.6991 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 40 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 40 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="RightPhysicsHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } +default_pose = ExtResource( 6 ) [node name="Hand_R" parent="." instance=ExtResource( 1 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.05, 0.15 ) @@ -19,28 +51,6 @@ __meta__ = { "_editor_description_": "" } -[node name="Skeleton" parent="Hand_R/Armature" index="0"] -bones/0/bound_children = [ NodePath("BoneRoot") ] -bones/1/bound_children = [ NodePath("BoneThumbMetacarpal") ] -bones/2/bound_children = [ NodePath("BoneThumbProximal") ] -bones/3/bound_children = [ NodePath("BoneThumbDistal") ] -bones/5/bound_children = [ NodePath("BoneIndexMetacarpal") ] -bones/6/bound_children = [ NodePath("BoneIndexProximal") ] -bones/7/bound_children = [ NodePath("BoneIndexMiddle") ] -bones/8/bound_children = [ NodePath("BoneIndexDistal") ] -bones/10/bound_children = [ NodePath("BoneMiddleMetacarpal") ] -bones/11/bound_children = [ NodePath("BoneMiddleProximal") ] -bones/12/bound_children = [ NodePath("BoneMiddleMiddle") ] -bones/13/bound_children = [ NodePath("BoneMiddleDistal") ] -bones/15/bound_children = [ NodePath("BoneRingMetacarpal") ] -bones/16/bound_children = [ NodePath("BoneRingProximal") ] -bones/17/bound_children = [ NodePath("BoneRingMiddle") ] -bones/18/bound_children = [ NodePath("BoneRingDistal") ] -bones/20/bound_children = [ NodePath("BonePinkyMetacarpal") ] -bones/21/bound_children = [ NodePath("BonePinkyProximal") ] -bones/22/bound_children = [ NodePath("BonePinkyMiddle") ] -bones/23/bound_children = [ NodePath("BonePinkyDistal") ] - [node name="mesh_Hand_R" parent="Hand_R/Armature/Skeleton" index="0"] material/0 = ExtResource( 5 ) @@ -170,7 +180,7 @@ length = 0.015 [node name="AnimationPlayer" parent="Hand_R" instance=ExtResource( 2 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 6 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_R/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/highpoly/right_hand.tscn b/addons/godot-xr-tools/hands/scenes/highpoly/right_hand.tscn index 7004b66c..db9a4bdf 100644 --- a/addons/godot-xr-tools/hands/scenes/highpoly/right_hand.tscn +++ b/addons/godot-xr-tools/hands/scenes/highpoly/right_hand.tscn @@ -1,20 +1,48 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_Nails_R.gltf" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/AnimationPlayer.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" type="Material" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=7] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_right.tres" type="Resource" id=5] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -753.664, -85.6991 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 40 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 40 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="RightHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 6 ) -closed_hand = ExtResource( 7 ) +default_pose = ExtResource( 5 ) [node name="Hand_Nails_R" parent="." instance=ExtResource( 1 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.05, 0.15 ) @@ -28,7 +56,7 @@ material/0 = ExtResource( 4 ) [node name="AnimationPlayer" parent="Hand_Nails_R" instance=ExtResource( 2 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 5 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_Nails_R/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/highpoly/right_physics_hand.tscn b/addons/godot-xr-tools/hands/scenes/highpoly/right_physics_hand.tscn index f2c8ceb7..4a578680 100644 --- a/addons/godot-xr-tools/hands/scenes/highpoly/right_physics_hand.tscn +++ b/addons/godot-xr-tools/hands/scenes/highpoly/right_physics_hand.tscn @@ -1,17 +1,49 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_Nails_R.gltf" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/physics_hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/hand_physics_bone.gd" type="Script" id=4] [ext_resource path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" type="Material" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=6] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_right.tres" type="Resource" id=6] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -753.664, -85.6991 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 40 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 40 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="RightPhysicsHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } +default_pose = ExtResource( 6 ) [node name="Hand_Nails_R" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.05, 0.15 ) @@ -170,7 +202,7 @@ length = 0.015 [node name="AnimationPlayer" parent="Hand_Nails_R" instance=ExtResource( 1 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 6 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_Nails_R/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/lowpoly/left_fullglove_low.tscn b/addons/godot-xr-tools/hands/scenes/lowpoly/left_fullglove_low.tscn index 4acebd78..7d59d5d0 100644 --- a/addons/godot-xr-tools/hands/scenes/lowpoly/left_fullglove_low.tscn +++ b/addons/godot-xr-tools/hands/scenes/lowpoly/left_fullglove_low.tscn @@ -1,20 +1,48 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_low_L.gltf" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/hand.gd" type="Script" id=3] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=5] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" type="Resource" id=4] [ext_resource path="res://addons/godot-xr-tools/hands/materials/cleaning_glove.material" type="Material" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=7] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -798.981, 58.67 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 20 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="LeftHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 5 ) -closed_hand = ExtResource( 4 ) +default_pose = ExtResource( 4 ) [node name="Hand_low_L" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, -0.05, 0.15 ) @@ -28,7 +56,7 @@ material/0 = ExtResource( 6 ) [node name="AnimationPlayer" parent="Hand_low_L" instance=ExtResource( 1 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 7 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_low_L/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn b/addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn index 26af82cd..28b0db6c 100644 --- a/addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn +++ b/addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn @@ -1,20 +1,48 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_Nails_low_L.gltf" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" type="Material" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=7] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" type="Resource" id=5] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -798.981, 58.67 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 20 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="LeftHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 5 ) -closed_hand = ExtResource( 6 ) +default_pose = ExtResource( 5 ) [node name="Hand_Nails_low_L" parent="." instance=ExtResource( 1 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, -0.05, 0.15 ) @@ -28,7 +56,7 @@ material/0 = ExtResource( 4 ) [node name="AnimationPlayer" parent="Hand_Nails_low_L" instance=ExtResource( 2 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 7 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_Nails_low_L/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/lowpoly/left_physics_fullglove_low.tscn b/addons/godot-xr-tools/hands/scenes/lowpoly/left_physics_fullglove_low.tscn index 09c40e47..3a00b246 100644 --- a/addons/godot-xr-tools/hands/scenes/lowpoly/left_physics_fullglove_low.tscn +++ b/addons/godot-xr-tools/hands/scenes/lowpoly/left_physics_fullglove_low.tscn @@ -1,21 +1,49 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_low_L.gltf" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/physics_hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/hand_physics_bone.gd" type="Script" id=4] [ext_resource path="res://addons/godot-xr-tools/hands/materials/labglove.material" type="Material" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=7] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=8] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" type="Resource" id=6] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -798.981, 58.67 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 20 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="LeftPhysicsHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 6 ) -closed_hand = ExtResource( 7 ) +default_pose = ExtResource( 6 ) [node name="Hand_low_L" parent="." instance=ExtResource( 1 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, -0.05, 0.15 ) @@ -23,28 +51,6 @@ __meta__ = { "_editor_description_": "" } -[node name="Skeleton" parent="Hand_low_L/Armature" index="0"] -bones/0/bound_children = [ NodePath("BoneRoot") ] -bones/1/bound_children = [ NodePath("BoneThumbMetacarpal") ] -bones/2/bound_children = [ NodePath("BoneThumbProximal") ] -bones/3/bound_children = [ NodePath("BoneThumbDistal") ] -bones/5/bound_children = [ NodePath("BoneIndexMetacarpal") ] -bones/6/bound_children = [ NodePath("BoneIndexProximal") ] -bones/7/bound_children = [ NodePath("BoneIndexMiddle") ] -bones/8/bound_children = [ NodePath("BoneIndexDistal") ] -bones/10/bound_children = [ NodePath("BoneMiddleMetacarpal") ] -bones/11/bound_children = [ NodePath("BoneMiddleProximal") ] -bones/12/bound_children = [ NodePath("BoneMiddleMiddle") ] -bones/13/bound_children = [ NodePath("BoneMiddleDistal") ] -bones/15/bound_children = [ NodePath("BoneRingMetacarpal") ] -bones/16/bound_children = [ NodePath("BoneRingProximal") ] -bones/17/bound_children = [ NodePath("BoneRingMiddle") ] -bones/18/bound_children = [ NodePath("BoneRingDistal") ] -bones/20/bound_children = [ NodePath("BonePinkyMetacarpal") ] -bones/21/bound_children = [ NodePath("BonePinkyProximal") ] -bones/22/bound_children = [ NodePath("BonePinkyMiddle") ] -bones/23/bound_children = [ NodePath("BonePinkyDistal") ] - [node name="mesh_Hand_low_L" parent="Hand_low_L/Armature/Skeleton" index="0"] material/0 = ExtResource( 5 ) @@ -174,7 +180,7 @@ length = 0.015 [node name="AnimationPlayer" parent="Hand_low_L" instance=ExtResource( 2 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 8 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_low_L/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/lowpoly/left_physics_hand_low.tscn b/addons/godot-xr-tools/hands/scenes/lowpoly/left_physics_hand_low.tscn index cb012e53..24ff3368 100644 --- a/addons/godot-xr-tools/hands/scenes/lowpoly/left_physics_hand_low.tscn +++ b/addons/godot-xr-tools/hands/scenes/lowpoly/left_physics_hand_low.tscn @@ -1,21 +1,49 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/left/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_Nails_low_L.gltf" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/physics_hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/hand_physics_bone.gd" type="Script" id=4] [ext_resource path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" type="Material" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip.anim" type="Animation" id=7] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=8] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_left.tres" type="Resource" id=6] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -798.981, 58.67 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 20 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 20 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="LeftPhysicsHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 6 ) -closed_hand = ExtResource( 7 ) +default_pose = ExtResource( 6 ) [node name="Hand_Nails_low_L" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.03, -0.05, 0.15 ) @@ -23,28 +51,6 @@ __meta__ = { "_editor_description_": "" } -[node name="Skeleton" parent="Hand_Nails_low_L/Armature" index="0"] -bones/0/bound_children = [ NodePath("BoneRoot") ] -bones/1/bound_children = [ NodePath("BoneThumbMetacarpal") ] -bones/2/bound_children = [ NodePath("BoneThumbProximal") ] -bones/3/bound_children = [ NodePath("BoneThumbDistal") ] -bones/5/bound_children = [ NodePath("BoneIndexMetacarpal") ] -bones/6/bound_children = [ NodePath("BoneIndexProximal") ] -bones/7/bound_children = [ NodePath("BoneIndexMiddle") ] -bones/8/bound_children = [ NodePath("BoneIndexDistal") ] -bones/10/bound_children = [ NodePath("BoneMiddleMetacarpal") ] -bones/11/bound_children = [ NodePath("BoneMiddleProximal") ] -bones/12/bound_children = [ NodePath("BoneMiddleMiddle") ] -bones/13/bound_children = [ NodePath("BoneMiddleDistal") ] -bones/15/bound_children = [ NodePath("BoneRingMetacarpal") ] -bones/16/bound_children = [ NodePath("BoneRingProximal") ] -bones/17/bound_children = [ NodePath("BoneRingMiddle") ] -bones/18/bound_children = [ NodePath("BoneRingDistal") ] -bones/20/bound_children = [ NodePath("BonePinkyMetacarpal") ] -bones/21/bound_children = [ NodePath("BonePinkyProximal") ] -bones/22/bound_children = [ NodePath("BonePinkyMiddle") ] -bones/23/bound_children = [ NodePath("BonePinkyDistal") ] - [node name="mesh_Hand_Nails_low_L" parent="Hand_Nails_low_L/Armature/Skeleton" index="0"] material/0 = ExtResource( 5 ) @@ -174,7 +180,7 @@ length = 0.015 [node name="AnimationPlayer" parent="Hand_Nails_low_L" instance=ExtResource( 1 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 8 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_Nails_low_L/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/lowpoly/right_fullglove_low.tscn b/addons/godot-xr-tools/hands/scenes/lowpoly/right_fullglove_low.tscn index cb8e7828..7589177c 100644 --- a/addons/godot-xr-tools/hands/scenes/lowpoly/right_fullglove_low.tscn +++ b/addons/godot-xr-tools/hands/scenes/lowpoly/right_fullglove_low.tscn @@ -1,20 +1,48 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_low_R.gltf" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/materials/cleaning_glove.material" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/hand.gd" type="Script" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=7] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_right.tres" type="Resource" id=5] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -753.664, -85.6991 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 40 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 40 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="RightHand" type="Spatial"] script = ExtResource( 4 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 5 ) -closed_hand = ExtResource( 6 ) +default_pose = ExtResource( 5 ) [node name="Hand_low_R" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.05, 0.15 ) @@ -28,7 +56,7 @@ material/0 = ExtResource( 3 ) [node name="AnimationPlayer" parent="Hand_low_R" instance=ExtResource( 1 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 7 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_low_R/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/lowpoly/right_hand_low.tscn b/addons/godot-xr-tools/hands/scenes/lowpoly/right_hand_low.tscn index 4768021a..a6fd78c9 100644 --- a/addons/godot-xr-tools/hands/scenes/lowpoly/right_hand_low.tscn +++ b/addons/godot-xr-tools/hands/scenes/lowpoly/right_hand_low.tscn @@ -1,20 +1,48 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_Nails_low_R.gltf" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" type="Material" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=7] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_right.tres" type="Resource" id=5] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -753.664, -85.6991 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 40 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 40 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="RightHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 7 ) -closed_hand = ExtResource( 6 ) +default_pose = ExtResource( 5 ) [node name="Hand_Nails_low_R" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.05, 0.15 ) @@ -28,7 +56,7 @@ material/0 = ExtResource( 4 ) [node name="AnimationPlayer" parent="Hand_Nails_low_R" instance=ExtResource( 1 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 5 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_Nails_low_R/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/lowpoly/right_physics_fullglove_low.tscn b/addons/godot-xr-tools/hands/scenes/lowpoly/right_physics_fullglove_low.tscn index aaccad6c..148239fb 100644 --- a/addons/godot-xr-tools/hands/scenes/lowpoly/right_physics_fullglove_low.tscn +++ b/addons/godot-xr-tools/hands/scenes/lowpoly/right_physics_fullglove_low.tscn @@ -1,21 +1,49 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_low_R.gltf" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/materials/labglove.material" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/physics_hand.gd" type="Script" id=4] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=7] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_right.tres" type="Resource" id=5] [ext_resource path="res://addons/godot-xr-tools/hands/hand_physics_bone.gd" type="Script" id=8] +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -753.664, -85.6991 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 40 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 40 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] + [node name="RightPhysicsHand" type="Spatial"] script = ExtResource( 4 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 6 ) -closed_hand = ExtResource( 7 ) +default_pose = ExtResource( 5 ) [node name="Hand_low_R" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.05, 0.15 ) @@ -23,28 +51,6 @@ __meta__ = { "_editor_description_": "" } -[node name="Skeleton" parent="Hand_low_R/Armature" index="0"] -bones/0/bound_children = [ NodePath("BoneRoot") ] -bones/1/bound_children = [ NodePath("BoneThumbMetacarpal") ] -bones/2/bound_children = [ NodePath("BoneThumbProximal") ] -bones/3/bound_children = [ NodePath("BoneThumbDistal") ] -bones/5/bound_children = [ NodePath("BoneIndexMetacarpal") ] -bones/6/bound_children = [ NodePath("BoneIndexProximal") ] -bones/7/bound_children = [ NodePath("BoneIndexMiddle") ] -bones/8/bound_children = [ NodePath("BoneIndexDistal") ] -bones/10/bound_children = [ NodePath("BoneMiddleMetacarpal") ] -bones/11/bound_children = [ NodePath("BoneMiddleProximal") ] -bones/12/bound_children = [ NodePath("BoneMiddleMiddle") ] -bones/13/bound_children = [ NodePath("BoneMiddleDistal") ] -bones/15/bound_children = [ NodePath("BoneRingMetacarpal") ] -bones/16/bound_children = [ NodePath("BoneRingProximal") ] -bones/17/bound_children = [ NodePath("BoneRingMiddle") ] -bones/18/bound_children = [ NodePath("BoneRingDistal") ] -bones/20/bound_children = [ NodePath("BonePinkyMetacarpal") ] -bones/21/bound_children = [ NodePath("BonePinkyProximal") ] -bones/22/bound_children = [ NodePath("BonePinkyMiddle") ] -bones/23/bound_children = [ NodePath("BonePinkyDistal") ] - [node name="mesh_Hand_low_R" parent="Hand_low_R/Armature/Skeleton" index="0"] material/0 = ExtResource( 3 ) @@ -174,7 +180,7 @@ length = 0.015 [node name="AnimationPlayer" parent="Hand_low_R" instance=ExtResource( 1 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 5 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_low_R/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/hands/scenes/lowpoly/right_physics_hand_low.tscn b/addons/godot-xr-tools/hands/scenes/lowpoly/right_physics_hand_low.tscn index 77612363..487ce04a 100644 --- a/addons/godot-xr-tools/hands/scenes/lowpoly/right_physics_hand_low.tscn +++ b/addons/godot-xr-tools/hands/scenes/lowpoly/right_physics_hand_low.tscn @@ -1,21 +1,49 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://addons/godot-xr-tools/hands/animations/right/AnimationPlayer.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/model/Hand_Nails_low_R.gltf" type="PackedScene" id=2] [ext_resource path="res://addons/godot-xr-tools/hands/physics_hand.gd" type="Script" id=3] [ext_resource path="res://addons/godot-xr-tools/hands/hand_physics_bone.gd" type="Script" id=4] [ext_resource path="res://addons/godot-xr-tools/hands/materials/caucasian_hand.material" type="Material" id=5] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/hand_blend_tree.tres" type="AnimationNodeBlendTree" id=6] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip.anim" type="Animation" id=7] -[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=8] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_default_right.tres" type="Resource" id=6] + +[sub_resource type="AnimationNodeAnimation" id=1] +animation = "Grip" + +[sub_resource type="AnimationNodeAnimation" id=2] +animation = "Grip" + +[sub_resource type="AnimationNodeBlend2" id=3] +filter_enabled = true +filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R" ] + +[sub_resource type="AnimationNodeAnimation" id=4] +animation = "Grip 5" + +[sub_resource type="AnimationNodeBlend2" id=5] +filter_enabled = true +filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R" ] + +[sub_resource type="AnimationNodeBlendTree" id=6] +graph_offset = Vector2( -753.664, -85.6991 ) +nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/position = Vector2( -600, 300 ) +nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/position = Vector2( -360, 300 ) +nodes/Grip/node = SubResource( 3 ) +nodes/Grip/position = Vector2( 0, 40 ) +nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/position = Vector2( -600, 100 ) +nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/position = Vector2( -360, 40 ) +node_connections = [ "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "output", 0, "Grip" ] [node name="RightPhysicsHand" type="Spatial"] script = ExtResource( 3 ) __meta__ = { "_editor_description_": "" } -open_hand = ExtResource( 8 ) -closed_hand = ExtResource( 7 ) +default_pose = ExtResource( 6 ) [node name="Hand_Nails_low_R" parent="." instance=ExtResource( 2 )] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.03, -0.05, 0.15 ) @@ -174,7 +202,7 @@ length = 0.015 [node name="AnimationPlayer" parent="Hand_Nails_low_R" instance=ExtResource( 1 )] [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = ExtResource( 6 ) +tree_root = SubResource( 6 ) anim_player = NodePath("../Hand_Nails_low_R/AnimationPlayer") active = true parameters/Grip/blend_amount = 0.0 diff --git a/addons/godot-xr-tools/objects/hand_pose_area.gd b/addons/godot-xr-tools/objects/hand_pose_area.gd new file mode 100644 index 00000000..b9e97bc6 --- /dev/null +++ b/addons/godot-xr-tools/objects/hand_pose_area.gd @@ -0,0 +1,18 @@ +class_name XRToolsHandPoseArea, "res://addons/godot-xr-tools/editor/icons/hand.svg" +extends Area + + +## XR Tools Hand Pose Area +## +## This area works with the XRToolsFunctionPoseArea to control the pose +## of the VR hands. + + +## Priority level for this +export var pose_priority : int + +## Left hand pose settings (XRToolsHandPoseSettings) +export var left_pose : Resource + +## Right hand pose settings (XRToolsHandPoseSettings) +export var right_pose : Resource diff --git a/addons/godot-xr-tools/objects/hand_pose_area.tscn b/addons/godot-xr-tools/objects/hand_pose_area.tscn new file mode 100644 index 00000000..c6d7ae5b --- /dev/null +++ b/addons/godot-xr-tools/objects/hand_pose_area.tscn @@ -0,0 +1,9 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.gd" type="Script" id=1] + +[node name="HandPoseArea" type="Area"] +collision_layer = 2097152 +collision_mask = 0 +monitoring = false +script = ExtResource( 1 ) diff --git a/assets/meshes/interactables/joystick_smooth.tscn b/assets/meshes/interactables/joystick_smooth.tscn index 949fce06..b9d5a342 100644 --- a/assets/meshes/interactables/joystick_smooth.tscn +++ b/assets/meshes/interactables/joystick_smooth.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_joystick.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.1, 0.05 ) @@ -78,3 +81,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 7 ) diff --git a/assets/meshes/interactables/joystick_snap.tscn b/assets/meshes/interactables/joystick_snap.tscn index e398390e..949b135f 100644 --- a/assets/meshes/interactables/joystick_snap.tscn +++ b/assets/meshes/interactables/joystick_snap.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_joystick.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.1, 0.05 ) @@ -30,6 +33,10 @@ rings = 8 margin = 0.12 radius = 0.06 +[sub_resource type="SphereShape" id=8] +margin = 0.12 +radius = 0.06 + [node name="JoystickSnap" type="Spatial"] [node name="Frame" type="StaticBody" parent="."] @@ -80,3 +87,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 8 ) diff --git a/assets/meshes/interactables/joystick_zero.tscn b/assets/meshes/interactables/joystick_zero.tscn index 1624cb97..f2c3ac3f 100644 --- a/assets/meshes/interactables/joystick_zero.tscn +++ b/assets/meshes/interactables/joystick_zero.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_joystick.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.1, 0.05 ) @@ -30,6 +33,10 @@ rings = 8 margin = 0.12 radius = 0.06 +[sub_resource type="SphereShape" id=8] +margin = 0.12 +radius = 0.06 + [node name="JoystickZero" type="Spatial"] [node name="Frame" type="StaticBody" parent="."] @@ -79,3 +86,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="JoystickOrigin/InteractableJoystick/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 8 ) diff --git a/assets/meshes/interactables/lever_smooth.tscn b/assets/meshes/interactables/lever_smooth.tscn index c96f0fd3..46193a26 100644 --- a/assets/meshes/interactables/lever_smooth.tscn +++ b/assets/meshes/interactables/lever_smooth.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_hinge.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.3, 0.05 ) @@ -30,6 +33,10 @@ rings = 8 margin = 0.12 radius = 0.06 +[sub_resource type="SphereShape" id=8] +margin = 0.12 +radius = 0.06 + [node name="LeverSmooth" type="Spatial"] [node name="Frame" type="StaticBody" parent="."] @@ -78,3 +85,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 8 ) diff --git a/assets/meshes/interactables/lever_snap.tscn b/assets/meshes/interactables/lever_snap.tscn index df36fe63..21302d07 100644 --- a/assets/meshes/interactables/lever_snap.tscn +++ b/assets/meshes/interactables/lever_snap.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_hinge.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.3, 0.05 ) @@ -30,6 +33,10 @@ rings = 8 margin = 0.12 radius = 0.06 +[sub_resource type="SphereShape" id=8] +margin = 0.12 +radius = 0.06 + [node name="LeverSnap" type="Spatial"] [node name="Frame" type="StaticBody" parent="."] @@ -79,3 +86,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 8 ) diff --git a/assets/meshes/interactables/lever_zero.tscn b/assets/meshes/interactables/lever_zero.tscn index 7c61126c..d8ec7294 100644 --- a/assets/meshes/interactables/lever_zero.tscn +++ b/assets/meshes/interactables/lever_zero.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_hinge.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.3, 0.05 ) @@ -30,6 +33,10 @@ rings = 8 margin = 0.12 radius = 0.06 +[sub_resource type="SphereShape" id=8] +margin = 0.12 +radius = 0.06 + [node name="LeverZero" type="Spatial"] [node name="Frame" type="StaticBody" parent="."] @@ -79,3 +86,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="LeverOrigin/InteractableLever/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 8 ) diff --git a/assets/meshes/interactables/pose_grab_ball_left.tres b/assets/meshes/interactables/pose_grab_ball_left.tres new file mode 100644 index 00000000..b7475a07 --- /dev/null +++ b/assets/meshes/interactables/pose_grab_ball_left.tres @@ -0,0 +1,10 @@ +[gd_resource type="Resource" load_steps=4 format=2] + +[ext_resource path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" type="Script" id=1] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 3.anim" type="Animation" id=2] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=3] + +[resource] +script = ExtResource( 1 ) +open_pose = ExtResource( 3 ) +closed_pose = ExtResource( 2 ) diff --git a/assets/meshes/interactables/pose_grab_ball_right.tres b/assets/meshes/interactables/pose_grab_ball_right.tres new file mode 100644 index 00000000..67614c0b --- /dev/null +++ b/assets/meshes/interactables/pose_grab_ball_right.tres @@ -0,0 +1,10 @@ +[gd_resource type="Resource" load_steps=4 format=2] + +[ext_resource path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" type="Script" id=1] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=2] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 3.anim" type="Animation" id=3] + +[resource] +script = ExtResource( 1 ) +open_pose = ExtResource( 2 ) +closed_pose = ExtResource( 3 ) diff --git a/assets/meshes/interactables/pose_grab_wheel_left.tres b/assets/meshes/interactables/pose_grab_wheel_left.tres new file mode 100644 index 00000000..f8c8a0ca --- /dev/null +++ b/assets/meshes/interactables/pose_grab_wheel_left.tres @@ -0,0 +1,10 @@ +[gd_resource type="Resource" load_steps=4 format=2] + +[ext_resource path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" type="Script" id=1] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 5.anim" type="Animation" id=2] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/left/Grip 2.anim" type="Animation" id=3] + +[resource] +script = ExtResource( 1 ) +open_pose = ExtResource( 2 ) +closed_pose = ExtResource( 3 ) diff --git a/assets/meshes/interactables/pose_grab_wheel_right.tres b/assets/meshes/interactables/pose_grab_wheel_right.tres new file mode 100644 index 00000000..cb9a64d9 --- /dev/null +++ b/assets/meshes/interactables/pose_grab_wheel_right.tres @@ -0,0 +1,10 @@ +[gd_resource type="Resource" load_steps=4 format=2] + +[ext_resource path="res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" type="Script" id=1] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 5.anim" type="Animation" id=2] +[ext_resource path="res://addons/godot-xr-tools/hands/animations/right/Grip 2.anim" type="Animation" id=3] + +[resource] +script = ExtResource( 1 ) +open_pose = ExtResource( 2 ) +closed_pose = ExtResource( 3 ) diff --git a/assets/meshes/interactables/push_button.tscn b/assets/meshes/interactables/push_button.tscn index 5bb685bb..d79c887b 100644 --- a/assets/meshes/interactables/push_button.tscn +++ b/assets/meshes/interactables/push_button.tscn @@ -1,11 +1,14 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=13 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_area_button.gd" type="Script" id=2] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=3] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_point_left.tres" type="Resource" id=4] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_point_right.tres" type="Resource" id=5] [sub_resource type="CylinderShape" id=1] -radius = 0.05 height = 0.05 +radius = 0.05 [sub_resource type="CylinderMesh" id=2] top_radius = 0.05 @@ -15,8 +18,8 @@ radial_segments = 16 rings = 0 [sub_resource type="CylinderShape" id=3] -radius = 0.04 height = 0.04 +radius = 0.04 [sub_resource type="CylinderMesh" id=4] top_radius = 0.04 @@ -29,8 +32,11 @@ rings = 0 albedo_color = Color( 1, 0, 0, 1 ) [sub_resource type="CylinderShape" id=6] -radius = 0.04 height = 0.05 +radius = 0.04 + +[sub_resource type="SphereShape" id=7] +radius = 0.05 [node name="PushButton" type="Spatial"] @@ -62,3 +68,11 @@ button = NodePath("../Button") [node name="CollisionShape" type="CollisionShape" parent="InteractableAreaButton"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.025, 0 ) shape = SubResource( 6 ) + +[node name="HandPoseArea" parent="." instance=ExtResource( 3 )] +left_pose = ExtResource( 4 ) +right_pose = ExtResource( 5 ) + +[node name="CollisionShape" type="CollisionShape" parent="HandPoseArea"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.0246354, 0 ) +shape = SubResource( 7 ) diff --git a/assets/meshes/interactables/slider_smooth.tscn b/assets/meshes/interactables/slider_smooth.tscn index 9f131fd2..39e2f25a 100644 --- a/assets/meshes/interactables/slider_smooth.tscn +++ b/assets/meshes/interactables/slider_smooth.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_slider.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.3, 0.05 ) @@ -30,6 +33,10 @@ rings = 8 margin = 0.12 radius = 0.06 +[sub_resource type="SphereShape" id=8] +margin = 0.12 +radius = 0.06 + [node name="SliderSmooth" type="Spatial"] [node name="Frame" type="StaticBody" parent="."] @@ -81,3 +88,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 8 ) diff --git a/assets/meshes/interactables/slider_snap.tscn b/assets/meshes/interactables/slider_snap.tscn index cc48b10a..876e2abc 100644 --- a/assets/meshes/interactables/slider_snap.tscn +++ b/assets/meshes/interactables/slider_snap.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_slider.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.3, 0.05 ) @@ -30,6 +33,10 @@ rings = 8 margin = 0.12 radius = 0.06 +[sub_resource type="SphereShape" id=8] +margin = 0.12 +radius = 0.06 + [node name="SliderSnap" type="Spatial"] [node name="Frame" type="StaticBody" parent="."] @@ -82,3 +89,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 8 ) diff --git a/assets/meshes/interactables/slider_zero.tscn b/assets/meshes/interactables/slider_zero.tscn index 833ebc6d..17710143 100644 --- a/assets/meshes/interactables/slider_zero.tscn +++ b/assets/meshes/interactables/slider_zero.tscn @@ -1,9 +1,12 @@ -[gd_scene load_steps=12 format=2] +[gd_scene load_steps=16 format=2] [ext_resource path="res://assets/wahooney.itch.io/blue_grid.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_slider.gd" type="Script" id=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=3] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=4] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_left.tres" type="Resource" id=6] +[ext_resource path="res://assets/meshes/interactables/pose_grab_ball_right.tres" type="Resource" id=7] [sub_resource type="BoxShape" id=1] extents = Vector3( 0.1, 0.3, 0.05 ) @@ -30,6 +33,10 @@ rings = 8 margin = 0.12 radius = 0.06 +[sub_resource type="SphereShape" id=8] +margin = 0.12 +radius = 0.06 + [node name="SliderZero" type="Spatial"] [node name="Frame" type="StaticBody" parent="."] @@ -82,3 +89,10 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle"] shape = SubResource( 7 ) + +[node name="HandPoseArea" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle" instance=ExtResource( 5 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 7 ) + +[node name="CollisionShape" type="CollisionShape" parent="SliderOrigin/InteractableSlider/HandleOrigin/InteractableHandle/HandPoseArea"] +shape = SubResource( 8 ) diff --git a/assets/meshes/interactables/wheel_smooth.tscn b/assets/meshes/interactables/wheel_smooth.tscn index deebbd8c..76dd67be 100644 --- a/assets/meshes/interactables/wheel_smooth.tscn +++ b/assets/meshes/interactables/wheel_smooth.tscn @@ -1,12 +1,15 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://assets/wahooney.itch.io/brown_grid_triplanar.tres" type="Material" id=1] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_hinge.gd" type="Script" id=2] [ext_resource path="res://addons/godot-xr-tools/interactables/interactable_handle.gd" type="Script" id=3] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=4] +[ext_resource path="res://assets/meshes/interactables/pose_grab_wheel_right.tres" type="Resource" id=5] +[ext_resource path="res://assets/meshes/interactables/pose_grab_wheel_left.tres" type="Resource" id=6] [sub_resource type="CylinderShape" id=1] -radius = 0.2 height = 0.02 +radius = 0.2 [sub_resource type="CylinderMesh" id=2] top_radius = 0.2 @@ -18,6 +21,10 @@ rings = 0 [sub_resource type="BoxShape" id=3] extents = Vector3( 0.01, 0.04, 0.05 ) +[sub_resource type="CylinderShape" id=4] +height = 0.04 +radius = 0.22 + [node name="WheelSmooth" type="Spatial"] [node name="HingeOrigin" type="Spatial" parent="."] @@ -142,3 +149,11 @@ reset_transform_on_pickup = false [node name="CollisionShape" type="CollisionShape" parent="HingeOrigin/InteractableHinge/Handle8/InteractableHandle"] shape = SubResource( 3 ) + +[node name="HandPoseArea" parent="HingeOrigin" instance=ExtResource( 4 )] +left_pose = ExtResource( 6 ) +right_pose = ExtResource( 5 ) + +[node name="CollisionShape" type="CollisionShape" parent="HingeOrigin/HandPoseArea"] +transform = Transform( -4.37114e-08, 1, 4.37114e-08, -1, -4.37114e-08, 4.37114e-08, 4.37114e-08, -4.37114e-08, 1, 0, 0, 0 ) +shape = SubResource( 4 ) diff --git a/project.godot b/project.godot index ddb2c7aa..62a25e7d 100644 --- a/project.godot +++ b/project.godot @@ -14,6 +14,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/godot-xr-tools/misc/arvr_helpers.gd" }, { +"base": "ARVROrigin", +"class": "FirstPersonControllerVR", +"language": "GDScript", +"path": "res://addons/godot-openxr/scenes/first_person_controller_vr.gd" +}, { "base": "Spatial", "class": "Teleport", "language": "GDScript", @@ -44,6 +49,11 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/godot-xr-tools/functions/function_pointer.gd" }, { +"base": "Spatial", +"class": "XRToolsFunctionPoseArea", +"language": "GDScript", +"path": "res://addons/godot-xr-tools/functions/function_pose_detector.gd" +}, { "base": "KinematicBody", "class": "XRToolsFunctionTeleport", "language": "GDScript", @@ -69,6 +79,16 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/godot-xr-tools/hands/hand_physics_bone.gd" }, { +"base": "Area", +"class": "XRToolsHandPoseArea", +"language": "GDScript", +"path": "res://addons/godot-xr-tools/objects/hand_pose_area.gd" +}, { +"base": "Resource", +"class": "XRToolsHandPoseSettings", +"language": "GDScript", +"path": "res://addons/godot-xr-tools/hands/poses/hand_pose_settings.gd" +}, { "base": "Node", "class": "XRToolsHighlightMaterial", "language": "GDScript", @@ -251,17 +271,21 @@ _global_script_classes=[ { } ] _global_script_class_icons={ "ARVRHelpers": "", +"FirstPersonControllerVR": "", "Teleport": "", "XRTools": "", "XRToolsClimbable": "res://addons/godot-xr-tools/editor/icons/hand.svg", "XRToolsFallDamage": "", "XRToolsFunctionPickup": "res://addons/godot-xr-tools/editor/icons/function.svg", "XRToolsFunctionPointer": "res://addons/godot-xr-tools/editor/icons/function.svg", +"XRToolsFunctionPoseArea": "res://addons/godot-xr-tools/editor/icons/hand.svg", "XRToolsFunctionTeleport": "res://addons/godot-xr-tools/editor/icons/function.svg", "XRToolsGroundPhysics": "", "XRToolsGroundPhysicsSettings": "", "XRToolsHand": "res://addons/godot-xr-tools/editor/icons/hand.svg", "XRToolsHandPhysicsBone": "", +"XRToolsHandPoseArea": "res://addons/godot-xr-tools/editor/icons/hand.svg", +"XRToolsHandPoseSettings": "res://addons/godot-xr-tools/editor/icons/hand.svg", "XRToolsHighlightMaterial": "", "XRToolsHighlightRing": "", "XRToolsHighlightVisible": "", @@ -331,6 +355,7 @@ common/drop_mouse_on_gui_input_disabled=true 3d_physics/layer_18="player_hand" 3d_physics/layer_20="player_body" 3d_physics/layer_21="pointable" +3d_physics/layer_22="pose_area" [physics] diff --git a/scenes/interactables_demo/interactables_demo.tscn b/scenes/interactables_demo/interactables_demo.tscn index fc9b7c09..4f76b6d8 100644 --- a/scenes/interactables_demo/interactables_demo.tscn +++ b/scenes/interactables_demo/interactables_demo.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=22 format=2] +[gd_scene load_steps=23 format=2] [ext_resource path="res://addons/godot-xr-tools/staging/scene_base.tscn" type="PackedScene" id=1] [ext_resource path="res://assets/maps/basic_map.tscn" type="PackedScene" id=2] @@ -21,33 +21,38 @@ [ext_resource path="res://assets/meshes/interactables/joystick_zero.tscn" type="PackedScene" id=19] [ext_resource path="res://assets/meshes/interactables/wheel_smooth.tscn" type="PackedScene" id=20] [ext_resource path="res://assets/meshes/interactables/push_button.tscn" type="PackedScene" id=21] +[ext_resource path="res://addons/godot-xr-tools/functions/function_pose_detector.tscn" type="PackedScene" id=22] [node name="InteractablesDemo" instance=ExtResource( 1 )] [node name="LeftPhysicsHand" parent="ARVROrigin/LeftHand" index="0" instance=ExtResource( 6 )] -[node name="MovementDirect" parent="ARVROrigin/LeftHand" index="1" instance=ExtResource( 8 )] +[node name="FunctionPoseDetector" parent="ARVROrigin/LeftHand" index="1" instance=ExtResource( 22 )] + +[node name="MovementDirect" parent="ARVROrigin/LeftHand" index="2" instance=ExtResource( 8 )] enabled = true order = 10 max_speed = 3.0 strafe = true -[node name="FunctionPickup" parent="ARVROrigin/LeftHand" index="2" instance=ExtResource( 7 )] +[node name="FunctionPickup" parent="ARVROrigin/LeftHand" index="3" instance=ExtResource( 7 )] grab_collision_mask = 262144 ranged_enable = false ranged_collision_mask = 0 [node name="RightPhysicsHand" parent="ARVROrigin/RightHand" index="0" instance=ExtResource( 11 )] -[node name="MovementDirect" parent="ARVROrigin/RightHand" index="1" instance=ExtResource( 8 )] +[node name="FunctionPoseDetector" parent="ARVROrigin/RightHand" index="1" instance=ExtResource( 22 )] + +[node name="MovementDirect" parent="ARVROrigin/RightHand" index="2" instance=ExtResource( 8 )] enabled = true order = 10 max_speed = 3.0 strafe = false -[node name="MovementTurn" parent="ARVROrigin/RightHand" index="2" instance=ExtResource( 10 )] +[node name="MovementTurn" parent="ARVROrigin/RightHand" index="3" instance=ExtResource( 10 )] -[node name="FunctionPickup" parent="ARVROrigin/RightHand" index="3" instance=ExtResource( 7 )] +[node name="FunctionPickup" parent="ARVROrigin/RightHand" index="4" instance=ExtResource( 7 )] grab_collision_mask = 262144 ranged_enable = false ranged_collision_mask = 0 diff --git a/scenes/main_menu/main_menu_level.tscn b/scenes/main_menu/main_menu_level.tscn index 3a393e43..4e1ccc92 100644 --- a/scenes/main_menu/main_menu_level.tscn +++ b/scenes/main_menu/main_menu_level.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=41 format=2] +[gd_scene load_steps=42 format=2] [ext_resource path="res://addons/godot-xr-tools/staging/scene_base.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/right_fullglove_low.tscn" type="PackedScene" id=2] @@ -28,6 +28,7 @@ [ext_resource path="res://scenes/main_menu/objects/settings_ui.tscn" type="PackedScene" id=26] [ext_resource path="res://addons/godot-xr-tools/player/poke/poke.tscn" type="PackedScene" id=27] [ext_resource path="res://addons/godot-xr-tools/hands/materials/labglove.material" type="Material" id=28] +[ext_resource path="res://addons/godot-xr-tools/functions/function_pose_detector.tscn" type="PackedScene" id=29] [sub_resource type="AnimationNodeAnimation" id=1] animation = "Grip" @@ -94,7 +95,6 @@ node_connections = [ "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "Trigger", [node name="MainMenuLevel" instance=ExtResource( 1 )] script = ExtResource( 23 ) -environment = null [node name="LeftHand" parent="ARVROrigin/LeftHand" index="0" instance=ExtResource( 3 )] @@ -108,7 +108,9 @@ transform = Transform( 1, -1.63913e-07, 2.98023e-08, 8.9407e-08, 1, 0, -2.98023e [node name="AnimationTree" parent="ARVROrigin/LeftHand/LeftHand" index="1"] tree_root = SubResource( 6 ) -[node name="MovementDirect" parent="ARVROrigin/LeftHand" index="1" instance=ExtResource( 6 )] +[node name="FunctionPoseDetector" parent="ARVROrigin/LeftHand" index="1" instance=ExtResource( 29 )] + +[node name="MovementDirect" parent="ARVROrigin/LeftHand" index="2" instance=ExtResource( 6 )] enabled = true order = 10 max_speed = 3.0 @@ -130,13 +132,15 @@ transform = Transform( 1, -1.63913e-07, 2.98023e-08, 8.9407e-08, 1, 0, -2.98023e [node name="AnimationTree" parent="ARVROrigin/RightHand/RightHand" index="1"] tree_root = SubResource( 12 ) -[node name="MovementDirect" parent="ARVROrigin/RightHand" index="1" instance=ExtResource( 6 )] +[node name="FunctionPoseDetector" parent="ARVROrigin/RightHand" index="1" instance=ExtResource( 29 )] + +[node name="MovementDirect" parent="ARVROrigin/RightHand" index="2" instance=ExtResource( 6 )] enabled = true order = 10 max_speed = 3.0 strafe = false -[node name="MovementTurn" parent="ARVROrigin/RightHand" index="2" instance=ExtResource( 5 )] +[node name="MovementTurn" parent="ARVROrigin/RightHand" index="3" instance=ExtResource( 5 )] [node name="PlayerBody" parent="ARVROrigin" index="3" instance=ExtResource( 8 )] diff --git a/scenes/main_menu/objects/settings_ui.tscn b/scenes/main_menu/objects/settings_ui.tscn index 908ce2ea..cac7cf33 100644 --- a/scenes/main_menu/objects/settings_ui.tscn +++ b/scenes/main_menu/objects/settings_ui.tscn @@ -1,8 +1,11 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://addons/godot-xr-tools/objects/viewport_2d_in_3d.tscn" type="PackedScene" id=1] [ext_resource path="res://scenes/main_menu/objects/settings_ui_content.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/main_menu/objects/settings_ui.gd" type="Script" id=3] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=4] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_point_left.tres" type="Resource" id=5] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_point_right.tres" type="Resource" id=6] [sub_resource type="CubeMesh" id=1] size = Vector3( 0.65, 0.525, 0.02 ) @@ -12,6 +15,9 @@ albedo_color = Color( 0.203922, 0.203922, 0.203922, 1 ) metallic = 0.35 roughness = 0.52 +[sub_resource type="BoxShape" id=3] +extents = Vector3( 0.325, 0.1, 0.25 ) + [node name="SettingsUI" type="Spatial"] script = ExtResource( 3 ) @@ -38,3 +44,12 @@ operation = 2 width = 0.5 height = 1.0 depth = 0.5 + +[node name="HandPoseArea" parent="." instance=ExtResource( 4 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.3, 0 ) +left_pose = ExtResource( 5 ) +right_pose = ExtResource( 6 ) + +[node name="CollisionShape" type="CollisionShape" parent="HandPoseArea"] +transform = Transform( 1, 0, 0, 0, 0.707107, -0.707107, 0, 0.707107, 0.707107, 0, 0, 0 ) +shape = SubResource( 3 ) diff --git a/scenes/poke_demo/poke_demo.tscn b/scenes/poke_demo/poke_demo.tscn index f8c9a6d1..d5a2a22b 100644 --- a/scenes/poke_demo/poke_demo.tscn +++ b/scenes/poke_demo/poke_demo.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=27 format=2] +[gd_scene load_steps=32 format=2] [ext_resource path="res://addons/godot-xr-tools/staging/scene_base.tscn" type="PackedScene" id=1] [ext_resource path="res://addons/godot-xr-tools/hands/scenes/lowpoly/left_hand_low.tscn" type="PackedScene" id=2] @@ -14,71 +14,78 @@ [ext_resource path="res://assets/meshes/table/table.tscn" type="PackedScene" id=12] [ext_resource path="res://scenes/pickable_demo/objects/grab_cube.tscn" type="PackedScene" id=13] [ext_resource path="res://addons/godot-xr-tools/functions/movement_turn.tscn" type="PackedScene" id=14] +[ext_resource path="res://addons/godot-xr-tools/objects/hand_pose_area.tscn" type="PackedScene" id=15] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_point_left.tres" type="Resource" id=16] +[ext_resource path="res://addons/godot-xr-tools/hands/poses/pose_point_right.tres" type="Resource" id=17] +[ext_resource path="res://addons/godot-xr-tools/functions/function_pose_detector.tscn" type="PackedScene" id=18] -[sub_resource type="AnimationNodeAnimation" id=1] +[sub_resource type="AnimationNodeAnimation" id=14] animation = "Grip" -[sub_resource type="AnimationNodeAnimation" id=2] +[sub_resource type="AnimationNodeAnimation" id=15] animation = "Grip" -[sub_resource type="AnimationNodeBlend2" id=3] +[sub_resource type="AnimationNodeBlend2" id=16] filter_enabled = true filters = [ "Armature/Skeleton:Little_Distal_L", "Armature/Skeleton:Little_Intermediate_L", "Armature/Skeleton:Little_Proximal_L", "Armature/Skeleton:Middle_Distal_L", "Armature/Skeleton:Middle_Intermediate_L", "Armature/Skeleton:Middle_Proximal_L", "Armature/Skeleton:Ring_Distal_L", "Armature/Skeleton:Ring_Intermediate_L", "Armature/Skeleton:Ring_Proximal_L", "Armature/Skeleton:Thumb_Distal_L", "Armature/Skeleton:Thumb_Proximal_L", "Armature_Left/Skeleton:Middle.Distal", "Armature_Left/Skeleton:Middle.Middle", "Armature_Left/Skeleton:Middle.Proximal", "Armature_Left/Skeleton:Pinky.Distal", "Armature_Left/Skeleton:Pinky.Middle", "Armature_Left/Skeleton:Pinky.Proximal", "Armature_Left/Skeleton:Ring.Distal", "Armature_Left/Skeleton:Ring.Middle", "Armature_Left/Skeleton:Ring.Proximal", "Armature_Left/Skeleton:Thumb.Distal", "Armature_Left/Skeleton:Thumb.Proximal" ] -[sub_resource type="AnimationNodeAnimation" id=4] +[sub_resource type="AnimationNodeAnimation" id=17] animation = "Grip 5" -[sub_resource type="AnimationNodeBlend2" id=5] +[sub_resource type="AnimationNodeBlend2" id=18] filter_enabled = true filters = [ "Armature/Skeleton:Index_Distal_L", "Armature/Skeleton:Index_Intermediate_L", "Armature/Skeleton:Index_Proximal_L", "Armature_Left/Skeleton:Index.Distal", "Armature_Left/Skeleton:Index.Middle", "Armature_Left/Skeleton:Index.Proximal" ] -[sub_resource type="AnimationNodeBlendTree" id=6] +[sub_resource type="AnimationNodeBlendTree" id=19] graph_offset = Vector2( -242.851, 19.7107 ) -nodes/ClosedHand1/node = SubResource( 1 ) +nodes/ClosedHand1/node = SubResource( 14 ) nodes/ClosedHand1/position = Vector2( -400, 200 ) -nodes/ClosedHand2/node = SubResource( 2 ) +nodes/ClosedHand2/node = SubResource( 15 ) nodes/ClosedHand2/position = Vector2( -200, 300 ) -nodes/Grip/node = SubResource( 3 ) +nodes/Grip/node = SubResource( 16 ) nodes/Grip/position = Vector2( 200, 0 ) -nodes/OpenHand/node = SubResource( 4 ) +nodes/OpenHand/node = SubResource( 17 ) nodes/OpenHand/position = Vector2( -400, 0 ) -nodes/Trigger/node = SubResource( 5 ) +nodes/Trigger/node = SubResource( 18 ) nodes/Trigger/position = Vector2( -160, 0 ) nodes/output/position = Vector2( 400, 0 ) node_connections = [ "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "output", 0, "Grip" ] -[sub_resource type="AnimationNodeAnimation" id=7] +[sub_resource type="AnimationNodeAnimation" id=20] animation = "Grip" -[sub_resource type="AnimationNodeAnimation" id=8] +[sub_resource type="AnimationNodeAnimation" id=21] animation = "Grip" -[sub_resource type="AnimationNodeBlend2" id=9] +[sub_resource type="AnimationNodeBlend2" id=22] filter_enabled = true filters = [ "Armature/Skeleton:Little_Distal_R", "Armature/Skeleton:Little_Intermediate_R", "Armature/Skeleton:Little_Proximal_R", "Armature/Skeleton:Middle_Distal_R", "Armature/Skeleton:Middle_Intermediate_R", "Armature/Skeleton:Middle_Proximal_R", "Armature/Skeleton:Ring_Distal_R", "Armature/Skeleton:Ring_Intermediate_R", "Armature/Skeleton:Ring_Proximal_R", "Armature/Skeleton:Thumb_Distal_R", "Armature/Skeleton:Thumb_Proximal_R", "Armature_Left/Skeleton:Middle.Distal", "Armature_Left/Skeleton:Middle.Middle", "Armature_Left/Skeleton:Middle.Proximal", "Armature_Left/Skeleton:Pinky.Distal", "Armature_Left/Skeleton:Pinky.Middle", "Armature_Left/Skeleton:Pinky.Proximal", "Armature_Left/Skeleton:Ring.Distal", "Armature_Left/Skeleton:Ring.Middle", "Armature_Left/Skeleton:Ring.Proximal", "Armature_Left/Skeleton:Thumb.Distal", "Armature_Left/Skeleton:Thumb.Proximal" ] -[sub_resource type="AnimationNodeAnimation" id=10] +[sub_resource type="AnimationNodeAnimation" id=23] animation = "Grip 5" -[sub_resource type="AnimationNodeBlend2" id=11] +[sub_resource type="AnimationNodeBlend2" id=24] filter_enabled = true filters = [ "Armature/Skeleton:Index_Distal_R", "Armature/Skeleton:Index_Intermediate_R", "Armature/Skeleton:Index_Proximal_R", "Armature_Left/Skeleton:Index.Distal", "Armature_Left/Skeleton:Index.Middle", "Armature_Left/Skeleton:Index.Proximal" ] -[sub_resource type="AnimationNodeBlendTree" id=12] +[sub_resource type="AnimationNodeBlendTree" id=25] graph_offset = Vector2( -239.618, 12.3058 ) -nodes/ClosedHand1/node = SubResource( 7 ) +nodes/ClosedHand1/node = SubResource( 20 ) nodes/ClosedHand1/position = Vector2( -400, 200 ) -nodes/ClosedHand2/node = SubResource( 8 ) +nodes/ClosedHand2/node = SubResource( 21 ) nodes/ClosedHand2/position = Vector2( -200, 300 ) -nodes/Grip/node = SubResource( 9 ) +nodes/Grip/node = SubResource( 22 ) nodes/Grip/position = Vector2( 200, 0 ) -nodes/OpenHand/node = SubResource( 10 ) +nodes/OpenHand/node = SubResource( 23 ) nodes/OpenHand/position = Vector2( -400, 0 ) -nodes/Trigger/node = SubResource( 11 ) +nodes/Trigger/node = SubResource( 24 ) nodes/Trigger/position = Vector2( -160, 0 ) nodes/output/position = Vector2( 400, 0 ) node_connections = [ "Grip", 0, "Trigger", "Grip", 1, "ClosedHand2", "Trigger", 0, "OpenHand", "Trigger", 1, "ClosedHand1", "output", 0, "Grip" ] +[sub_resource type="BoxShape" id=13] +extents = Vector3( 0.5, 0.25, 0.05 ) + [node name="PokeDemo" instance=ExtResource( 1 )] [node name="LeftHand" parent="ARVROrigin/LeftHand" index="0" instance=ExtResource( 2 )] @@ -94,7 +101,9 @@ bone_name = "Index_Tip_L" transform = Transform( 1, -1.49012e-07, 9.31323e-09, 1.49012e-07, 1, -7.45058e-09, 5.58794e-09, 1.86265e-08, 1, 0, 0, 0 ) [node name="AnimationTree" parent="ARVROrigin/LeftHand/LeftHand" index="1"] -tree_root = SubResource( 6 ) +tree_root = SubResource( 19 ) + +[node name="FunctionPoseDetector" parent="ARVROrigin/LeftHand" index="1" instance=ExtResource( 18 )] [node name="RightHand" parent="ARVROrigin/RightHand" index="0" instance=ExtResource( 3 )] @@ -109,15 +118,17 @@ bone_name = "Index_Tip_R" transform = Transform( 1, -1.63913e-07, 2.98023e-08, 8.9407e-08, 1, 0, -2.98023e-08, -2.98023e-08, 1, 0, 0, 0 ) [node name="AnimationTree" parent="ARVROrigin/RightHand/RightHand" index="1"] -tree_root = SubResource( 12 ) +tree_root = SubResource( 25 ) + +[node name="FunctionPoseDetector" parent="ARVROrigin/RightHand" index="1" instance=ExtResource( 18 )] -[node name="MovementDirect" parent="ARVROrigin/RightHand" index="1" instance=ExtResource( 11 )] +[node name="MovementDirect" parent="ARVROrigin/RightHand" index="2" instance=ExtResource( 11 )] enabled = true order = 10 max_speed = 5.0 strafe = false -[node name="MovementTurn" parent="ARVROrigin/RightHand" index="2" instance=ExtResource( 14 )] +[node name="MovementTurn" parent="ARVROrigin/RightHand" index="3" instance=ExtResource( 14 )] [node name="PlayerBody" parent="ARVROrigin" index="3" instance=ExtResource( 10 )] @@ -128,12 +139,21 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4 ) scene_base = NodePath("..") title = ExtResource( 6 ) -[node name="Viewport2Din3D" parent="." index="3" instance=ExtResource( 8 )] +[node name="PokeCanvas" type="Spatial" parent="." index="3"] transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.2, -1.581 ) + +[node name="Viewport2Din3D" parent="PokeCanvas" index="0" instance=ExtResource( 8 )] screen_size = Vector2( 1, 0.5 ) viewport_size = Vector2( 1000, 500 ) scene = ExtResource( 9 ) +[node name="HandPoseArea" parent="PokeCanvas" index="1" instance=ExtResource( 15 )] +left_pose = ExtResource( 16 ) +right_pose = ExtResource( 17 ) + +[node name="CollisionShape" type="CollisionShape" parent="PokeCanvas/HandPoseArea" index="0"] +shape = SubResource( 13 ) + [node name="Table" parent="." index="4" instance=ExtResource( 12 )] transform = Transform( 0.515726, 0, -0.856754, 0, 1, 0, 0.856754, 0, 0.515726, 2.37791, 0, -0.681984 )