Skip to content

Commit

Permalink
2024 EEcamp init
Browse files Browse the repository at this point in the history
  • Loading branch information
Chalkman071 authored Jun 26, 2024
2 parents 890f66c + e031eda commit daee363
Show file tree
Hide file tree
Showing 33 changed files with 7,918 additions and 100,528 deletions.
577 changes: 308 additions & 269 deletions controller-server/configs/dancerTable.ts

Large diffs are not rendered by default.

613 changes: 9 additions & 604 deletions controller-server/configs/pinMapTable.ts

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions editor-blender/client/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async def read_query(
cache_data = self.cache.get(query_name)
try:
check_type(cache_data, response_type)
except:
except Exception:
traceback.print_exc()
return None

Expand All @@ -134,7 +134,7 @@ async def read_query(

async def write_query(self, data: Dict[str, Any]) -> None:
query_name, response = list(data.items())[0]
response_type = type(response)
response_type = type(response) # type: ignore

cache_data = self.cache.get(query_name)
if cache_data is not None and not isinstance(cache_data, response_type):
Expand Down
1 change: 0 additions & 1 deletion editor-blender/client/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from ..client import Clients, client
from ..client.cache import Modifiers
from ..core.actions.property.command import set_command_status
from ..core.actions.state.app_state import set_requesting
from ..core.actions.state.color_map import add_color, delete_color, update_color
from ..core.actions.state.command import read_board_info_payload, read_command_response
from ..core.actions.state.control_map import (
Expand Down
2 changes: 1 addition & 1 deletion editor-blender/core/actions/state/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async def login(username: str, password: str) -> None:
notify("INFO", "Login successful.")

else:
notify("ERROR", f"Login failed.")
notify("ERROR", "Login failed.")


async def logout() -> None:
Expand Down
12 changes: 6 additions & 6 deletions editor-blender/core/actions/state/control_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ async def add_control_frame():
set_requesting(True)
try:
await control_agent.add_frame(start, False, controlData)
notify("INFO", f"Added control frame")
except:
notify("INFO", "Added control frame")
except Exception:
traceback.print_exc()
notify("WARNING", "Cannot add control frame")

Expand Down Expand Up @@ -134,7 +134,7 @@ async def save_control_frame(start: Optional[int] = None):
set_requesting(True)
try:
await control_agent.save_frame(id, controlData, fade=fade, start=start)
notify("INFO", f"Saved control frame")
notify("INFO", "Saved control frame")

# Cancel editing
ok = await control_agent.cancel_edit(id)
Expand All @@ -152,7 +152,7 @@ async def save_control_frame(start: Optional[int] = None):
redraw_area({"VIEW_3D", "DOPESHEET_EDITOR"})
else:
notify("WARNING", "Cannot exit editing")
except:
except Exception:
traceback.print_exc()
notify("WARNING", "Cannot save control frame")

Expand All @@ -167,7 +167,7 @@ async def delete_control_frame():
try:
await control_agent.delete_frame(id)
notify("INFO", f"Deleted control frame: {id}")
except:
except Exception:
traceback.print_exc()
notify("WARNING", "Cannot delete control frame")

Expand Down Expand Up @@ -234,7 +234,7 @@ async def cancel_edit_control():
else:
notify("WARNING", "Cannot cancel edit")

except:
except Exception:
traceback.print_exc()
notify("WARNING", "Cannot cancel edit")

Expand Down
3 changes: 0 additions & 3 deletions editor-blender/core/actions/state/control_map.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import List, Tuple

from ...models import ControlMap, ControlMapElement, ControlRecord, EditMode, MapID
from ...states import state
from ...utils.convert import control_modify_to_animation_data
Expand All @@ -9,7 +7,6 @@
modify_partial_ctrl_keyframes,
reset_control_frames_and_fade_sequence,
reset_ctrl_rev,
update_control_frames_and_fade_sequence,
)
from .current_status import calculate_current_status_index

Expand Down
2 changes: 1 addition & 1 deletion editor-blender/core/actions/state/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
PartType,
PartTypeMap,
)
from ...states import state
from ...utils.convert import frame_to_time
from ...utils.operator import execute_operator
from ..state.load import init_assets, load_data
Expand Down Expand Up @@ -197,6 +196,7 @@ async def init_editor():
[init_pos_map, init_control_map],
[init_assets],
]
...
batches_completes = [[False] * len(batch) for batch in batches_functions]

while True:
Expand Down
6 changes: 3 additions & 3 deletions editor-blender/core/actions/state/led_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def save_led_effect():
exit_editing_led_effect()
else:
notify("WARNING", "Cannot exit editing")
except:
except Exception:
traceback.print_exc()
notify("WARNING", "Cannot save LED effect")

