regex fix

This commit is contained in:
bk_office
2026-04-27 19:46:10 +08:00
parent d80d8d91c2
commit cf52ea683b
9 changed files with 174 additions and 72 deletions

View File

@ -15,6 +15,7 @@ class Scene:
cmd_queue = CommandParser(raw_cmd)
cmd_obj = next(cmd_queue)
obj_id, obj_args = cmd_obj.id, cmd_obj.args
logger.info(f"parsing object: {obj_id} with args {obj_args}")
obj_instance: Optional[Object] = None
if obj_id in OBJECT_ENTRIES:
obj_cls = OBJECT_ENTRIES[obj_id]
@ -30,10 +31,11 @@ class Scene:
) from e
else:
raise Exception(f"{obj_id} is not a valid object type.")
logger.info(f"parsed object {obj_id}({obj_args})")
if obj_instance != None:
for cmd in cmd_queue:
op_id, op_args = cmd.id, cmd.args
logger.info(f"parsing operation {op_id} with args {op_args}")
if op_id in OPERATION_ENTRIES:
op_func = OPERATION_ENTRIES[op_id]
if not callable(op_func):
@ -41,11 +43,14 @@ class Scene:
op_func(obj_instance, op_args)
else:
raise Exception(f"{op_id} is not a valid operation.")
logger.info(f"parsed operation {op_id}({op_args})")
try:
sdf_block = obj_instance.sdf_block_glsl()
self.canvas_objs.append((obj_instance, sdf_block))
logger.info(f"parsed sdf {sdf_block}")
except:
logger.info(f"parsed camera")
if type(obj_instance) == Camera:
self.camera = obj_instance