diff --git a/Changelog.md b/Changelog.md index a71dacb..d58d29a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,8 @@ +# 0.7.8-alpha: +Bugfixes: +- Fix mp4 export on macOS +- Fix animations in imported clips not playing grouped object movements correctly + # 0.7.7-alpha: Bugfixes: - Fix pasting multiple times diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 59cf689..2117e94 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Lightningbeam", - "version": "0.7.7-alpha", + "version": "0.7.8-alpha", "identifier": "org.lightningbeam.core", "build": { "frontendDist": "../src" diff --git a/src/main.js b/src/main.js index 878a09d..0c696bc 100644 --- a/src/main.js +++ b/src/main.js @@ -2242,6 +2242,7 @@ class Layer extends Widget { json.children = []; let idMap = {} for (let child of this.children) { + // TODO: we may not need the randomizeUuid parameter anymore let childJson = child.toJSON(randomizeUuid) idMap[child.idx] = childJson.idx json.children.push(childJson); @@ -2253,7 +2254,7 @@ class Layer extends Widget { for (let key in frameJson.keys) { if (key in idMap) { frameJson.keys[idMap[key]] = frameJson.keys[key] - delete frameJson.keys[key] + // delete frameJson.keys[key] } } json.frames.push(frameJson); @@ -4364,11 +4365,11 @@ async function _save(path) { } return value; } - for (let action of undoStack) { - console.log(action.name); - } + // for (let action of undoStack) { + // console.log(action.name); + // } const fileData = { - version: "1.7", + version: "1.7.5", width: config.fileWidth, height: config.fileHeight, fps: config.framerate, @@ -4686,6 +4687,8 @@ async function importFile() { uuidCache[key] = uuidv4(); // Store the generated UUID for the value } obj[key] = uuidCache[key]; // Assign the UUID to the object property + } else if (value in uuidCache) { + obj[key] = value } } } @@ -4883,14 +4886,19 @@ function downloadObjectURL(url, filename) { URL.revokeObjectURL(url); } -function done(output) { - const url = URL.createObjectURL(output); - downloadObjectURL(url, "test.mp4") +async function done(output, path) { + await writeFile( + path, // The destination file path for saving + new Uint8Array(await output.arrayBuffer()), + ); + // const url = URL.createObjectURL(output); + // downloadObjectURL(url, "test.mp4") const modal = document.getElementById('progressModal'); modal.style.display = 'none'; + document.querySelector("body").style.cursor = "default"; } -async function exportMp4() { +async function exportMp4(path) { const worker = new Worker("/ffmpeg-worker-mp4.js") // const worker = new Worker("/ffmpeg-worker-webm.js") @@ -5041,7 +5049,7 @@ async function exportMp4() { type: "video/mp4" }); // Trigger the done callback with the final video blob - done(finalBlob); + done(finalBlob, path); return; } @@ -5100,7 +5108,7 @@ async function exportMp4() { type: "video/mp4" }); // Trigger the done callback with the final video blob - done(finalBlob); + done(finalBlob, path); break; case 'stderr': console.log(msg.data); @@ -5154,11 +5162,13 @@ async function exportMp4() { // exportMp4() async function render() { - exportMp4() - return document.querySelector("body").style.cursor = "wait"; const path = await saveFileDialog({ filters: [ + { + name: "MP4 files (.mp4)", + extensions: ["mp4"], + }, { name: "APNG files (.png)", extensions: ["png"], @@ -5168,7 +5178,7 @@ async function render() { extensions: ["html"], }, ], - defaultPath: await join(await documentDir(), "untitled.png"), + defaultPath: await join(await documentDir(), "untitled.mp4"), }); if (path != undefined) { // SVG balks on images @@ -5183,6 +5193,10 @@ async function render() { const ext = path.split(".").pop().toLowerCase(); switch (ext) { + case "mp4": + exportMp4(path) + return + break case "html": fetch("/player.html") .then((response) => {