Fix animations in imported clips not playing grouped object movements correctly

This commit is contained in:
Skyler Lehmkuhl 2025-01-14 02:09:55 -05:00
parent eceadb0a27
commit bbaac4ebc3
1 changed files with 7 additions and 4 deletions

View File

@ -2242,6 +2242,7 @@ class Layer extends Widget {
json.children = []; json.children = [];
let idMap = {} let idMap = {}
for (let child of this.children) { for (let child of this.children) {
// TODO: we may not need the randomizeUuid parameter anymore
let childJson = child.toJSON(randomizeUuid) let childJson = child.toJSON(randomizeUuid)
idMap[child.idx] = childJson.idx idMap[child.idx] = childJson.idx
json.children.push(childJson); json.children.push(childJson);
@ -2253,7 +2254,7 @@ class Layer extends Widget {
for (let key in frameJson.keys) { for (let key in frameJson.keys) {
if (key in idMap) { if (key in idMap) {
frameJson.keys[idMap[key]] = frameJson.keys[key] frameJson.keys[idMap[key]] = frameJson.keys[key]
delete frameJson.keys[key] // delete frameJson.keys[key]
} }
} }
json.frames.push(frameJson); json.frames.push(frameJson);
@ -4364,9 +4365,9 @@ async function _save(path) {
} }
return value; return value;
} }
for (let action of undoStack) { // for (let action of undoStack) {
console.log(action.name); // console.log(action.name);
} // }
const fileData = { const fileData = {
version: "1.7", version: "1.7",
width: config.fileWidth, width: config.fileWidth,
@ -4686,6 +4687,8 @@ async function importFile() {
uuidCache[key] = uuidv4(); // Store the generated UUID for the value uuidCache[key] = uuidv4(); // Store the generated UUID for the value
} }
obj[key] = uuidCache[key]; // Assign the UUID to the object property obj[key] = uuidCache[key]; // Assign the UUID to the object property
} else if (value in uuidCache) {
obj[key] = value
} }
} }
} }