url's fixed

This commit is contained in:
SilverfishVR 2021-04-05 01:18:14 +02:00
parent 005dac9cd6
commit 8434e4ea19
27 changed files with 2240 additions and 75 deletions

View file

@ -1,9 +1,8 @@
/* eslint-disable no-magic-numbers */ /* eslint-disable no-magic-numbers */
// //
// soundEmitter_localfile.js // soundEmitter.js
// //
// Created by Zach Fox on 2019-07-05 // Created by Zach Fox on 2019-07-05
// modified for relative path by Silverfish 2021
// Copyright High Fidelity 2019 // Copyright High Fidelity 2019
// //
// Licensed under the Apache 2.0 License // Licensed under the Apache 2.0 License
@ -12,7 +11,7 @@
(function() { (function() {
var that; var that;
var SOUND_EMITTER_UPDATE_INTERVAL_MS = 5000; var SOUND_EMITTER_UPDATE_INTERVAL_MS = 500;
var DEFAULT_AUDIO_INJECTOR_OPTIONS = { var DEFAULT_AUDIO_INJECTOR_OPTIONS = {
"position": { "position": {
"x": 0, "x": 0,
@ -21,7 +20,7 @@
}, },
"volume": 0.5, "volume": 0.5,
"loop": false, "loop": false,
"localOnly": true "localOnly": false
}; };
@ -42,7 +41,7 @@
that.entityID = entityID; that.entityID = entityID;
var properties = Entities.getEntityProperties(that.entityID, ["userData"]); var properties = Entities.getEntityProperties(that.entityID, ["userData"]);
var userData; var userData;
try { try {
@ -50,14 +49,10 @@
} catch (e) { } catch (e) {
console.error("Error parsing userData: ", e); console.error("Error parsing userData: ", e);
} }
if (userData) { if (userData) {
if (userData.soundURL && userData.soundURL.length > 0) { if (userData.soundURL && userData.soundURL.length > 0) {
//----I added script resolve here--- that.handleNewSoundURL(userData.soundURL);
localSoundURL = Script.resolvePath(userData.soundURL);
print("New Local sound url: ", localSoundURL);
that.handleNewSoundURL(localSoundURL);
//that.handleNewSoundURL(userData.soundURL);
} else { } else {
console.log("Please specify this entity's `userData`! See README.md for instructions."); console.log("Please specify this entity's `userData`! See README.md for instructions.");
return; return;
@ -103,8 +98,8 @@
handleNewSoundURL: function(newSoundURL) { handleNewSoundURL: function(newSoundURL) {
that.clearCurrentSoundData(); that.clearCurrentSoundData();
that.soundObjectURL = newSoundURL; that.soundObjectURL = newSoundURL;
print(newSoundURL);
that.soundObject = SoundCache.getSound(that.soundObjectURL); that.soundObject = SoundCache.getSound(that.soundObjectURL);
if (that.soundObject.downloaded) { if (that.soundObject.downloaded) {
@ -138,15 +133,10 @@
var shouldRestartPlayback = false; var shouldRestartPlayback = false;
var newPosition = properties.position; var newPosition = properties.position;
//---I added script resolve here---
if (userData) { if (userData) {
if (userData.soundURL && userData.soundURL.length > 0 && Script.resolvePath(userData.soundURL) !== that.soundObjectURL) { if (userData.soundURL && userData.soundURL.length > 0 && userData.soundURL !== that.soundObjectURL) {
console.log("Sound Emitter: User put a new sound URL into `userData`! Resetting..."); console.log("Sound Emitter: User put a new sound URL into `userData`! Resetting...");
localSoundURL = Script.resolvePath(userData.soundURL); that.handleNewSoundURL(userData.soundURL);
print("New Local sound url: ", localSoundURL);
that.handleNewSoundURL(localSoundURL);
//that.handleNewSoundURL(userData.soundURL);
return; return;
} }
@ -177,11 +167,11 @@
var localOnly = that.audioInjectorOptions.localOnly; var localOnly = that.audioInjectorOptions.localOnly;
// If this script is attached as a client entity script... // If this script is attached as a client entity script...
if (properties.script.indexOf("soundEmitter_localfile.js") > -1) { if (properties.script.indexOf("soundEmitter.js") > -1) {
// ... Make sure that the audio injector IS local only. // ... Make sure that the audio injector IS local only.
localOnly = true; localOnly = true;
// Else if this script is attached as a client server script... // Else if this script is attached as a client server script...
} else if (properties.serverScripts.indexOf("soundEmitter_localfile.js") > -1) { } else if (properties.serverScripts.indexOf("soundEmitter.js") > -1) {
// ... Make sure that the audio injector IS NOT local only. // ... Make sure that the audio injector IS NOT local only.
localOnly = false; localOnly = false;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

View file

@ -1,29 +0,0 @@
{
"materialVersion": 1,
"materials": [
{
"name": "moveMaterial",
"model": "hifi_pbr",
"opacity": 0.8,
"albedo": [
1,
1,
1
],
"roughness": 1,
"metallic": 0,
"emissive": [
0,
0,
0
],
"scattering": 0,
"unlit": false,
"emissiveMap": "./Textures/gradient1.jpg",
"albedoMap": "./Textures/gradient1.jpg",
"opacityMapMode": "OPACITY_MAP_BLEND",
"cullFaceMode": "CULL_NONE",
"defaultFallthrough": false
}
]
}

View file

@ -44,7 +44,7 @@
"angularDamping": 0, "angularDamping": 0,
"collisionless": true, "collisionless": true,
"ignoreForCollisions": true, "ignoreForCollisions": true,
"script": "./Scripts/wizardLoader.js", "script": "qrc:///serverless/Scripts/wizardLoader.js",
"color": { "color": {
"red": 0, "red": 0,
"green": 180, "green": 180,
@ -108,9 +108,9 @@
"ignoreForCollisions": true, "ignoreForCollisions": true,
"collisionMask": 0, "collisionMask": 0,
"collidesWith": "", "collidesWith": "",
"script": "./Scripts/mirrorClient.js", "script": "qrc:///serverless/Scripts/mirrorClient.js",
"scriptTimestamp": 1601084665601, "scriptTimestamp": 1601084665601,
"modelURL": "./Models/mirror_without_backface.baked.fbx", "modelURL": "qrc:///serverless/Models/mirror_without_backface.baked.fbx",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"clientOnly": false, "clientOnly": false,
"avatarEntity": false, "avatarEntity": false,
@ -240,10 +240,10 @@
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"shapeType": "simple-compound", "shapeType": "simple-compound",
"modelURL": "./Models/seagull-ANI.fbx", "modelURL": "qrc:///serverless/Models/seagull-ANI.fbx",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"animation": { "animation": {
"url": "./Models/seagull-ANI.fbx", "url": "qrc:///serverless/Models/seagull-ANI.fbx",
"allowTranslation": false, "allowTranslation": false,
"currentFrame": 99.81153869628906, "currentFrame": 99.81153869628906,
"running": true, "running": true,
@ -263,7 +263,7 @@
"visible": false, "visible": false,
"name": "Sound Emitter", "name": "Sound Emitter",
"locked": true, "locked": true,
"userData": "{\"soundURL\":\"./Sounds/468407__onderwish__sci-fi-survival-dreamscape.mp3\",\"shouldLoop\":true,\"volume\":0.18,\"refreshInterval\":100,\"grabbableKey\":{\"grabbable\":false}}", "userData": "{\"soundURL\":\"qrc:///serverless/Sounds/468407__onderwish__sci-fi-survival-dreamscape.mp3\",\"shouldLoop\":true,\"volume\":0.18,\"refreshInterval\":100,\"grabbableKey\":{\"grabbable\":false}}",
"position": { "position": {
"x": 0, "x": 0,
"y": 1.0455207824707031, "y": 1.0455207824707031,
@ -305,7 +305,7 @@
}, },
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"script": "./Scripts/soundEmitter_localfile.js", "script": "qrc:///serverless/Scripts/soundEmitter.js",
"scriptTimestamp": 1601079357399, "scriptTimestamp": 1601079357399,
"color": { "color": {
"red": 0, "red": 0,
@ -366,7 +366,7 @@
}, },
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"modelURL": "./Models/VircadiaLogo.fbx", "modelURL": "qrc:///serverless/Models/VircadiaLogo.fbx",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"animation": { "animation": {
"allowTranslation": false "allowTranslation": false
@ -562,7 +562,7 @@
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"shapeType": "static-mesh", "shapeType": "static-mesh",
"modelURL": "./Models/bowl2.fbx", "modelURL": "qrc:///serverless/Models/bowl2.fbx",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"animation": { "animation": {
"allowTranslation": false "allowTranslation": false
@ -628,7 +628,7 @@
"blue": 143 "blue": 143
}, },
"alpha": 0.30000001192092896, "alpha": 0.30000001192092896,
"textures": "file:///C:/Users/Silverfish/AppData/Roaming/Vircadia Launcher/storage/Vircadia_2021.1.0_Eos__2021.1.0/resources/serverless/Textures/default_particle.png", "textures": "qrc:///serverless/Textures/default_particle.png",
"maxParticles": 80, "maxParticles": 80,
"lifespan": 2, "lifespan": 2,
"emitRate": 47, "emitRate": 47,
@ -739,7 +739,7 @@
"angularDamping": 0, "angularDamping": 0,
"shapeType": "ellipsoid", "shapeType": "ellipsoid",
"alpha": 0.014999999664723873, "alpha": 0.014999999664723873,
"textures": "file:///C:/Users/Silverfish/AppData/Roaming/Vircadia Launcher/storage/Vircadia_2021.1.0_Eos__2021.1.0/resources/serverless/Textures/default_particle.png", "textures": "qrc:///serverless/Textures/default_particle.png",
"maxParticles": 100, "maxParticles": 100,
"lifespan": 3.069999933242798, "lifespan": 3.069999933242798,
"emitSpeed": 0.4000000059604645, "emitSpeed": 0.4000000059604645,
@ -888,7 +888,7 @@
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"shapeType": "static-mesh", "shapeType": "static-mesh",
"modelURL": "./Models/dome2_glass.glb", "modelURL": "qrc:///serverless/Models/dome2_glass.glb",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"animation": { "animation": {
"allowTranslation": false "allowTranslation": false
@ -947,7 +947,7 @@
}, },
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"modelURL": "./Models/Trees1.glb", "modelURL": "qrc:///serverless/Models/Trees1.glb",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"animation": { "animation": {
"allowTranslation": false "allowTranslation": false
@ -1006,11 +1006,11 @@
}, },
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"modelURL": "./Models/Stands.fbx", "modelURL": "qrc:///serverless/Models/Stands.fbx",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"useOriginalPivot": true, "useOriginalPivot": true,
"animation": { "animation": {
"url": "./Models/Stands.fbx", "url": "qrc:///serverless/Models/Stands.fbx",
"allowTranslation": false, "allowTranslation": false,
"currentFrame": 68342.515625, "currentFrame": 68342.515625,
"running": true "running": true
@ -1072,7 +1072,7 @@
"collidesWith": "static,dynamic,kinematic,otherAvatar,", "collidesWith": "static,dynamic,kinematic,otherAvatar,",
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"script": "./Scripts/portal.js", "script": "qrc:///serverless/Scripts/portal.js",
"scriptTimestamp": 1617134674001, "scriptTimestamp": 1617134674001,
"color": { "color": {
"red": 0, "red": 0,
@ -1198,7 +1198,7 @@
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"shapeType": "static-mesh", "shapeType": "static-mesh",
"modelURL": "./Models/dome2.glb", "modelURL": "qrc:///serverless/Models/dome2.glb",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"animation": { "animation": {
"allowTranslation": false "allowTranslation": false
@ -1258,7 +1258,7 @@
"angularDamping": 0, "angularDamping": 0,
"scriptTimestamp": 1598912452582, "scriptTimestamp": 1598912452582,
"shapeType": "static-mesh", "shapeType": "static-mesh",
"modelURL": "./Models/temple5.glb", "modelURL": "qrc:///serverless/Models/temple5.glb",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"animation": { "animation": {
"allowTranslation": false "allowTranslation": false
@ -1528,7 +1528,7 @@
}, },
"ambientLight": { "ambientLight": {
"ambientIntensity": 0.8999999761581421, "ambientIntensity": 0.8999999761581421,
"ambientURL": "./Textures/galaxySkybox.png" "ambientURL": "qrc:///serverless/Textures/galaxySkybox.png"
}, },
"skybox": { "skybox": {
"color": { "color": {
@ -1536,7 +1536,7 @@
"green": 235, "green": 235,
"blue": 235 "blue": 235
}, },
"url": "./Textures/galaxySkybox.png" "url": "qrc:///serverless/Textures/galaxySkybox.png"
}, },
"haze": { "haze": {
"hazeRange": 50, "hazeRange": 50,
@ -1681,7 +1681,7 @@
"w": 1 "w": 1
} }
}, },
"script": "./Scripts/mirrorReflection.js", "script": "qrc:///serverless/Scripts/mirrorReflection.js",
"scriptTimestamp": 1601084668318, "scriptTimestamp": 1601084668318,
"shapeType": "box", "shapeType": "box",
"clientOnly": false, "clientOnly": false,
@ -1921,16 +1921,16 @@
}, },
"collisionMask": 23, "collisionMask": 23,
"collidesWith": "static,dynamic,kinematic,otherAvatar,", "collidesWith": "static,dynamic,kinematic,otherAvatar,",
"script": "./Scripts/materialSequencer.js", "script": "qrc:///serverless/Scripts/materialSequencer.js",
"scriptTimestamp": 1601250646975, "scriptTimestamp": 1601250646975,
"materialURL": "./gradientMaterial.json", "materialURL": "materialData",
"priority": 3, "priority": 3,
"parentMaterialName": "[mat::move]", "parentMaterialName": "[mat::move]",
"materialMappingPos": { "materialMappingPos": {
"x": 0.265625, "x": 0.265625,
"y": 0 "y": 0
}, },
"materialData": "{\"materialVersion\":1,\"materials\":[{\"name\":\"moveMaterial\",\"model\":\"hifi_pbr\",\"opacity\":0.8,\"albedo\":[1,1,1],\"roughness\":1,\"metallic\":0,\"emissive\":[0,0,0],\"scattering\":0,\"unlit\":false,\"emissiveMap\":\"./Textures/gradient1.jpg\",\"albedoMap\":\"./Textures/gradient1.jpg\",\"opacityMapMode\":\"OPACITY_MAP_BLEND\",\"cullFaceMode\":\"CULL_NONE\",\"defaultFallthrough\":false}]}", "materialData": "{\"materialVersion\":1,\"materials\":[{\"name\":\"moveMaterial\",\"model\":\"hifi_pbr\",\"opacity\":0.8,\"albedo\":[1,1,1],\"roughness\":1,\"metallic\":0,\"emissive\":[0,0,0],\"scattering\":0,\"unlit\":false,\"emissiveMap\":\"qrc:///serverless/Textures/gradient1.jpg\",\"albedoMap\":\"qrc:///serverless/Textures/gradient1.jpg\",\"opacityMapMode\":\"OPACITY_MAP_BLEND\",\"cullFaceMode\":\"CULL_NONE\",\"defaultFallthrough\":false}]}",
"clientOnly": false, "clientOnly": false,
"avatarEntity": false, "avatarEntity": false,
"localEntity": false, "localEntity": false,
@ -2187,7 +2187,7 @@
"damping": 0, "damping": 0,
"angularDamping": 0, "angularDamping": 0,
"shapeType": "static-mesh", "shapeType": "static-mesh",
"modelURL": "./Models/Planter.glb", "modelURL": "qrc:///serverless/Models/Planter.glb",
"blendshapeCoefficients": "{\n}\n", "blendshapeCoefficients": "{\n}\n",
"animation": { "animation": {
"allowTranslation": false "allowTranslation": false

File diff suppressed because it is too large Load diff