Skip to content

Commit

Permalink
fully converted mappings.py and config.py to json loaded equivalents
Browse files Browse the repository at this point in the history
mappings.py -> mappings.json
config.py -> config.json
  • Loading branch information
johnchoi313 committed Mar 14, 2024
1 parent ebbb1bc commit 45db19a
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 174 deletions.
1 change: 0 additions & 1 deletion examples/NPC_main_tools/ArenaDialogueBubbleGroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from asyncio import create_subprocess_exec

import string
import random

# ------------------------------------------ #
Expand Down
5 changes: 1 addition & 4 deletions examples/NPC_main_tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
jsonString = f.read()
configJson = json.loads(jsonString)


#QUICK HELPER FUNCTIONS TO CONVERT JSON -> ARENA-PY DATA TYPES
def ToPosition(json):
return Position(json["x"],json["y"],json["z"])
def ToRotation(json):
Expand All @@ -33,8 +33,6 @@ def ToScale(json):
def ToColor(json):
return Color(json["r"],json["g"],json["b"])



#GET DIALOGUE AND MAPPINGS FILENAMES
DIALOGUE_FILENAME = configJson["FILENAME"]["DIALOGUE"] #"robot_arena.json"
MAPPINGS_FILENAME = configJson["FILENAME"]["MAPPINGS"] #"mappings.json"
Expand All @@ -58,7 +56,6 @@ def ToColor(json):
USE_DEFAULT_MORPHS = configJson["USE_DEFAULTS"]["MORPHS"] #True
USE_DEFAULT_SOUNDS = configJson["USE_DEFAULTS"]["SOUNDS"] #True


#NO ACTIVITY RESET TIMER
RESET_INTERVAL = configJson["TIMERS"]["RESET"]["INTERVAL"] #100
RESET_TIME = configJson["TIMERS"]["RESET"]["TIME"] #5*60000 #x min of no activity resets interaction.
Expand Down
50 changes: 25 additions & 25 deletions examples/NPC_main_tools/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
"DEFAULTS": {

"SOUND": {
"NEXT": {"Sound":{"volume":1.0, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Next.wav" } },
"CHOICE": {"Sound":{"volume":1.0, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Choice.wav" } },
"ENTER": {"Sound":{"volume":0.8, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Enter.wav" } },
"EXIT": {"Sound":{"volume":0.8, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Exit.wav" } },
"IMAGE": {"Sound":{"volume":0.8, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Enter.wav" } },
"TALKING": {"Sound":{"volume":1.0, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Talking.wav" } },
"WALKING": {"Sound":{"volume":1.0, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Walking.wav" } }
"NEXT": {"volume":1.0, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Next.wav" },
"CHOICE": {"volume":1.0, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Choice.wav" },
"ENTER": {"volume":0.8, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Enter.wav" },
"EXIT": {"volume":0.8, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Exit.wav" },
"IMAGE": {"volume":0.8, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Enter.wav" },
"TALKING": {"volume":1.0, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Talking.wav" },
"WALKING": {"volume":1.0, "src":"https://arenaxr.org/store/users/johnchoi/Sounds/NPC/Walking.wav" }
},

"ANIMATION": {
"IDLE": { "ANIMATION": {"clip": "Idle", "loop": "repeat", "crossFadeDuration":0.5, "timeScale":1 } },
"WALK": { "ANIMATION": {"clip": "Walk", "loop": "repeat", "crossFadeDuration":0.5, "timeScale":1.5 } },
"TALK": { "ANIMATION": {"clip": "Lookaround", "loop": "repeat", "crossFadeDuration":0.5, "timeScale":1 } }
"IDLE": {"clip": "Idle", "loop": "repeat", "crossFadeDuration":0.5, "timeScale":1 },
"WALK": {"clip": "Walk", "loop": "repeat", "crossFadeDuration":0.5, "timeScale":1.5 },
"TALK": {"clip": "Lookaround", "loop": "repeat", "crossFadeDuration":0.5, "timeScale":1 }
},

"MORPH": {
"OPEN" : [ { "Morph":{"morphtarget":"a","value":1.0} } ],
"CLOSE" : [ { "Morph":{"morphtarget":"a","value":0.0} } ],
"BLINK_ON" : [ { "Morph":{"morphtarget":"Blink","value":1.0} } ],
"BLINK_OFF" : [ { "Morph":{"morphtarget":"Blink","value":0.0} } ],
"RESET" : [ { "Morph":{"morphtarget":"a","value":0.0}}, {"Morph":{"morphtarget":"Blink","value":0.0} } ]
"OPEN" : [ {"morphtarget":"a","value":1.0} ],
"CLOSE" : [ {"morphtarget":"a","value":0.0} ],
"BLINK_ON" : [ {"morphtarget":"Blink","value":1.0} ],
"BLINK_OFF" : [ {"morphtarget":"Blink","value":0.0} ],
"RESET" : [ {"morphtarget":"a","value":0.0}, {"morphtarget":"Blink","value":0.0} ]
},

"VIDEO_DEFAULT_VIDEO_FRAME_OBJECT": "https://arenaxr.org/store/users/wiselab/images/conix-face-white.jpg"
"VIDEO_FRAME_OBJECT": "https://arenaxr.org/store/users/wiselab/images/conix-face-white.jpg"

},

Expand Down Expand Up @@ -98,15 +98,15 @@
],

"VIDEO_MAPPINGS": [
{ "NAME": "1", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200707_ARENA - A Collaborative Mixed Reality Environment.mp4", "w":1920, "h": 1080} },
{ "NAME": "2", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Collaborative AR Authoring Tool Demo.mp4", "w":1920, "h": 1080} },
{ "NAME": "3", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Indoor Location Tracking Demo.mp4", "w":1920, "h": 1080} },
{ "NAME": "4", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Micro-UAV Swarm Control.mp4", "w":1920, "h": 1080} },
{ "NAME": "5", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA One Minute Madness.mp4", "w":1920, "h": 1080} },
{ "NAME": "6", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Physical Object Capture (Digital Twin).mp4", "w":1920, "h": 1080} },
{ "NAME": "7", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Real-Time Face Performance Capture.mp4", "w":1920, "h": 1080} },
{ "NAME": "8", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Robot's First Steps.mp4", "w":1920, "h": 1080} },
{ "NAME": "9", "VIDEO": {"url": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Virtual Robot Arm.mp4", "w":1920, "h": 1080} }
{ "NAME": "1", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200707_ARENA - A Collaborative Mixed Reality Environment.mp4", "w":1920, "h": 1080} },
{ "NAME": "2", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Collaborative AR Authoring Tool Demo.mp4", "w":1920, "h": 1080} },
{ "NAME": "3", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Indoor Location Tracking Demo.mp4", "w":1920, "h": 1080} },
{ "NAME": "4", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Micro-UAV Swarm Control.mp4", "w":1920, "h": 1080} },
{ "NAME": "5", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA One Minute Madness.mp4", "w":1920, "h": 1080} },
{ "NAME": "6", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Physical Object Capture (Digital Twin).mp4", "w":1920, "h": 1080} },
{ "NAME": "7", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Real-Time Face Performance Capture.mp4", "w":1920, "h": 1080} },
{ "NAME": "8", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Robot's First Steps.mp4", "w":1920, "h": 1080} },
{ "NAME": "9", "VIDEO": {"src": "https://arenaxr.org/store/users/johnchoi/Videos/ARENA/20200819_ARENA Virtual Robot Arm.mp4", "w":1920, "h": 1080} }
]

}
Loading

0 comments on commit 45db19a

Please sign in to comment.