| @@ -42,8 +42,8 @@ qui passe avec son propre son. `gain_db` d'un clip de l'A-roll : son volume (abs |
| 42 | pour un média de la bibliothèque commune (copié dans le projet à l'enregistrement). | 42 | pour un média de la bibliothèque commune (copié dans le projet à l'enregistrement). |
| 43 | """ | 43 | """ |
| 44 | import hashlib | 44 | import hashlib |
| 45 | -import json | | |
| 46 | import html | 45 | import html |
| | 46 | +import json |
| 47 | import os | 47 | import os |
| 48 | import re | 48 | import re |
| 49 | import shutil | 49 | import shutil |
| @@ -64,9 +64,9 @@ TIMELINE_FILE = "timeline.json" |
| 64 | INSERTIONS_FILE = "insertions.json" | 64 | INSERTIONS_FILE = "insertions.json" |
| 65 | MOTION_DIR = "motion" | 65 | MOTION_DIR = "motion" |
| 66 | RENDERS_DIR = "renders" | 66 | RENDERS_DIR = "renders" |
| 67 | -HISTORY_DIR = ".history" | | |
| 68 | # les médias posés dans les compositions, copiés à côté d'elles (le rendu ne lit que montage/motion/) | 67 | # les médias posés dans les compositions, copiés à côté d'elles (le rendu ne lit que montage/motion/) |
| 69 | MEDIA_DIR = "media" | 68 | MEDIA_DIR = "media" |
| | 69 | +HISTORY_DIR = ".history" |
| 70 | CACHE_DIR = ".cache" | 70 | CACHE_DIR = ".cache" |
| 71 | HISTORY_MAX = 60 | 71 | HISTORY_MAX = 60 |
| 72 | # les copies de travail de Daryl, une par demande en cours (daryl/<demande>/) ; dans chacune, WORK_BASE : la timeline | 72 | # les copies de travail de Daryl, une par demande en cours (daryl/<demande>/) ; dans chacune, WORK_BASE : la timeline |
| @@ -785,9 +785,6 @@ def after_change(pid: str) -> None: |
| 785 | | 785 | |
| 786 | # --- Motion design : rendu des compositions en .mov avec transparence ------------------------ | 786 | # --- Motion design : rendu des compositions en .mov avec transparence ------------------------ |
| 787 | | 787 | |
| 788 | -def motion_signature(pid: str, item: dict) -> str | None: | | |
| 789 | - comp = motion_dir(pid) / f"{item['id']}.html" | | |
| 790 | - if not comp.is_file(): | | |
| 791 | # un média posé dans une composition : <video src="media/m3-x.mp4" data-from="library/broll/x.mp4"> | 788 | # un média posé dans une composition : <video src="media/m3-x.mp4" data-from="library/broll/x.mp4"> |
| 792 | _MEDIA_TAG = re.compile(r"<(?:video|img|audio|source)\b[^>]*>", re.I) | 789 | _MEDIA_TAG = re.compile(r"<(?:video|img|audio|source)\b[^>]*>", re.I) |
| 793 | | 790 | |
| @@ -830,6 +827,9 @@ def bring_media(pid: str, comp: str) -> list[str]: |
| 830 | return missing | 827 | return missing |
| 831 | | 828 | |
| 832 | | 829 | |
| | 830 | +def motion_signature(pid: str, item: dict) -> str | None: |
| | 831 | + comp = motion_dir(pid) / f"{item['id']}.html" |
| | 832 | + if not comp.is_file(): |
| 833 | return None | 833 | return None |
| 834 | body = comp.read_bytes() + json.dumps([item["dur"]]).encode() | 834 | body = comp.read_bytes() + json.dumps([item["dur"]]).encode() |
| 835 | style = motion_dir(pid) / "style.css" | 835 | style = motion_dir(pid) / "style.css" |