|
@@ -16570,11 +16570,6 @@ var BABYLON;
|
|
|
}
|
|
|
// Animations
|
|
|
this.getScene().stopAnimation(this);
|
|
|
- // Remove from meshes
|
|
|
- for (var _i = 0, _a = this.getScene().meshes; _i < _a.length; _i++) {
|
|
|
- var mesh = _a[_i];
|
|
|
- mesh._removeLightSource(this);
|
|
|
- }
|
|
|
this._uniformBuffer.dispose();
|
|
|
// Remove from scene
|
|
|
this.getScene().removeLight(this);
|
|
@@ -20255,6 +20250,11 @@ var BABYLON;
|
|
|
Scene.prototype.removeLight = function (toRemove) {
|
|
|
var index = this.lights.indexOf(toRemove);
|
|
|
if (index !== -1) {
|
|
|
+ // Remove from meshes
|
|
|
+ for (var _i = 0, _a = this.meshes; _i < _a.length; _i++) {
|
|
|
+ var mesh = _a[_i];
|
|
|
+ mesh._removeLightSource(toRemove);
|
|
|
+ }
|
|
|
// Remove from the scene if mesh found
|
|
|
this.lights.splice(index, 1);
|
|
|
this.sortLightsByPriority();
|
|
@@ -20289,6 +20289,14 @@ var BABYLON;
|
|
|
Scene.prototype.addLight = function (newLight) {
|
|
|
this.lights.push(newLight);
|
|
|
this.sortLightsByPriority();
|
|
|
+ // Add light to all meshes (To support if the light is removed and then readded)
|
|
|
+ for (var _i = 0, _a = this.meshes; _i < _a.length; _i++) {
|
|
|
+ var mesh = _a[_i];
|
|
|
+ if (mesh._lightSources.indexOf(newLight) === -1) {
|
|
|
+ mesh._lightSources.push(newLight);
|
|
|
+ mesh._resyncLightSources();
|
|
|
+ }
|
|
|
+ }
|
|
|
this.onNewLightAddedObservable.notifyObservers(newLight);
|
|
|
};
|
|
|
Scene.prototype.sortLightsByPriority = function () {
|
|
@@ -84302,7 +84310,6 @@ var BABYLON;
|
|
|
return;
|
|
|
}
|
|
|
node.babylonMesh = new BABYLON.Mesh(node.name || "mesh" + node.index, this._babylonScene);
|
|
|
- node.babylonMesh.hasVertexAlpha = true;
|
|
|
this._loadTransform(node);
|
|
|
if (node.mesh != null) {
|
|
|
var mesh = GLTFLoader._GetProperty(this._gltf.meshes, node.mesh);
|
|
@@ -84357,6 +84364,7 @@ var BABYLON;
|
|
|
var primitive = primitives_1[_i];
|
|
|
vertexData.merge(primitive.vertexData);
|
|
|
}
|
|
|
+ node.babylonMesh.hasVertexAlpha = mesh.hasVertexAlpha;
|
|
|
new BABYLON.Geometry(node.babylonMesh.name, _this._babylonScene, vertexData, false, node.babylonMesh);
|
|
|
// TODO: optimize this so that sub meshes can be created without being overwritten after setting vertex data.
|
|
|
// Sub meshes must be cleared and created after setting vertex data because of mesh._createGlobalSubMesh.
|
|
@@ -84565,6 +84573,10 @@ var BABYLON;
|
|
|
}
|
|
|
case "COLOR_0": {
|
|
|
vertexData.colors = _this._convertToFloat4ColorArray(context, data, accessor);
|
|
|
+ var hasVertexAlpha = GLTFLoader._GetNumComponents(context, accessor.type) === 4;
|
|
|
+ if (!mesh.hasVertexAlpha && hasVertexAlpha) {
|
|
|
+ mesh.hasVertexAlpha = hasVertexAlpha;
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
default: {
|