feat: move_camera.txt 支持 all 关键词表示全程执行
在帧位置写 all 表示该段对所有帧生效: all vx=0.1 ry=0.5 # 全程缓慢平移 + 旋转 等同于 start=0, end=INF,与普通区间段一样支持时间交叠。
This commit is contained in:
+8
-5
@@ -108,11 +108,14 @@ def _load_camera_motion(path):
|
||||
line = line.strip()
|
||||
if not line or line.startswith("#"):
|
||||
continue
|
||||
# 解析帧范围
|
||||
m = re.match(r'(\d+)\s*-\s*(\d+)', line)
|
||||
if not m:
|
||||
continue
|
||||
start, end = int(m.group(1)), int(m.group(2))
|
||||
# 解析帧范围:支持 "all"(全程)或 "N-M"(区间)
|
||||
if line.lower().startswith("all") or re.match(r'^\s*all\s', line, re.IGNORECASE):
|
||||
start, end = 0, 10**9
|
||||
else:
|
||||
m = re.match(r'(\d+)\s*-\s*(\d+)', line)
|
||||
if not m:
|
||||
continue
|
||||
start, end = int(m.group(1)), int(m.group(2))
|
||||
v = [0.0, 0.0, 0.0]
|
||||
r = [0.0, 0.0, 0.0]
|
||||
# 解析 vx=, vy=, vz=
|
||||
|
||||
Reference in New Issue
Block a user