File tree Expand file tree Collapse file tree 5 files changed +26
-3
lines changed Expand file tree Collapse file tree 5 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,10 @@ export class SceneSerializer {
338338 // Particles Systems
339339 serializationObject . particleSystems = [ ] ;
340340 for ( index = 0 ; index < scene . particleSystems . length ; index ++ ) {
341- serializationObject . particleSystems . push ( scene . particleSystems [ index ] . serialize ( false ) ) ;
341+ const particleSystem = scene . particleSystems [ index ] ;
342+ if ( ! particleSystem . doNotSerialize ) {
343+ serializationObject . particleSystems . push ( particleSystem . serialize ( false ) ) ;
344+ }
342345 }
343346
344347 // Post processes
Original file line number Diff line number Diff line change @@ -299,6 +299,11 @@ export interface IParticleSystem {
299299 */
300300 isNodeGenerated : boolean ;
301301
302+ /**
303+ * Specifies if the particle system should be serialized
304+ */
305+ doNotSerialize ?: boolean ;
306+
302307 /**
303308 * Gets the maximum number of particles active at the same time.
304309 * @returns The max number of active particles.
Original file line number Diff line number Diff line change @@ -109,6 +109,11 @@ export class GPUParticleSystem extends BaseParticleSystem implements IDisposable
109109 private _platform : IGPUParticleSystemPlatform ;
110110 private _rebuildingAfterContextLost = false ;
111111
112+ /**
113+ * Specifies if the particle system should be serialized
114+ */
115+ public doNotSerialize = false ;
116+
112117 /**
113118 * Gets a boolean indicating if the GPU particles can be rendered on current browser
114119 */
Original file line number Diff line number Diff line change @@ -82,6 +82,12 @@ export class ParticleSystem extends ThinParticleSystem {
8282 * The current active Sub-systems, this property is used by the root particle system only.
8383 */
8484 public activeSubSystems : Array < ParticleSystem > ;
85+
86+ /**
87+ * Specifies if the particle system should be serialized
88+ */
89+ public doNotSerialize = false ;
90+
8591 /**
8692 * Creates a Point Emitter for the particle system (emits directly from the emitter position)
8793 * @param direction1 Particles are emitted between the direction1 and direction2 from within the box
@@ -878,7 +884,9 @@ export class ParticleSystem extends ThinParticleSystem {
878884 for ( const subs of this . _subEmitters ) {
879885 const cell = [ ] ;
880886 for ( const sub of subs ) {
881- cell . push ( sub . serialize ( serializeTexture ) ) ;
887+ if ( ! sub . particleSystem . doNotSerialize ) {
888+ cell . push ( sub . serialize ( serializeTexture ) ) ;
889+ }
882890 }
883891
884892 serializationObject . subEmitters . push ( cell ) ;
Original file line number Diff line number Diff line change @@ -137,7 +137,9 @@ export class ParticleSystemSet implements IDisposable {
137137
138138 result . systems = [ ] ;
139139 for ( const system of this . systems ) {
140- result . systems . push ( system . serialize ( serializeTexture ) ) ;
140+ if ( ! system . doNotSerialize ) {
141+ result . systems . push ( system . serialize ( serializeTexture ) ) ;
142+ }
141143 }
142144
143145 if ( this . _emitterNode ) {
You can’t perform that action at this time.
0 commit comments