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 */
//
// soundEmitter_localfile.js
// soundEmitter.js
//
// Created by Zach Fox on 2019-07-05
// modified for relative path by Silverfish 2021
// Copyright High Fidelity 2019
//
// Licensed under the Apache 2.0 License
@ -12,7 +11,7 @@
(function() {
var that;
var SOUND_EMITTER_UPDATE_INTERVAL_MS = 5000;
var SOUND_EMITTER_UPDATE_INTERVAL_MS = 500;
var DEFAULT_AUDIO_INJECTOR_OPTIONS = {
"position": {
"x": 0,
@ -21,7 +20,7 @@
},
"volume": 0.5,
"loop": false,
"localOnly": true
"localOnly": false
};
@ -42,7 +41,7 @@
that.entityID = entityID;
var properties = Entities.getEntityProperties(that.entityID, ["userData"]);
var userData;
try {
@ -50,14 +49,10 @@
} catch (e) {
console.error("Error parsing userData: ", e);
}
if (userData) {
if (userData.soundURL && userData.soundURL.length > 0) {
//----I added script resolve here---
localSoundURL = Script.resolvePath(userData.soundURL);
print("New Local sound url: ", localSoundURL);
that.handleNewSoundURL(localSoundURL);
//that.handleNewSoundURL(userData.soundURL);
that.handleNewSoundURL(userData.soundURL);
} else {
console.log("Please specify this entity's `userData`! See README.md for instructions.");
return;
@ -103,8 +98,8 @@
handleNewSoundURL: function(newSoundURL) {
that.clearCurrentSoundData();
that.soundObjectURL = newSoundURL;
print(newSoundURL);
that.soundObject = SoundCache.getSound(that.soundObjectURL);
if (that.soundObject.downloaded) {
@ -138,15 +133,10 @@
var shouldRestartPlayback = false;
var newPosition = properties.position;
//---I added script resolve here---
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...");
localSoundURL = Script.resolvePath(userData.soundURL);
print("New Local sound url: ", localSoundURL);
that.handleNewSoundURL(localSoundURL);
//that.handleNewSoundURL(userData.soundURL);
that.handleNewSoundURL(userData.soundURL);
return;
}
@ -177,11 +167,11 @@
var localOnly = that.audioInjectorOptions.localOnly;
// 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.
localOnly = true;
// 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.
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,
"collisionless": true,
"ignoreForCollisions": true,
"script": "./Scripts/wizardLoader.js",
"script": "qrc:///serverless/Scripts/wizardLoader.js",
"color": {
"red": 0,
"green": 180,
@ -108,9 +108,9 @@
"ignoreForCollisions": true,
"collisionMask": 0,
"collidesWith": "",
"script": "./Scripts/mirrorClient.js",
"script": "qrc:///serverless/Scripts/mirrorClient.js",
"scriptTimestamp": 1601084665601,
"modelURL": "./Models/mirror_without_backface.baked.fbx",
"modelURL": "qrc:///serverless/Models/mirror_without_backface.baked.fbx",
"blendshapeCoefficients": "{\n}\n",
"clientOnly": false,
"avatarEntity": false,
@ -240,10 +240,10 @@
"damping": 0,
"angularDamping": 0,
"shapeType": "simple-compound",
"modelURL": "./Models/seagull-ANI.fbx",
"modelURL": "qrc:///serverless/Models/seagull-ANI.fbx",
"blendshapeCoefficients": "{\n}\n",
"animation": {
"url": "./Models/seagull-ANI.fbx",
"url": "qrc:///serverless/Models/seagull-ANI.fbx",
"allowTranslation": false,
"currentFrame": 99.81153869628906,
"running": true,
@ -263,7 +263,7 @@
"visible": false,
"name": "Sound Emitter",
"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": {
"x": 0,
"y": 1.0455207824707031,
@ -305,7 +305,7 @@
},
"damping": 0,
"angularDamping": 0,
"script": "./Scripts/soundEmitter_localfile.js",
"script": "qrc:///serverless/Scripts/soundEmitter.js",
"scriptTimestamp": 1601079357399,
"color": {
"red": 0,
@ -366,7 +366,7 @@
},
"damping": 0,
"angularDamping": 0,
"modelURL": "./Models/VircadiaLogo.fbx",
"modelURL": "qrc:///serverless/Models/VircadiaLogo.fbx",
"blendshapeCoefficients": "{\n}\n",
"animation": {
"allowTranslation": false
@ -562,7 +562,7 @@
"damping": 0,
"angularDamping": 0,
"shapeType": "static-mesh",
"modelURL": "./Models/bowl2.fbx",
"modelURL": "qrc:///serverless/Models/bowl2.fbx",
"blendshapeCoefficients": "{\n}\n",
"animation": {
"allowTranslation": false
@ -628,7 +628,7 @@
"blue": 143
},
"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,
"lifespan": 2,
"emitRate": 47,
@ -739,7 +739,7 @@
"angularDamping": 0,
"shapeType": "ellipsoid",
"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,
"lifespan": 3.069999933242798,
"emitSpeed": 0.4000000059604645,
@ -888,7 +888,7 @@
"damping": 0,
"angularDamping": 0,
"shapeType": "static-mesh",
"modelURL": "./Models/dome2_glass.glb",
"modelURL": "qrc:///serverless/Models/dome2_glass.glb",
"blendshapeCoefficients": "{\n}\n",
"animation": {
"allowTranslation": false
@ -947,7 +947,7 @@
},
"damping": 0,
"angularDamping": 0,
"modelURL": "./Models/Trees1.glb",
"modelURL": "qrc:///serverless/Models/Trees1.glb",
"blendshapeCoefficients": "{\n}\n",
"animation": {
"allowTranslation": false
@ -1006,11 +1006,11 @@
},
"damping": 0,
"angularDamping": 0,
"modelURL": "./Models/Stands.fbx",
"modelURL": "qrc:///serverless/Models/Stands.fbx",
"blendshapeCoefficients": "{\n}\n",
"useOriginalPivot": true,
"animation": {
"url": "./Models/Stands.fbx",
"url": "qrc:///serverless/Models/Stands.fbx",
"allowTranslation": false,
"currentFrame": 68342.515625,
"running": true
@ -1072,7 +1072,7 @@
"collidesWith": "static,dynamic,kinematic,otherAvatar,",
"damping": 0,
"angularDamping": 0,
"script": "./Scripts/portal.js",
"script": "qrc:///serverless/Scripts/portal.js",
"scriptTimestamp": 1617134674001,
"color": {
"red": 0,
@ -1198,7 +1198,7 @@
"damping": 0,
"angularDamping": 0,
"shapeType": "static-mesh",
"modelURL": "./Models/dome2.glb",
"modelURL": "qrc:///serverless/Models/dome2.glb",
"blendshapeCoefficients": "{\n}\n",
"animation": {
"allowTranslation": false
@ -1258,7 +1258,7 @@
"angularDamping": 0,
"scriptTimestamp": 1598912452582,
"shapeType": "static-mesh",
"modelURL": "./Models/temple5.glb",
"modelURL": "qrc:///serverless/Models/temple5.glb",
"blendshapeCoefficients": "{\n}\n",
"animation": {
"allowTranslation": false
@ -1528,7 +1528,7 @@
},
"ambientLight": {
"ambientIntensity": 0.8999999761581421,
"ambientURL": "./Textures/galaxySkybox.png"
"ambientURL": "qrc:///serverless/Textures/galaxySkybox.png"
},
"skybox": {
"color": {
@ -1536,7 +1536,7 @@
"green": 235,
"blue": 235
},
"url": "./Textures/galaxySkybox.png"
"url": "qrc:///serverless/Textures/galaxySkybox.png"
},
"haze": {
"hazeRange": 50,
@ -1681,7 +1681,7 @@
"w": 1
}
},
"script": "./Scripts/mirrorReflection.js",
"script": "qrc:///serverless/Scripts/mirrorReflection.js",
"scriptTimestamp": 1601084668318,
"shapeType": "box",
"clientOnly": false,
@ -1921,16 +1921,16 @@
},
"collisionMask": 23,
"collidesWith": "static,dynamic,kinematic,otherAvatar,",
"script": "./Scripts/materialSequencer.js",
"script": "qrc:///serverless/Scripts/materialSequencer.js",
"scriptTimestamp": 1601250646975,
"materialURL": "./gradientMaterial.json",
"materialURL": "materialData",
"priority": 3,
"parentMaterialName": "[mat::move]",
"materialMappingPos": {
"x": 0.265625,
"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,
"avatarEntity": false,
"localEntity": false,
@ -2187,7 +2187,7 @@
"damping": 0,
"angularDamping": 0,
"shapeType": "static-mesh",
"modelURL": "./Models/Planter.glb",
"modelURL": "qrc:///serverless/Models/Planter.glb",
"blendshapeCoefficients": "{\n}\n",
"animation": {
"allowTranslation": false

File diff suppressed because it is too large Load diff