@luminocity/lemonate-engine 26.6.3 → 26.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Engine.d.ts CHANGED
@@ -108,6 +108,7 @@ export declare class Engine {
108
108
  activeSceneGraphCollection: SceneGraphCollection;
109
109
  private _reactiveCallback?;
110
110
  private _externalEmitFunc?;
111
+ private _loadBaselineEstablished;
111
112
  private readonly _onItemRepoListEntryAdded;
112
113
  private readonly _onItemRepoListEntryDeleted;
113
114
  private readonly _onItemRepoFieldChanged;
@@ -150,6 +151,7 @@ export declare class Engine {
150
151
  setReactiveCallback(callback: Function): void;
151
152
  _makeReactive(obj: any): any;
152
153
  saveChanges(): Promise<void>;
154
+ _establishLoadBaseline(): void;
153
155
  getInfo(): {
154
156
  capabilities: import("three").WebGLCapabilities;
155
157
  extensions: import("three").WebGLExtensions;
@@ -11447,7 +11447,7 @@ class Item extends EventEmitter {
11447
11447
  }
11448
11448
  }
11449
11449
 
11450
- var engine$1 = "26.6.3";
11450
+ var engine$1 = "26.6.5";
11451
11451
  var bullet = "3.26";
11452
11452
  var lua = "5.4.3";
11453
11453
  var packageVersionInfo = {
@@ -68131,7 +68131,7 @@ class RenderView {
68131
68131
  // ----------------------------------------------------------------------------------
68132
68132
  if (!renderPassInfo.playerIsPaused) {
68133
68133
  if (doPhysics) {
68134
- this.engine.profiler.measure("Physics", "processUpdate", async () => {
68134
+ await this.engine.profiler.measureAsync("Physics", "processUpdate", async () => {
68135
68135
  this.engine.physics.processPhysicsUpdate();
68136
68136
  });
68137
68137
  }
@@ -68181,7 +68181,7 @@ class RenderView {
68181
68181
  // Animate scene
68182
68182
  // ----------------------------------------------------------------------------------
68183
68183
  if (!renderPassInfo.playerIsPaused) {
68184
- this.engine.profiler.measure("RenderView", "animate", async () => {
68184
+ await this.engine.profiler.measureAsync("RenderView", "animate", async () => {
68185
68185
  this._animate(sceneGraphCollection, renderPassInfo.deltaPlayerTimeMs);
68186
68186
  });
68187
68187
  }
@@ -70672,7 +70672,7 @@ class Renderer {
70672
70672
  }
70673
70673
  renderParticleSystems(renderPassInfo) {
70674
70674
  if (this.particleSystems && !renderPassInfo.playerIsPaused) {
70675
- this.engine.profiler.measure("Particles", "render", async () => {
70675
+ this.engine.profiler.measure("Particles", "render", () => {
70676
70676
  this.particleSystems.forEach(system => {
70677
70677
  system.setSize(renderPassInfo.resolution.x, renderPassInfo.resolution.y);
70678
70678
  // in the testing environment a time provider has been set.
@@ -92435,21 +92435,24 @@ class ProjectItem extends Item {
92435
92435
  this._loadingManagerProgress(LoadingState.DONE);
92436
92436
  }
92437
92437
  updateLayerNames() {
92438
- const layers = this.getFieldValue("LayerNames");
92439
- if (layers.length > MaxLayerCount) {
92440
- layers.splice(MaxLayerCount - 1);
92438
+ let layers = this.getFieldValue("LayerNames");
92439
+ if (!Array.isArray(layers)) {
92440
+ layers = [];
92441
92441
  }
92442
- if (layers.length < MaxLayerCount) {
92443
- while (layers.length < MaxLayerCount) {
92444
- layers.push("");
92445
- }
92446
- this.setFieldValue("LayerNames", layers);
92442
+ const normalized = layers.slice(0, MaxLayerCount);
92443
+ while (normalized.length < MaxLayerCount) {
92444
+ normalized.push("");
92445
+ }
92446
+ const changed = normalized.length !== layers.length
92447
+ || normalized.some((value, index) => value !== layers[index]);
92448
+ if (changed) {
92449
+ this.setFieldValue("LayerNames", normalized);
92447
92450
  }
92448
92451
  try {
92449
- this.engine.renderer.setLayers(layers);
92452
+ this.engine.renderer.setLayers(normalized);
92450
92453
  }
92451
92454
  catch (err) {
92452
- console.log(layers);
92455
+ console.log(normalized);
92453
92456
  console.error(err);
92454
92457
  }
92455
92458
  }
@@ -117979,6 +117982,7 @@ class Engine {
117979
117982
  // reactive for use in a UI. typically you would pass vue.js's reactive function to it.
117980
117983
  _reactiveCallback;
117981
117984
  _externalEmitFunc;
117985
+ _loadBaselineEstablished = false;
117982
117986
  _onItemRepoListEntryAdded;
117983
117987
  _onItemRepoListEntryDeleted;
117984
117988
  _onItemRepoFieldChanged;
@@ -118164,6 +118168,7 @@ class Engine {
118164
118168
  }
118165
118169
  };
118166
118170
  this._onReadyForUse = () => {
118171
+ this._establishLoadBaseline();
118167
118172
  // we only want the auto updates during initial loading, later it can be switched off
118168
118173
  //this.autoUpdateCameraOnContentUpdate = false;
118169
118174
  };
@@ -118270,6 +118275,15 @@ class Engine {
118270
118275
  console.error(err);
118271
118276
  }
118272
118277
  }
118278
+ _establishLoadBaseline() {
118279
+ if (this._loadBaselineEstablished)
118280
+ return;
118281
+ this._loadBaselineEstablished = true;
118282
+ Proxifier.instance.suppressDirtyFlag(false);
118283
+ this.undoManager.setEnabled(true);
118284
+ this.itemRepo.clearDirtyFlags();
118285
+ this.undoManager.clear();
118286
+ }
118273
118287
  getInfo() {
118274
118288
  if (this.renderer) {
118275
118289
  return this.renderer.getInfo();
@@ -118447,6 +118461,9 @@ class Engine {
118447
118461
  this.apiClient.itemRepo.revokePackageItemUrl(url);
118448
118462
  };
118449
118463
  phase = "Importing";
118464
+ this._loadBaselineEstablished = false;
118465
+ Proxifier.instance.suppressDirtyFlag(true);
118466
+ this.undoManager.setEnabled(false);
118450
118467
  switch (itemType) {
118451
118468
  case "Project": {
118452
118469
  let waitMode = options.waitMode;
@@ -118582,6 +118599,13 @@ class Engine {
118582
118599
  }
118583
118600
  this.centerStandardView();
118584
118601
  }
118602
+ catch (err) {
118603
+ if (!this._loadBaselineEstablished) {
118604
+ Proxifier.instance.suppressDirtyFlag(false);
118605
+ this.undoManager.setEnabled(true);
118606
+ }
118607
+ throw err;
118608
+ }
118585
118609
  finally {
118586
118610
  if (loadingInterval) {
118587
118611
  clearInterval(loadingInterval);