|
@@ -354,14 +354,14 @@ export const addSubtitle = (data: AnimationModelSubtitle) => {
|
|
|
// if (isRun) return;
|
|
|
// isRun = true
|
|
|
// setTimeout(() => {
|
|
|
- pixel.value = amMap[am.id]?.am?.getCurrentSubtitlePixel(size.value);
|
|
|
+ pixel.value = amMap[getAMKey(am)]?.am?.getCurrentSubtitlePixel(size.value);
|
|
|
// isRun = false
|
|
|
// }, 16);
|
|
|
};
|
|
|
|
|
|
const stopAttrib = mergeFuns(
|
|
|
watch(
|
|
|
- [currentTime, () => amMap[am.id]?.am, size, play, () => amMap[key]?.am],
|
|
|
+ [currentTime, () => amMap[getAMKey(am)]?.am, size, play, () => amMap[key]?.am],
|
|
|
(_a, _b, onCleanup) => {
|
|
|
if (
|
|
|
!play.value &&
|
|
@@ -502,14 +502,14 @@ export const associationAnimation = (sdk: SDK, el: HTMLDivElement) => {
|
|
|
watch(
|
|
|
() => {
|
|
|
const gAms = ams.value.filter(
|
|
|
- (am) => !am.frames.length && amMap[am.id]?.am
|
|
|
+ (am) => !am.frames.length && amMap[getAMKey(am)]?.am
|
|
|
);
|
|
|
return gAms;
|
|
|
},
|
|
|
(am3ds, oldAm3ds = []) => {
|
|
|
const { added, deleted } = diffArrayChange(am3ds, oldAm3ds);
|
|
|
for (const am of added) {
|
|
|
- const am3d = amMap[am.id];
|
|
|
+ const am3d = amMap[getAMKey(am)];
|
|
|
if (!am3d || !am3d.am) continue;
|
|
|
const frame = am3d.am!.addFrame({
|
|
|
id: uuid(),
|
|
@@ -518,7 +518,7 @@ export const associationAnimation = (sdk: SDK, el: HTMLDivElement) => {
|
|
|
time: 0,
|
|
|
});
|
|
|
am3d.globalFrame = frame;
|
|
|
- cleanupMap[am.id] = mergeFuns(
|
|
|
+ cleanupMap[getAMKey(am)] = mergeFuns(
|
|
|
watchEffect(() => {
|
|
|
am.mat && frame.setMat(am.mat);
|
|
|
console.log("set-global-frame", am.mat);
|
|
@@ -526,12 +526,12 @@ export const associationAnimation = (sdk: SDK, el: HTMLDivElement) => {
|
|
|
() => {
|
|
|
frame.destroy();
|
|
|
am3d.globalFrame = undefined;
|
|
|
- delete cleanupMap[am.id];
|
|
|
+ delete cleanupMap[getAMKey(am)];
|
|
|
}
|
|
|
);
|
|
|
}
|
|
|
for (const am of deleted) {
|
|
|
- cleanupMap[am.id] && cleanupMap[am.id]();
|
|
|
+ cleanupMap[getAMKey(am)] && cleanupMap[getAMKey(am)]();
|
|
|
}
|
|
|
},
|
|
|
{ flush: "post", immediate: true }
|