lythreeframe 1.0.38 → 1.0.41

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.
@@ -895,9 +895,6 @@ class AssetManager {
895
895
  this.dracoLoader.preload();
896
896
  this.gltfLoader.setDRACOLoader(this.dracoLoader);
897
897
  }
898
- else {
899
- console.error("DracoLoader already setup");
900
- }
901
898
  }
902
899
  convertThreeObjectToLYObject(parentLYComponent, threejsObject) {
903
900
  let location = threejsObject.position.clone();
@@ -1749,13 +1746,13 @@ class Viewport {
1749
1746
  this.isRenderStateDirty = false;
1750
1747
  }
1751
1748
  async renderAsImage(width = 1024, height = 1024) {
1752
- return new Promise((resolve, reject) => {
1749
+ return new Promise(async (resolve, reject) => {
1753
1750
  try {
1754
1751
  if (this.postProcessing) {
1755
- this.postProcessing.renderAsync();
1752
+ await this.postProcessing.renderAsync();
1756
1753
  }
1757
1754
  else {
1758
- this.renderer.renderAsync(this.app.world.scene, this.app.camera);
1755
+ await this.renderer.renderAsync(this.app.world.scene, this.app.camera);
1759
1756
  }
1760
1757
  const offscreenCanvas = document.createElement('canvas');
1761
1758
  offscreenCanvas.width = width;
@@ -893,9 +893,6 @@ class AssetManager {
893
893
  this.dracoLoader.preload();
894
894
  this.gltfLoader.setDRACOLoader(this.dracoLoader);
895
895
  }
896
- else {
897
- console.error("DracoLoader already setup");
898
- }
899
896
  }
900
897
  convertThreeObjectToLYObject(parentLYComponent, threejsObject) {
901
898
  let location = threejsObject.position.clone();
@@ -1747,13 +1744,13 @@ class Viewport {
1747
1744
  this.isRenderStateDirty = false;
1748
1745
  }
1749
1746
  async renderAsImage(width = 1024, height = 1024) {
1750
- return new Promise((resolve, reject) => {
1747
+ return new Promise(async (resolve, reject) => {
1751
1748
  try {
1752
1749
  if (this.postProcessing) {
1753
- this.postProcessing.renderAsync();
1750
+ await this.postProcessing.renderAsync();
1754
1751
  }
1755
1752
  else {
1756
- this.renderer.renderAsync(this.app.world.scene, this.app.camera);
1753
+ await this.renderer.renderAsync(this.app.world.scene, this.app.camera);
1757
1754
  }
1758
1755
  const offscreenCanvas = document.createElement('canvas');
1759
1756
  offscreenCanvas.width = width;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.0.38",
3
+ "version": "1.0.41",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",