Skip to content

Commit

Permalink
Merge pull request #27 from galacean/fix/3d-pre
Browse files Browse the repository at this point in the history
fix: solve pre composition problem in 3D plugin
  • Loading branch information
yiiqii authored Dec 7, 2023
2 parents aae672e + 3985d94 commit 02c949b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions plugin-packages/model/src/utility/plugin-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -760,16 +760,20 @@ export class PluginHelper {
return;
}

let compIndex = 0;
const jsonScene = scene.jsonScene;
const { jsonScene } = scene;
const compIndexSet: Set<number> = new Set();

if (jsonScene.compositionId === undefined) {
compIndexSet.add(0);
}

jsonScene.compositions.forEach((comp, index) => {
if (comp.id === jsonScene.compositionId) {
compIndex = index;
if (comp.id === jsonScene.compositionId || composition.refCompositionProps.has(comp.id)) {
compIndexSet.add(index);
}
});

if (compIndex >= 0 && compIndex < jsonScene.compositions.length) {
compIndexSet.forEach(compIndex => {
const sceneComp = jsonScene.compositions[compIndex];

sceneComp.items.forEach((item, itemId) => {
Expand Down Expand Up @@ -863,7 +867,7 @@ export class PluginHelper {
}
}
});
}
});

}

Expand Down

0 comments on commit 02c949b

Please sign in to comment.