@babylonjs/serializers
Advanced tools
Comparing version 4.1.0-alpha.1 to 4.1.0-alpha.2
import { ImageMimeType } from "babylonjs-gltf2interface"; | ||
import { Nullable } from "@babylonjs/core/types"; | ||
import { Vector2 } from "@babylonjs/core/Maths/math"; | ||
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture"; | ||
import { Texture } from "@babylonjs/core/Materials/Textures/texture"; | ||
import { Scene } from "@babylonjs/core/scene"; | ||
import { IGLTFExporterExtensionV2 } from "../glTFExporterExtension"; | ||
@@ -33,3 +30,3 @@ import { _Exporter } from "../glTFExporter"; | ||
*/ | ||
textureTransformTextureAsync(babylonTexture: Texture, offset: Vector2, rotation: number, scale: Vector2, scene: Scene): Promise<BaseTexture>; | ||
private _textureTransformTextureAsync; | ||
} |
@@ -1,2 +0,1 @@ | ||
import { Vector2 } from "@babylonjs/core/Maths/math"; | ||
import { Tools } from "@babylonjs/core/Misc/tools"; | ||
@@ -26,2 +25,8 @@ import { ProceduralTexture } from "@babylonjs/core/Materials/Textures/Procedurals/proceduralTexture"; | ||
return new Promise(function (resolve, reject) { | ||
var scene = babylonTexture.getScene(); | ||
if (!scene) { | ||
reject(context + ": \"scene\" is not defined for Babylon texture " + babylonTexture.name + "!"); | ||
return; | ||
} | ||
// TODO: this doesn't take into account rotation center values | ||
var texture_transform_extension = {}; | ||
@@ -39,15 +44,5 @@ if (babylonTexture.uOffset !== 0 || babylonTexture.vOffset !== 0) { | ||
resolve(babylonTexture); | ||
return; | ||
} | ||
var scale = texture_transform_extension.scale ? new Vector2(texture_transform_extension.scale[0], texture_transform_extension.scale[1]) : Vector2.One(); | ||
var rotation = texture_transform_extension.rotation != null ? texture_transform_extension.rotation : 0; | ||
var offset = texture_transform_extension.offset ? new Vector2(texture_transform_extension.offset[0], texture_transform_extension.offset[1]) : Vector2.Zero(); | ||
var scene = babylonTexture.getScene(); | ||
if (!scene) { | ||
reject(context + ": \"scene\" is not defined for Babylon texture " + babylonTexture.name + "!"); | ||
} | ||
else { | ||
_this.textureTransformTextureAsync(babylonTexture, offset, rotation, scale, scene).then(function (texture) { | ||
resolve(texture); | ||
}); | ||
} | ||
return _this._textureTransformTextureAsync(babylonTexture, scene); | ||
}); | ||
@@ -63,4 +58,4 @@ }; | ||
*/ | ||
KHR_texture_transform.prototype.textureTransformTextureAsync = function (babylonTexture, offset, rotation, scale, scene) { | ||
return new Promise(function (resolve, reject) { | ||
KHR_texture_transform.prototype._textureTransformTextureAsync = function (babylonTexture, scene) { | ||
return new Promise(function (resolve) { | ||
var proceduralTexture = new ProceduralTexture("" + babylonTexture.name, babylonTexture.getSize(), "textureTransform", scene); | ||
@@ -67,0 +62,0 @@ if (!proceduralTexture) { |
@@ -7,3 +7,3 @@ { | ||
"description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.", | ||
"version": "4.1.0-alpha.1", | ||
"version": "4.1.0-alpha.2", | ||
"repository": { | ||
@@ -96,4 +96,4 @@ "type": "git", | ||
"dependencies": { | ||
"@babylonjs/core": "4.1.0-alpha.1", | ||
"babylonjs-gltf2interface": "4.1.0-alpha.1", | ||
"@babylonjs/core": "4.1.0-alpha.2", | ||
"babylonjs-gltf2interface": "4.1.0-alpha.2", | ||
"tslib": "^1.9.3" | ||
@@ -100,0 +100,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
618437
5140
+ Added@babylonjs/core@4.1.0-alpha.2(transitive)
+ Addedbabylonjs-gltf2interface@4.1.0-alpha.2(transitive)
- Removed@babylonjs/core@4.1.0-alpha.1(transitive)
- Removedbabylonjs-gltf2interface@4.1.0-alpha.1(transitive)