Commit 5bd0578d authored by Chloé Paris's avatar Chloé Paris

added possibility to vary hand shapes in 3D

parent 6c1fcdfd
......@@ -2,7 +2,7 @@
[ext_resource path="res://scene-tree/sign/sign.tscn" type="PackedScene" id=1]
[node name="Main" type="Node" index="0"]
[node name="Main" type="Node"]
[node name="sign" parent="." index="0" instance=ExtResource( 1 )]
......
......@@ -64,6 +64,38 @@ letter=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":""
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":89,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
]
1-5=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":38,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":233,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":34,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":39,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":58,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":40,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":60,"unicode":0,"echo":false,"script":null)
]
cone=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":95,"unicode":0,"echo":false,"script":null)
]
rond=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":224,"unicode":0,"echo":false,"script":null)
]
"bec ferme"=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":45,"unicode":0,"echo":false,"script":null)
]
"bec ouvert"=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":232,"unicode":0,"echo":false,"script":null)
]
plie=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":231,"unicode":0,"echo":false,"script":null)
]
2letters=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":61,"unicode":0,"echo":false,"script":null)
]
A=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
]
E=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":69,"unicode":0,"echo":false,"script":null)
]
L=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":76,"unicode":0,"echo":false,"script":null)
]
U=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":85,"unicode":0,"echo":false,"script":null)
]
B=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":66,"unicode":0,"echo":false,"script":null)
]
G=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":71,"unicode":0,"echo":false,"script":null)
]
[rendering]
......
......@@ -2,7 +2,7 @@
[ext_resource path="res://resources/global-variables/signVar.gd" type="Script" id=1]
[node name="signVar" type="Node"]
[node name="signVar" type="Node" index="0"]
script = ExtResource( 1 )
......
......@@ -91,8 +91,21 @@ func _input(event):
if !DH_shape.ignore and !NDH_shape.ignore:
#if it is actually keyboard input and it was just pressed (avoid redundance)
if event.is_class("InputEventKey") and event.is_pressed() and not event.is_echo():
if event.is_action("2letters"):
if Input.is_action_pressed("A") and Input.is_action_pressed("E"):
get_node("Viewport/hand_model/AnimationPlayer").play("AE")
elif Input.is_action_pressed("B"):
print("b")
if Input.is_action_pressed("G"):
print("g")
get_node("Viewport/hand_model/AnimationPlayer").play("BG")
if Input.is_action_pressed("L"):
print("l")
get_node("Viewport/hand_model/AnimationPlayer").play("BL")
elif Input.is_action_pressed("L") and Input.is_action_pressed("U"):
get_node("Viewport/hand_model/AnimationPlayer").play("LU")
#if letter of alphabet -> want hand to display the shape of this letter
if event.is_action("letter"):
elif event.is_action("letter"):
# 'which' knows which hand needs to deal with the input
if which == 0:
# play letter
......@@ -102,6 +115,49 @@ func _input(event):
else:
get_node("Viewport2/hand_model/AnimationPlayer").play("Lettre-"+event.as_text())
signVar.NDHanimShape = event.as_text()
elif event.is_action("1-5"):
var fingers
match event.as_text():
"Ampersand":
fingers = 1
"é":
fingers = 2
"QuoteDbl":
fingers = 3
"Apostrophe":
fingers = 4
"ParenLeft":
fingers = 5
"Colon":
fingers = 0
"Less":
fingers = 50
if which == 0:
if Input.is_action_pressed("bec ferme"):
print("%d bec fermé" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("BF-%d" % fingers)
elif Input.is_action_pressed("bec ouvert"):
print("%d bec ouvert" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("BO-%d" % fingers)
elif Input.is_action_pressed("cone"):
print("%d cone" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("Cone-%d" % fingers)
elif Input.is_action_pressed("plie"):
print("%d plié" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("Plié-%d" % fingers)
elif Input.is_action_pressed("rond"):
print("%d rond" % fingers)
get_node("Viewport/hand_model/AnimationPlayer").play("Rond-%d" % fingers)
else:
print("%d normal" % fingers)
# play shape
get_node("Viewport/hand_model/AnimationPlayer").play("Chiffre-%d" % fingers)
# actually register the change
signVar.DHanimShape = "%d" % fingers
else:
print("main gauche")
get_node("Viewport2/hand_model/AnimationPlayer").play("Chiffre-%d" % fingers)
signVar.NDHanimShape = "%d" % fingers
# Tab lets the user change the focus from one hand to the other
elif event.is_action("ui_next"):
which = 1-which
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment