lythreeframe 1.1.9 → 1.1.11
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/bundle.cjs.js
CHANGED
|
@@ -883,6 +883,29 @@ class MaterialAssetPointer extends TAssetPointer {
|
|
|
883
883
|
get texturePointers() {
|
|
884
884
|
return this.textures;
|
|
885
885
|
}
|
|
886
|
+
setTexture(name, texturePtr) {
|
|
887
|
+
let mat = this.getValue();
|
|
888
|
+
let texture = texturePtr.getValue();
|
|
889
|
+
if (!texture) {
|
|
890
|
+
throw new Error("Texture is null");
|
|
891
|
+
}
|
|
892
|
+
if (!mat) {
|
|
893
|
+
throw new Error("Material is null");
|
|
894
|
+
}
|
|
895
|
+
if (this.textures.has(name)) {
|
|
896
|
+
this.textures.get(name).release();
|
|
897
|
+
this.textures.delete(name);
|
|
898
|
+
}
|
|
899
|
+
try {
|
|
900
|
+
this.textures.set(name, texturePtr);
|
|
901
|
+
this.getValue()[name] = texture;
|
|
902
|
+
texturePtr.addRef();
|
|
903
|
+
mat.needsUpdate = true;
|
|
904
|
+
}
|
|
905
|
+
catch (e) {
|
|
906
|
+
throw e;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
886
909
|
release() {
|
|
887
910
|
for (let texture of this.textures.values()) {
|
|
888
911
|
texture.release();
|
package/dist/bundle.esm.js
CHANGED
|
@@ -881,6 +881,29 @@ class MaterialAssetPointer extends TAssetPointer {
|
|
|
881
881
|
get texturePointers() {
|
|
882
882
|
return this.textures;
|
|
883
883
|
}
|
|
884
|
+
setTexture(name, texturePtr) {
|
|
885
|
+
let mat = this.getValue();
|
|
886
|
+
let texture = texturePtr.getValue();
|
|
887
|
+
if (!texture) {
|
|
888
|
+
throw new Error("Texture is null");
|
|
889
|
+
}
|
|
890
|
+
if (!mat) {
|
|
891
|
+
throw new Error("Material is null");
|
|
892
|
+
}
|
|
893
|
+
if (this.textures.has(name)) {
|
|
894
|
+
this.textures.get(name).release();
|
|
895
|
+
this.textures.delete(name);
|
|
896
|
+
}
|
|
897
|
+
try {
|
|
898
|
+
this.textures.set(name, texturePtr);
|
|
899
|
+
this.getValue()[name] = texture;
|
|
900
|
+
texturePtr.addRef();
|
|
901
|
+
mat.needsUpdate = true;
|
|
902
|
+
}
|
|
903
|
+
catch (e) {
|
|
904
|
+
throw e;
|
|
905
|
+
}
|
|
906
|
+
}
|
|
884
907
|
release() {
|
|
885
908
|
for (let texture of this.textures.values()) {
|
|
886
909
|
texture.release();
|
|
@@ -5,6 +5,7 @@ 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
7
|
get texturePointers(): Map<string, TextureAssetPointer>;
|
|
8
|
+
setTexture(name: string, texturePtr: TextureAssetPointer): void;
|
|
8
9
|
release(): void;
|
|
9
10
|
forceRelease(): void;
|
|
10
11
|
}
|