Expand Down Expand Up @@ -136,7 +136,7 @@ async def save_led_effect():
)
else:
notify("WARNING", "Cannot add LED effect")
except:
except Exception:
traceback.print_exc()
notify("WARNING", "Cannot add LED effect")

Expand All @@ -157,7 +157,7 @@ async def delete_led_effect():
notify("INFO", f"Deleted LED effect: {led_index}")
else:
notify("WARNING", "Cannot delete LED effect")
except:
except Exception:
traceback.print_exc()
notify("WARNING", "Cannot delete LED effect")

Expand Down
2 changes: 2 additions & 0 deletions editor-blender/core/actions/state/load/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def setup_display():
"""
Setup layout
"""
# TODO: Fixed layout
# split_area(screen, "VIEW_3D", "HORIZONTAL", 0.3)
# timeline_area = get_area(screen, "VIEW_3D", "y", 0)
# if timeline_area is None:
Expand Down Expand Up @@ -110,6 +111,7 @@ def setup_display():
space.shading.background_color = (0, 0, 0)
space.shading.color_type = "OBJECT"
space.shading.light = "FLAT"
space.shading.show_object_outline = False
# space.shading.light = "STUDIO"
# space.shading.studio_light = "paint.sl"

Expand Down
6 changes: 4 additions & 2 deletions editor-blender/core/utils/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ def outliner_hide_one_level():
for area in bpy.context.screen.areas: # type: ignore
if area.type == "OUTLINER": # type: ignore
region = area.regions[0] # type: ignore
override = bpy.context.copy()
override = bpy.context.copy() # type: ignore
override["area"] = area # type: ignore
override["region"] = region # type: ignore
with bpy.context.temp_override(**override): # type: ignore
bpy.ops.outliner.show_one_level(open=False)
# FIXME: Broken at 4.1, to be checked if this alternative is working
if bpy.ops.outliner.show_one_level.poll(): # type: ignore
bpy.ops.outliner.show_one_level(open=False)
2 changes: 2 additions & 0 deletions editor-blender/operators/async_core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def tick_loop() -> bool:


class AsyncLoopModalOperator(bpy.types.Operator):
"""Starts the async loop of editor"""

bl_idname = "lightdance.async_loop"
bl_label = "Runs the asyncio main loop"

Expand Down
2 changes: 1 addition & 1 deletion editor-blender/panels/control_editor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def draw(self, context: bpy.types.Context):
context.object,
"ld_effect",
text="Effect",
icon="LIGHTPROBE_GRID",
icon="LIGHTPROBE_VOLUME",
)
column.prop(context.object, "ld_alpha", text="Alpha", slider=True)

Expand Down
2 changes: 1 addition & 1 deletion editor-blender/panels/editor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def draw(self, context: bpy.types.Context):
"lightdance.toggle_led_editor",
text="LED",
depress=state.editor == Editor.LED_EDITOR,
icon="LIGHTPROBE_GRID",
icon="LIGHTPROBE_VOLUME",
)

