@@ -9,14 +9,14 @@ import { Editor } from "../../editor/main";
99
1010import { isSceneLinkNode } from "../../tools/guards/scene" ;
1111import { applyAssetsCache } from "../../tools/assets/cache" ;
12- import { isFromSceneLink } from "../../tools/scene/scene-link" ;
1312import { isNodeVisibleInGraph } from "../../tools/node/metadata" ;
1413import { getBufferSceneScreenshot } from "../../tools/scene/screenshot" ;
1514import { createDirectoryIfNotExist , normalizedGlob } from "../../tools/fs" ;
1615import { isSpriteManagerNode , isSpriteMapNode } from "../../tools/guards/sprites" ;
1716import { isGPUParticleSystem , isParticleSystem } from "../../tools/guards/particles" ;
1817import { serializePhysicsAggregate } from "../../tools/physics/serialization/aggregate" ;
19- import { isCollisionMesh , isEditorCamera , isMesh , isTransformNode } from "../../tools/guards/nodes" ;
18+ import { isAnimationGroupFromSceneLink , isFromSceneLink } from "../../tools/scene/scene-link" ;
19+ import { isAnyTransformNode , isCollisionMesh , isEditorCamera , isMesh , isTransformNode } from "../../tools/guards/nodes" ;
2020
2121import { vlsPostProcessCameraConfigurations } from "../../editor/rendering/vls" ;
2222import { saveRenderingConfigurationForCamera } from "../../editor/rendering/tools" ;
@@ -308,7 +308,7 @@ export async function saveScene(editor: Editor, projectPath: string, scenePath:
308308 // Write transform nodes
309309 await Promise . all (
310310 scene . transformNodes . map ( async ( transformNode ) => {
311- if ( ! isTransformNode ( transformNode ) ) {
311+ if ( ! isTransformNode ( transformNode ) || isFromSceneLink ( transformNode ) ) {
312312 return ;
313313 }
314314
@@ -513,6 +513,11 @@ export async function saveScene(editor: Editor, projectPath: string, scenePath:
513513 scene . particleSystems . map ( async ( particleSystem ) => {
514514 const particleSystemPath = join ( scenePath , "particleSystems" , `${ particleSystem . id } .json` ) ;
515515
516+ const emitter = particleSystem . emitter ;
517+ if ( emitter && isAnyTransformNode ( emitter ) && isFromSceneLink ( emitter ) ) {
518+ return ;
519+ }
520+
516521 try {
517522 const data = particleSystem . serialize ( true ) ;
518523
@@ -537,6 +542,10 @@ export async function saveScene(editor: Editor, projectPath: string, scenePath:
537542 // Write animation groups
538543 await Promise . all (
539544 scene . animationGroups ?. map ( async ( animationGroup ) => {
545+ if ( isAnimationGroupFromSceneLink ( animationGroup ) ) {
546+ return ;
547+ }
548+
540549 const animationGroupPath = join ( scenePath , "animationGroups" , `${ filenamify ( animationGroup . name ) } _${ animationGroup . uniqueId } .json` ) ;
541550
542551 try {
@@ -555,7 +564,7 @@ export async function saveScene(editor: Editor, projectPath: string, scenePath:
555564 // Write sprite maps
556565 await Promise . all (
557566 scene . transformNodes . map ( async ( transformNode ) => {
558- if ( ! isSpriteMapNode ( transformNode ) ) {
567+ if ( ! isSpriteMapNode ( transformNode ) || isFromSceneLink ( transformNode ) ) {
559568 return ;
560569 }
561570
@@ -583,7 +592,7 @@ export async function saveScene(editor: Editor, projectPath: string, scenePath:
583592 // Write sprite managers
584593 await Promise . all (
585594 scene . transformNodes . map ( async ( transformNode ) => {
586- if ( ! isSpriteManagerNode ( transformNode ) ) {
595+ if ( ! isSpriteManagerNode ( transformNode ) || isFromSceneLink ( transformNode ) ) {
587596 return ;
588597 }
589598
0 commit comments