diff --git a/examples/flowArts/lightSaber/lightSaberEntityScript.js b/examples/flowArts/lightSaber/lightSaberEntityScript.js index a23abcc695..a86f471449 100644 --- a/examples/flowArts/lightSaber/lightSaberEntityScript.js +++ b/examples/flowArts/lightSaber/lightSaberEntityScript.js @@ -105,8 +105,7 @@ alphaStart: 0.5, alphaFinish: 0.5, textures: "https://s3.amazonaws.com/hifi-public/eric/textures/particleSprites/beamParticle.png", - emitterShouldTrail: false, - lifetime: 1000 + emitterShouldTrail: false } this.beam = Entities.addEntity(props); diff --git a/examples/widgets/weatherBox.js b/examples/widgets/weatherBox.js deleted file mode 100644 index 71457136e9..0000000000 --- a/examples/widgets/weatherBox.js +++ /dev/null @@ -1,161 +0,0 @@ -// -// weatherBox.js -// examples/widgets/weatherBox -// -// Created by Eric Levin on 1/20/16. -// Copyright 2016 High Fidelity, Inc. -// -// This script creates a weatherBox widget which (in final version) will display the current weather -// -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - - -Script.include("../libraries/utils.js"); -var weatherBox, boxDimensions; -var orientation = Camera.getOrientation(); -orientation = Quat.safeEulerAngles(orientation); -orientation.x = 0; -orientation = Quat.fromVec3Degrees(orientation); -var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(orientation))); - -var emitters = []; -var spheres = []; - -createWeatherBox(center); -center.y += boxDimensions.y / 2; -createCloud(center); -for (var i = 0; i < 7; i++) { - createLightningStrike(center) -} - -function createLightningStrike(basePosition) { - var normal = Vec3.subtract(position, MyAvatar.position); - normal.y = 0; - var textureURL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/textures/lightning.png" - var linePoints = []; - var normals = []; - var strokeWidths = []; - var strokeWidth = 0.02 - var currentPointPosition = {x: 0, y: 0, z: 0}; - for (var i = 0; i < 8; i++) { - linePoints.push(currentPointPosition); - currentPointPosition = Vec3.sum(currentPointPosition, {x: randFloat(-0.05, 0.05), y: randFloat(-0.1, -0.05), z: randFloat(-0.05, 0.05)}); - linePoints.push(currentPointPosition); - normals.push(normal); - normals.push(normal); - strokeWidth -= 0.002; - strokeWidths.push(strokeWidth); - strokeWidths.push(strokeWidth); - } - var position = Vec3.sum(basePosition, {x: randFloat(-boxDimensions.x/20, boxDimensions.x/20), y: 0, z: randFloat(-boxDimensions.x/20, boxDimensions.x/20)}); - var bolt = Entities.addEntity({ - type: "PolyLine", - textures: textureURL, - position: position, - dimensions: { - x: 10, - y: 10, - z: 10 - }, - linePoints: linePoints, - normals: normals, - strokeWidths: strokeWidths, - lifetime: randFloat(0.01, 0.2) - }); - - Script.setTimeout(function() { - createLightningStrike(position) - }, randInt(500, 5000)); - -} - - -function createWeatherBox(position) { - var naturalDimensions = { - x: 1.11, - y: 1.3, - z: 1.11 - }; - boxDimensions = Vec3.multiply(naturalDimensions, 0.7); - var modelURL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/weatherBox.fbx" - weatherBox = Entities.addEntity({ - type: "Model", - name: "Weather Box", - modelURL: modelURL, - position: position, - dimensions: boxDimensions - }); -} - - -function createCloud(position) { - var props = { - "type": "ParticleEffect", - "position": position, - "isEmitting": true, - "maxParticles": 10000, - "lifespan": 3, - "emitRate": 2000, - "emitSpeed": 0.025, - "speedSpread": 0, - "emitDimensions": { - x: boxDimensions.x, - y: boxDimensions.x, - z: 0.1 - }, - "emitRadiusStart": 1, - "polarStart": 0, - "polarFinish": 1.570796012878418, - "azimuthStart": -3.1415927410125732, - "azimuthFinish": 3.1415927410125732, - "emitAcceleration": { - "x": 0, - "y": 0, - "z": 0 - }, - "particleRadius": 0.04, - "radiusSpread": 0.02, - "radiusStart": 0.04, - radiusFinish: 0.04, - "colorStart": { - "red": 40, - "green": 40, - "blue": 100 - }, - color: { - red: 40, - green: 40, - blue: 100 - }, - "colorFinish": { - "red": 40, - "green": 40, - "blue": 100 - }, - "alpha": 1, - "alphaSpread": 0, - "alphaStart": 0.3, - "alphaFinish": 0, - "emitterShouldTrail": true, - "textures": "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png" - } - - var oceanEmitter = Entities.addEntity(props); - emitters.push(oceanEmitter); -} - -function cleanup() { - emitters.forEach(function(emitter) { - Entities.deleteEntity(emitter); - }); - spheres.forEach(function(sphere) { - Entities.deleteEntity(sphere); - }); - Entities.deleteEntity(weatherBox); - -} - -Script.scriptEnding.connect(cleanup); diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 70de307f1b..1be3bbb5f6 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -1035,7 +1035,7 @@ FBXGeometry* FBXReader::extractFBXGeometry(const QVariantHash& mapping, const QS } else if (type.contains("transparentcolor")) { // it should be TransparentColor... // THis is how Maya assign a texture that affect diffuse color AND transparency ? - opacityTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); + diffuseTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); } else if (type.contains("bump")) { bumpTextures.insert(getID(connection.properties, 2), getID(connection.properties, 1)); } else if (type.contains("normal")) { diff --git a/libraries/fbx/src/FBXReader.h b/libraries/fbx/src/FBXReader.h index 8b1b0d2588..51cb5baf9f 100644 --- a/libraries/fbx/src/FBXReader.h +++ b/libraries/fbx/src/FBXReader.h @@ -402,7 +402,6 @@ public: QHash specularTextures; QHash emissiveTextures; QHash ambientTextures; - QHash opacityTextures; QHash _fbxMaterials; diff --git a/libraries/fbx/src/FBXReader_Material.cpp b/libraries/fbx/src/FBXReader_Material.cpp index 1329fccc3a..e947a0356e 100644 --- a/libraries/fbx/src/FBXReader_Material.cpp +++ b/libraries/fbx/src/FBXReader_Material.cpp @@ -70,7 +70,8 @@ void FBXReader::consolidateFBXMaterials() { FBXTexture diffuseTexture; QString diffuseTextureID = diffuseTextures.value(material.materialID); if (!diffuseTextureID.isNull()) { - diffuseTexture = getTexture(diffuseTextureID); + diffuseTexture = getTexture(diffuseTextureID); + // FBX files generated by 3DSMax have an intermediate texture parent, apparently foreach (const QString& childTextureID, _connectionChildMap.values(diffuseTextureID)) { if (_textureFilenames.contains(childTextureID)) { @@ -79,16 +80,9 @@ void FBXReader::consolidateFBXMaterials() { } material.diffuseTexture = diffuseTexture; + detectDifferentUVs = (diffuseTexture.texcoordSet != 0) || (!diffuseTexture.transform.isIdentity()); } - - FBXTexture opacityTexture; - QString opacityTextureID = opacityTextures.value(material.materialID); - if (!opacityTextureID.isNull()) { - opacityTexture = getTexture(opacityTextureID); - material.opacityTexture = opacityTexture; - } - FBXTexture normalTexture; QString bumpTextureID = bumpTextures.value(material.materialID); diff --git a/libraries/model-networking/src/model-networking/ModelCache.cpp b/libraries/model-networking/src/model-networking/ModelCache.cpp index ef649fd7ae..2b425351f1 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.cpp +++ b/libraries/model-networking/src/model-networking/ModelCache.cpp @@ -155,8 +155,6 @@ void NetworkGeometry::setTextureWithNameToURL(const QString& name, const QUrl& u material->specularTexture = textureCache->getTexture(url); } else if (material->emissiveTextureName == name) { material->emissiveTexture = textureCache->getTexture(url); - } else if (material->opacityTextureName == name) { - material->opacityTexture = textureCache->getTexture(url); } } } else { @@ -288,16 +286,6 @@ static NetworkMaterial* buildNetworkMaterial(const FBXMaterial& material, const material._material->setTextureMap(model::MaterialKey::DIFFUSE_MAP, diffuseMap); } - if (!material.opacityTexture.filename.isEmpty()) { - networkMaterial->opacityTexture = textureCache->getTexture(textureBaseUrl.resolved(QUrl(material.opacityTexture.filename)), DEFAULT_TEXTURE, material.opacityTexture.content); - networkMaterial->opacityTextureName = material.opacityTexture.name; - - auto opacityMap = model::TextureMapPointer(new model::TextureMap()); - opacityMap->setTextureSource(networkMaterial->opacityTexture->_textureSource); - opacityMap->setTextureTransform(material.opacityTexture.transform); - - material._material->setTextureMap(model::MaterialKey::TRANSPARENT_MAP, opacityMap); - } if (!material.normalTexture.filename.isEmpty()) { networkMaterial->normalTexture = textureCache->getTexture(textureBaseUrl.resolved(QUrl(material.normalTexture.filename)), (material.normalTexture.isBumpmap ? BUMP_TEXTURE : NORMAL_TEXTURE), material.normalTexture.content); networkMaterial->normalTextureName = material.normalTexture.name; diff --git a/libraries/model-networking/src/model-networking/ModelCache.h b/libraries/model-networking/src/model-networking/ModelCache.h index 53f17f4e6c..b2d81c5900 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.h +++ b/libraries/model-networking/src/model-networking/ModelCache.h @@ -182,8 +182,6 @@ public: QSharedPointer specularTexture; QString emissiveTextureName; QSharedPointer emissiveTexture; - QString opacityTextureName; - QSharedPointer opacityTexture; };