box = layout.box()
Expand Down
4 changes: 2 additions & 2 deletions editor-blender/properties/ui/led_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ class LEDEditorStatus(bpy.types.PropertyGroup):
)
edit_effect: bpy.props.EnumProperty( # type: ignore
items=get_effect_lists,
default=-1, # pyright: ignore
default=-1, # pyright: ignore
update=update_edit_effect,
get=get_edit_effect,
set=set_edit_effect,
set=set_edit_effect,
)
new_effect: bpy.props.StringProperty(default="New effect") # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion editor-blender/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
fake-bpy-module-4.0
fake-bpy-module-4.1
gql[all]
dataclass_wizard
aiohttp
Expand Down
Binary file removed files/asset/models/0_xn.glb
Binary file not shown.
Binary file removed files/asset/models/10_chris.glb
Binary file not shown.
Binary file removed files/asset/models/11_temple.glb
Binary file not shown.
Binary file removed files/asset/models/12_bridge.glb
Binary file not shown.
Binary file removed files/asset/models/13_nian.glb
Binary file not shown.
Binary file removed files/asset/models/14_sword.glb
Binary file not shown.
Binary file removed files/asset/models/15_guandao.glb
Binary file not shown.
Binary file removed files/asset/models/16_effectboard.glb
Binary file not shown.
Binary file removed files/asset/models/2_sssam.glb
Binary file not shown.
Binary file removed files/asset/models/3_crc.glb
Binary file not shown.
Binary file removed files/asset/models/5_cs.glb
Binary file not shown.
Binary file removed files/asset/models/6_rakec.glb
Binary file not shown.
Binary file removed files/asset/models/7_jya.glb
Binary file not shown.
Binary file removed files/asset/models/8_circle.glb
Binary file not shown.
62 changes: 3 additions & 59 deletions files/data/load.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,17 @@
"LightPresets": "/data/default_lightPresets.json",
"PosPresets": "/data/default_posPresets.json",
"DancerMap": {
"0_xn": {
"url": "/asset/models/0_xn.glb",
"modelName": "0_xn"
},
"1_yck": {
"0_hjko": {
"url": "/asset/models/1_yck.glb",
"modelName": "1_yck"
},
"2_sssam": {
"url": "/asset/models/2_sssam.glb",
"modelName": "2_sssam"
},
"3_crc": {
"url": "/asset/models/3_crc.glb",
"modelName": "3_crc"
},
"4_arthur": {
"1_sauby": {
"url": "/asset/models/4_arthur.glb",
"modelName": "4_arthur"
},
"5_cs": {
"url": "/asset/models/5_cs.glb",
"modelName": "5_cs"
},
"6_rakec": {
"url": "/asset/models/6_rakec.glb",
"modelName": "6_rakec"
},
"7_jya": {
"url": "/asset/models/7_jya.glb",
"modelName": "7_jya"
},
"8_circle": {
"url": "/asset/models/8_circle.glb",
"modelName": "8_circle"
},
"9_ricky": {
"2_adam": {
"url": "/asset/models/9_ricky.glb",
"modelName": "9_ricky"
},
"10_chris": {
"url": "/asset/models/10_chris.glb",
"modelName": "10_chris"
},
"11_temple": {
"url": "/asset/models/11_temple.glb",
"modelName": "11_temple"
},
"12_bridge": {
"url": "/asset/models/12_bridge.glb",
"modelName": "12_bridge"
},
"13_nian": {
"url": "/asset/models/13_nian.glb",
"modelName": "13_nian"
},
"14_sword": {
"url": "/asset/models/14_sword.glb",
"modelName": "14_sword"
},
"15_guandao": {
"url": "/asset/models/15_guandao.glb",
"modelName": "15_guandao"
},
"16_effectboard": {
"url": "/asset/models/16_effectboard.glb",
"modelName": "16_effectboard"
}
},
"Config": {
Expand Down
48 changes: 3 additions & 45 deletions files/data/load_hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,14 @@
"LightPresets": "37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570",
"PosPresets": "37517e5f3dc66819f61f5a7bb8ace1921282415f10551d2defa5c3eb0985b570",
"DancerMap": {
"0_xn": {
"url": "c0c2709ac84a337604bd021724e47ae6192dd0258a5e235089824487c2e1390a"
},
"1_yck": {
"0_hjko": {
"url": "eff6166277a0f66d42f909fc7614d96d3448ae789c669e1b6d666fb4b1df53bc"
},
"2_sssam": {
"url": "ab73db0e857326e6fc7aec368f8cc96a9915e3e190f5ce482a340bca2331a55e"
},
"3_crc": {
"url": "6083492d4b0293beb66986898968997518489e5dbcf0d0cf01ffb2364c26049f"
},
"4_arthur": {
"1_sauby": {
"url": "7540b49cb38daa6c44ac1f5704da199af6eb85f457d61935791731c1beb28c1f"
},
"5_cs": {
"url": "326a13dfd799fe16c1ef39a364ae3a682f70999b72d13a1559f70fea4f7e0d7d"
},
"6_rakec": {
"url": "3472dc9784f89f0f2dddf636af1395d8212975bfa554ffca925852ccab95423e"
},
"7_jya": {
"url": "0ff7181cfb6627e96bede36866447232566d4effc3847f2a049920d70f2064cd"
},
"8_circle": {
"url": "690207b4a59ec443256ae1ab967dc597314c7f06756c926c879c3463feea0380"
},
"9_ricky": {
"2_adam": {
"url": "d43a2a813edf6c31c16e12aef6a38618a68ab3264c007c2969990df347818917"
},
"10_chris": {
"url": "a0f0cda144bf66b79fd21125c1e3eed2430ca52302faba5db7a4de1b0bcd1555"
},
"11_temple": {
"url": "6a2ab4a71a65ce1277a9b371f6fafe6e426f3ff83ac44bbe597d3bf82c0984c4"
},
"12_bridge": {
"url": "80716e9cf95abb32a797efb74a964c0484509da011ee2476dd81f94e5dc69837"
},
"13_nian": {
"url": "9f6724b2ae55b4a48d0e6e46662b27b0beff9d8c050be73c456e6dd48ec66ac8"
},
"14_sword": {
"url": "d4da1b8efc175cdda79b17ed1011023b1b9c7bafc63f892cf2bb0731e251d218"
},
"15_guandao": {
"url": "038a69d52a1a8c8e642182b2d9b491a943da3de8519fa8796698c00f5a1931f8"
},
"16_effectboard": {
"url": "992004772c8deb63a93a9429f5da8f93a29bad4d7a9a7d68d845e3bd27654774"
}
}
}
Loading

0 comments on commit daee363

Please sign in to comment.