lythreeframe 1.1.7 → 1.1.8

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.
@@ -880,6 +880,12 @@ class MaterialAssetPointer extends TAssetPointer {
880
880
  super(value, referenceCount);
881
881
  this.textures = usedTextures;
882
882
  }
883
+ getTextureIds() {
884
+ return Array.from(this.textures.keys());
885
+ }
886
+ getTexturePointers() {
887
+ return Array.from(this.textures.values());
888
+ }
883
889
  release() {
884
890
  for (let texture of this.textures.values()) {
885
891
  texture.release();
@@ -936,16 +942,16 @@ class AssetManager {
936
942
  let children = threejsObject.children;
937
943
  threejsObject.children = [];
938
944
  if (threejsObject.type === "Group" || threejsObject.type === "Object3D") {
939
- newComp = new SceneComponent(threejsObject);
945
+ newComp = new SceneComponent(this.app, threejsObject);
940
946
  }
941
947
  else if (threejsObject.isMesh) {
942
948
  let obj = threejsObject;
943
- newComp = new MeshComponent(obj);
949
+ newComp = new MeshComponent(this.app, obj.geometry, obj.material);
944
950
  // assetManager.#collectMatAndGeoInMesh(threejsObject)
945
951
  threejsObject.layers.set(0);
946
952
  }
947
953
  else {
948
- newComp = new SceneComponent(threejsObject);
954
+ newComp = new SceneComponent(this.app, threejsObject);
949
955
  }
950
956
  if (newComp === null) {
951
957
  threejsObject.children = children;
@@ -878,6 +878,12 @@ class MaterialAssetPointer extends TAssetPointer {
878
878
  super(value, referenceCount);
879
879
  this.textures = usedTextures;
880
880
  }
881
+ getTextureIds() {
882
+ return Array.from(this.textures.keys());
883
+ }
884
+ getTexturePointers() {
885
+ return Array.from(this.textures.values());
886
+ }
881
887
  release() {
882
888
  for (let texture of this.textures.values()) {
883
889
  texture.release();
@@ -934,16 +940,16 @@ class AssetManager {
934
940
  let children = threejsObject.children;
935
941
  threejsObject.children = [];
936
942
  if (threejsObject.type === "Group" || threejsObject.type === "Object3D") {
937
- newComp = new SceneComponent(threejsObject);
943
+ newComp = new SceneComponent(this.app, threejsObject);
938
944
  }
939
945
  else if (threejsObject.isMesh) {
940
946
  let obj = threejsObject;
941
- newComp = new MeshComponent(obj);
947
+ newComp = new MeshComponent(this.app, obj.geometry, obj.material);
942
948
  // assetManager.#collectMatAndGeoInMesh(threejsObject)
943
949
  threejsObject.layers.set(0);
944
950
  }
945
951
  else {
946
- newComp = new SceneComponent(threejsObject);
952
+ newComp = new SceneComponent(this.app, threejsObject);
947
953
  }
948
954
  if (newComp === null) {
949
955
  threejsObject.children = children;
@@ -4,6 +4,8 @@ import { TextureAssetPointer } from "./TextureAssetPointer";
4
4
  export declare class MaterialAssetPointer extends TAssetPointer<Material> {
5
5
  protected textures: Map<string, TextureAssetPointer>;
6
6
  constructor(value: Material, usedTextures: Map<string, TextureAssetPointer>, referenceCount?: number);
7
+ getTextureIds(): string[];
8
+ getTexturePointers(): TextureAssetPointer[];
7
9
  release(): void;
8
10
  forceRelease(): void;
9
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lythreeframe",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Three.js 封装",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",