From d3a97832a34273d2b320824565eba43dbed1fc52 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Mon, 21 Sep 2020 00:14:22 -0400 Subject: [PATCH] Update the rest of non /script-archive/ script URLs. --- scripts/developer/accelerationFilterApp.js | 6 +++--- scripts/developer/automaticLookAt.js | 4 ++-- scripts/developer/exponentialFilterApp.js | 6 +++--- scripts/developer/facialExpressions.js | 4 ++-- scripts/developer/tests/agentAPITest.js | 2 +- .../developer/tests/avatarAttachmentTest.js | 18 +++++++++--------- .../batonSoundTestEntityScript.js | 2 +- .../developer/tests/filtered-puck-attach.js | 8 ++++---- scripts/developer/tests/injectorTest.js | 2 +- .../tests/performance/domain-check.js | 10 +++++----- .../tests/performance/rayPickPerformance.js | 2 +- scripts/developer/tests/performance/summon.js | 10 +++++----- scripts/developer/tests/puck-attach.js | 8 ++++---- .../rapidProceduralChangeTest.js | 4 ++-- .../developer/tests/scriptableResource/lib.js | 2 +- scripts/developer/tests/skybox/skyboxTest.js | 2 +- .../developer/tests/tabletEventBridgeTest.js | 10 +++++----- .../utilities/tools/disableAvatarAnimations.js | 2 +- .../utilities/workload/test_physics_scene.js | 2 +- scripts/system/audio.js | 2 +- scripts/system/avatarFinderBeacon.js | 4 ++-- scripts/system/commerce/wallet.js | 2 +- .../controllerModules/equipEntity.js | 2 +- scripts/system/controllers/grab.js | 4 ++-- scripts/system/libraries/WebTablet.js | 2 +- .../system/libraries/networkingConstants.js | 4 ++-- scripts/system/makeUserConnection.js | 8 ++++---- scripts/system/menu.js | 2 +- scripts/system/snapshot.js | 2 +- scripts/system/tablet-users.js | 2 +- scripts/tutorials/createFloatingLanternBox.js | 4 ++-- scripts/tutorials/createTetherballStick.js | 6 +++--- .../tutorials/entity_scripts/ambientSound.js | 2 +- scripts/tutorials/entity_scripts/flashlight.js | 6 +++--- .../entity_scripts/floatingLanternBox.js | 2 +- scripts/tutorials/entity_scripts/sit.js | 2 +- scripts/tutorials/nBody.js | 4 ++-- .../DomainContent/Cupcake/eatable.js | 2 +- .../DomainContent/Toybox/doll/doll.js | 2 +- .../Toybox/flashlight/flashlight.js | 2 +- .../DomainContent/Toybox/pistol/pistol.js | 2 +- .../marketplace/blocks/blocksApp.js | 6 +++--- .../marketplace/boppo/boppoClownEntity.js | 3 +-- .../marketplace/boppo/boppoServer.js | 17 ++++++++--------- .../marketplace/boppo/clownGloveDispenser.js | 4 ++-- .../marketplace/boppo/createElBoppo.js | 9 ++++----- .../marketplace/dart/createDart.js | 2 +- unpublishedScripts/marketplace/dart/dart.js | 2 +- .../marketplace/emoji-tablet/emojiTablet.js | 6 +++--- .../gameTable/games/deckOfCards/deckOfCards.js | 4 ++-- .../gameTable/games/deckOfCards/playingCard.js | 6 +++--- .../marketplace/shortbow/enemyClientEntity.js | 2 +- 52 files changed, 115 insertions(+), 118 deletions(-) diff --git a/scripts/developer/accelerationFilterApp.js b/scripts/developer/accelerationFilterApp.js index a2ef937e52..adda9d216e 100644 --- a/scripts/developer/accelerationFilterApp.js +++ b/scripts/developer/accelerationFilterApp.js @@ -82,13 +82,13 @@ var mappingJson = { // var TABLET_BUTTON_NAME = "ACCFILT"; -var HTML_URL = "https://s3.amazonaws.com/hifi-public/tony/html/accelerationFilterApp.html?2"; +var HTML_URL = ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/html/accelerationFilterApp.html?2"); var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var tabletButton = tablet.addButton({ text: TABLET_BUTTON_NAME, - icon: "https://s3.amazonaws.com/hifi-public/tony/icons/tpose-i.svg", - activeIcon: "https://s3.amazonaws.com/hifi-public/tony/icons/tpose-a.svg" + icon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/tpose-i.svg"), + activeIcon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/tpose-a.svg") }); tabletButton.clicked.connect(function () { diff --git a/scripts/developer/automaticLookAt.js b/scripts/developer/automaticLookAt.js index 542d0df0d8..7778fcef55 100644 --- a/scripts/developer/automaticLookAt.js +++ b/scripts/developer/automaticLookAt.js @@ -39,8 +39,8 @@ var LookAtDebugger = function() { var self = this; var IMAGE_DIMENSIONS = {x: 0.2, y: 0.2, z:0.2}; - var TARGET_ICON_PATH = "https://hifi-content.s3.amazonaws.com/luis/test_scripts/LookAtApp/eyeFocus.png"; - var INFINITY_ICON_PATH = "https://hifi-content.s3.amazonaws.com/luis/test_scripts/LookAtApp/noFocus.png"; + var TARGET_ICON_PATH = ExternalResource.getUrl(ExternalResource.HF_Content, "/luis/test_scripts/LookAtApp/eyeFocus.png"); + var INFINITY_ICON_PATH = ExternalResource.getUrl(ExternalResource.HF_Content, "/luis/test_scripts/LookAtApp/noFocus.png"); this.items = {}; this.active = false; diff --git a/scripts/developer/exponentialFilterApp.js b/scripts/developer/exponentialFilterApp.js index 774ea95533..99717bfccc 100644 --- a/scripts/developer/exponentialFilterApp.js +++ b/scripts/developer/exponentialFilterApp.js @@ -89,13 +89,13 @@ var mappingJson = { // var TABLET_BUTTON_NAME = "EXPFILT"; -var HTML_URL = "https://s3.amazonaws.com/hifi-public/tony/html/exponentialFilterApp.html?7"; +var HTML_URL = ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/html/exponentialFilterApp.html?7"); var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var tabletButton = tablet.addButton({ text: TABLET_BUTTON_NAME, - icon: "https://s3.amazonaws.com/hifi-public/tony/icons/tpose-i.svg", - activeIcon: "https://s3.amazonaws.com/hifi-public/tony/icons/tpose-a.svg" + icon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/tpose-i.svg"), + activeIcon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/tpose-a.svg") }); tabletButton.clicked.connect(function () { diff --git a/scripts/developer/facialExpressions.js b/scripts/developer/facialExpressions.js index 37a4f4f796..24392976a6 100644 --- a/scripts/developer/facialExpressions.js +++ b/scripts/developer/facialExpressions.js @@ -20,8 +20,8 @@ var TRANSITION_TIME_SECONDS = 0.25; var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); - var icon = "https://hifi-content.s3.amazonaws.com/elisalj/emoji_scripts/icons/emoji-i.svg"; - var activeIcon = "https://hifi-content.s3.amazonaws.com/elisalj/emoji_scripts/icons/emoji-a.svg"; + var icon = ExternalResource.getUrl(ExternalResource.HF_Content, "/elisalj/emoji_scripts/icons/emoji-i.svg"); + var activeIcon = ExternalResource.getUrl(ExternalResource.HF_Content, "/elisalj/emoji_scripts/icons/emoji-a.svg"); var isActive = true; var controllerMappingName; diff --git a/scripts/developer/tests/agentAPITest.js b/scripts/developer/tests/agentAPITest.js index b7d21efbdf..f9d9d53ae0 100644 --- a/scripts/developer/tests/agentAPITest.js +++ b/scripts/developer/tests/agentAPITest.js @@ -7,7 +7,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -var SOUND_DATA = { url: "http://hifi-content.s3.amazonaws.com/howard/sounds/piano1.wav" }; +var SOUND_DATA = { url: ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/sounds/piano1.wav") }; // getSound function from crowd-agent.js function getSound(data, callback) { // callback(sound) when downloaded (which may be immediate). diff --git a/scripts/developer/tests/avatarAttachmentTest.js b/scripts/developer/tests/avatarAttachmentTest.js index b9dfcf9596..9c3756ef36 100644 --- a/scripts/developer/tests/avatarAttachmentTest.js +++ b/scripts/developer/tests/avatarAttachmentTest.js @@ -76,20 +76,20 @@ var buttonPositionX = windowDimensions.x - BUTTON_PADDING - BUTTON_WIDTH; var buttonPositionY = (windowDimensions.y - BUTTON_HEIGHT) / 2 - (BUTTON_HEIGHT + BUTTON_PADDING); var hatButton = new ToggleButtonBuddy(buttonPositionX, buttonPositionY, BUTTON_WIDTH, BUTTON_HEIGHT, { - up: "https://s3.amazonaws.com/hifi-public/tony/icons/hat-up.svg", - down: "https://s3.amazonaws.com/hifi-public/tony/icons/hat-down.svg" + up: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/hat-up.svg"), + down: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/hat-down.svg") }); buttonPositionY += BUTTON_HEIGHT + BUTTON_PADDING; var coatButton = new ToggleButtonBuddy(buttonPositionX, buttonPositionY, BUTTON_WIDTH, BUTTON_HEIGHT, { - up: "https://s3.amazonaws.com/hifi-public/tony/icons/coat-up.svg", - down: "https://s3.amazonaws.com/hifi-public/tony/icons/coat-down.svg" + up: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/coat-up.svg"), + down: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/coat-down.svg") }); buttonPositionY += BUTTON_HEIGHT + BUTTON_PADDING; var coatButton2 = new ToggleButtonBuddy(buttonPositionX, buttonPositionY, BUTTON_WIDTH, BUTTON_HEIGHT, { - up: "https://s3.amazonaws.com/hifi-public/tony/icons/coat-up.svg", - down: "https://s3.amazonaws.com/hifi-public/tony/icons/coat-down.svg" + up: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/coat-up.svg"), + down: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/coat-down.svg") }); var AVATAR_ATTACHMENT = 0; @@ -97,7 +97,7 @@ var AVATAR_SOFT_ATTACHMENT = 1; var ENTITY_ATTACHMENT = 2; var HAT_ATTACHMENT = { - modelURL: "https://s3.amazonaws.com/hifi-public/tony/cowboy-hat.fbx", + modelURL: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/cowboy-hat.fbx"), jointName: "Head", translation: {"x": 0, "y": 0.25, "z": 0.03}, rotation: {"x": 0, "y": 0, "z": 0, "w": 1}, @@ -106,7 +106,7 @@ var HAT_ATTACHMENT = { }; var COAT_ATTACHMENT = { - modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/clothes/coat/coat_rig.fbx", + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, "/ozan/dev/clothes/coat/coat_rig.fbx"), jointName: "Hips", translation: {"x": 0, "y": 0, "z": 0}, rotation: {"x": 0, "y": 0, "z": 0, "w": 1}, @@ -115,7 +115,7 @@ var COAT_ATTACHMENT = { }; var COAT_ENTITY_ATTACHMENT = { - modelURL: "https://hifi-content.s3.amazonaws.com/ozan/dev/clothes/coat/coat_rig.fbx", + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, "/ozan/dev/clothes/coat/coat_rig.fbx"), jointName: "Hips", translation: {"x": 0, "y": 0, "z": 0}, rotation: {"x": 0, "y": 0, "z": 0, "w": 1}, diff --git a/scripts/developer/tests/batonSoundEntityTest/batonSoundTestEntityScript.js b/scripts/developer/tests/batonSoundEntityTest/batonSoundTestEntityScript.js index 910378e04e..2075937c4b 100644 --- a/scripts/developer/tests/batonSoundEntityTest/batonSoundTestEntityScript.js +++ b/scripts/developer/tests/batonSoundEntityTest/batonSoundTestEntityScript.js @@ -7,7 +7,7 @@ var _this; BatonSoundEntity = function() { _this = this; - _this.drumSound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/Drums/deepdrum1.wav"); + _this.drumSound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Public, "/sounds/Drums/deepdrum1.wav")); _this.injectorOptions = {position: MyAvatar.position, loop: false, volume: 1}; _this.soundIntervalConnected = false; _this.batonDebugModel = Entities.addEntity({ diff --git a/scripts/developer/tests/filtered-puck-attach.js b/scripts/developer/tests/filtered-puck-attach.js index ad9b17a0e4..907442ac84 100644 --- a/scripts/developer/tests/filtered-puck-attach.js +++ b/scripts/developer/tests/filtered-puck-attach.js @@ -17,14 +17,14 @@ Script.include("/~/system/libraries/Xform.js"); (function() { // BEGIN LOCAL_SCOPE var TABLET_BUTTON_NAME = "PUCKATTACH"; -var TABLET_APP_URL = "https://s3.amazonaws.com/hifi-public/tony/html/filtered-puck-attach.html?2"; +var TABLET_APP_URL = ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/html/filtered-puck-attach.html?2"); var NUM_TRACKED_OBJECTS = 16; var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var tabletButton = tablet.addButton({ text: TABLET_BUTTON_NAME, - icon: "https://s3.amazonaws.com/hifi-public/tony/icons/puck-i.svg", - activeIcon: "https://s3.amazonaws.com/hifi-public/tony/icons/puck-a.svg" + icon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/puck-i.svg"), + activeIcon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/puck-a.svg") }); var shown = false; @@ -87,7 +87,7 @@ function entityExists(entityID) { return Object.keys(Entities.getEntityProperties(entityID)).length > 0; } -var VIVE_PUCK_MODEL = "https://s3.amazonaws.com/hifi-public/tony/vive_tracker_puck_y180z180.obj"; +var VIVE_PUCK_MODEL = ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/vive_tracker_puck_y180z180.obj"); var VIVE_PUCK_DIMENSIONS = { x: 0.0945, y: 0.0921, z: 0.0423 }; // 1/1000th scale of model var VIVE_PUCK_SEARCH_DISTANCE = 1.5; // metres var VIVE_PUCK_SPAWN_DISTANCE = 0.5; // metres diff --git a/scripts/developer/tests/injectorTest.js b/scripts/developer/tests/injectorTest.js index 171186c91e..a1844f4cae 100644 --- a/scripts/developer/tests/injectorTest.js +++ b/scripts/developer/tests/injectorTest.js @@ -9,7 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var soundURL = "http://hifi-public.s3.amazonaws.com/birarda/medium-crowd.wav"; +var soundURL = ExternalResource.getUrl(ExternalResource.HF_Public, "/birarda/medium-crowd.wav"); var audioOptions = { position: { x: 0.0, y: 0.0, z: 0.0 }, volume: 0.5 diff --git a/scripts/developer/tests/performance/domain-check.js b/scripts/developer/tests/performance/domain-check.js index c715a2ada8..ec8e6fdbc6 100644 --- a/scripts/developer/tests/performance/domain-check.js +++ b/scripts/developer/tests/performance/domain-check.js @@ -26,12 +26,12 @@ var MINIMUM_AVATARS = 25; // changeable by prompt var SPREAD_TIME_MS = 500; var DENSITY = 0.3; // square meters per person. Some say 10 sq ft is arm's length (0.9m^2), 4.5 is crowd (0.4m^2), 2.5 is mosh pit (0.2m^2). -var SOUND_DATA = {url: "http://hifi-content.s3.amazonaws.com/howard/sounds/piano1.wav"}; +var SOUND_DATA = {url: ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/sounds/piano1.wav"}; var AVATARS_CHATTERING_AT_ONCE = 4; // How many of the agents should we request to play SOUND at once. var NEXT_SOUND_SPREAD = 500; // millisecond range of how long to wait after one sound finishes, before playing the next var ANIMATION_DATA = { - "url": "http://hifi-content.s3.amazonaws.com/howard/resources/avatar/animations/idle.fbx", - // "url": "http://hifi-content.s3.amazonaws.com/howard/resources/avatar/animations/walk_fwd.fbx", // alternative example + "url": ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/resources/avatar/animations/idle.fbx"), + // "url": ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/resources/avatar/animations/walk_fwd.fbx"), // alternative example "startFrame": 0.0, "endFrame": 300.0, "timeScale": 1.0, @@ -128,7 +128,7 @@ function messageHandler(channel, messageString, senderID) { orientation: Quat.fromPitchYawRollDegrees(0, Quat.safeEulerAngles(MyAvatar.orientation).y + (turnSpread * (Math.random() - 0.5)), 0), soundData: chatter && SOUND_DATA, listen: true, - skeletonModelURL: "http://hifi-content.s3.amazonaws.com/howard/resources/meshes/defaultAvatar_full.fst", + skeletonModelURL: ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/resources/meshes/defaultAvatar_full.fst"), animationData: ANIMATION_DATA }); } @@ -278,7 +278,7 @@ function doRender(continuation) { if (MINIMUM_AVATARS && !fail) { if (0 === summonedAgents.length) { fail = "FAIL: No agents reported.\nPlease run " + MINIMUM_AVATARS + " instances of\n\ -http://hifi-content.s3.amazonaws.com/howard/scripts/tests/performance/crowd-agent.js?v=3\n\ +https://cdn-1.vircadia.com/eu-c-1/howard/scripts/tests/performance/crowd-agent.js?v=3\n\ on your domain server."; } else if (total < MINIMUM_AVATARS) { fail = "FAIL: Only " + summonedAgents.length + " agents reported. Now missing " + (MINIMUM_AVATARS - total) + " avatars, total."; diff --git a/scripts/developer/tests/performance/rayPickPerformance.js b/scripts/developer/tests/performance/rayPickPerformance.js index 92d12c0e71..ff6ad28eda 100644 --- a/scripts/developer/tests/performance/rayPickPerformance.js +++ b/scripts/developer/tests/performance/rayPickPerformance.js @@ -22,7 +22,7 @@ var EXPECTED_INTERSECTIONS = 1286 * OUTER_LOOPS; var center = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getFront(Camera.getOrientation()))); -var model_url = "http://hifi-content.s3.amazonaws.com/caitlyn/production/Scansite/buddhaReduced.fbx"; +var model_url = ExternalResource.getUrl(ExternalResource.HF_Content, "/caitlyn/production/Scansite/buddhaReduced.fbx"); var rayPickOverlays = Array(); diff --git a/scripts/developer/tests/performance/summon.js b/scripts/developer/tests/performance/summon.js index 663a549a2a..88f9f4ca8b 100644 --- a/scripts/developer/tests/performance/summon.js +++ b/scripts/developer/tests/performance/summon.js @@ -31,11 +31,11 @@ debug('startup seeking:', MINIMUM_AVATARS, 'listening:', N_LISTENING, 'chatterin var SPREAD_TIME_MS = 500; var DENSITY = 0.3; // square meters per person. Some say 10 sq ft is arm's length (0.9m^2), 4.5 is crowd (0.4m^2), 2.5 is mosh pit (0.2m^2). -var SOUND_DATA = {url: "http://hifi-content.s3.amazonaws.com/howard/sounds/piano1.wav"}; +var SOUND_DATA = {url: ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/sounds/piano1.wav")}; var NEXT_SOUND_SPREAD = 500; // millisecond range of how long to wait after one sound finishes, before playing the next var ANIMATION_DATA = { - "url": "http://hifi-content.s3.amazonaws.com/howard/resources/avatar/animations/idle.fbx", - // "url": "http://hifi-content.s3.amazonaws.com/howard/resources/avatar/animations/walk_fwd.fbx", // alternative example + "url": ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/resources/avatar/animations/idle.fbx"), + // "url": ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/resources/avatar/animations/walk_fwd.fbx"), // alternative example "startFrame": 0.0, "endFrame": 300.0, "timeScale": 1.0, @@ -100,7 +100,7 @@ function messageHandler(channel, messageString, senderID) { orientation: Quat.fromPitchYawRollDegrees(0, Quat.safeEulerAngles(MyAvatar.orientation).y + (turnSpread * (Math.random() - 0.5)), 0), soundData: chatter && SOUND_DATA, listen: listen, - skeletonModelURL: "http://hifi-content.s3.amazonaws.com/howard/resources/meshes/defaultAvatar_full.fst", + skeletonModelURL: ExternalResource.getUrl(ExternalResource.HF_Content, "/howard/resources/meshes/defaultAvatar_full.fst"), animationData: ANIMATION_DATA }); } @@ -148,7 +148,7 @@ Script.setTimeout(function () { var total = AvatarList.getAvatarIdentifiers().length; if (0 === summonedAgents.length) { Window.alert("No agents reported.\n\Please run " + MINIMUM_AVATARS + " instances of\n\ -http://hifi-content.s3.amazonaws.com/howard/scripts/tests/performance/crowd-agent.js?v=someDate\n\ +https://cdn-1.vircadia.com/eu-c-1/howard/scripts/tests/performance/crowd-agent.js?v=someDate\n\ on your domain server."); } else if (total < MINIMUM_AVATARS) { Window.alert("Only " + summonedAgents.length + " agents reported. Now missing " + (MINIMUM_AVATARS - total) + " avatars, total."); diff --git a/scripts/developer/tests/puck-attach.js b/scripts/developer/tests/puck-attach.js index 019a911535..ca057fc8c4 100644 --- a/scripts/developer/tests/puck-attach.js +++ b/scripts/developer/tests/puck-attach.js @@ -17,13 +17,13 @@ Script.include("/~/system/libraries/Xform.js"); (function() { // BEGIN LOCAL_SCOPE var TABLET_BUTTON_NAME = "PUCKTACH"; -var TABLET_APP_URL = "https://hifi-content.s3.amazonaws.com/seefo/production/puck-attach/puck-attach.html"; +var TABLET_APP_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/seefo/production/puck-attach/puck-attach.html"); var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var tabletButton = tablet.addButton({ text: TABLET_BUTTON_NAME, - icon: "https://s3.amazonaws.com/hifi-public/tony/icons/puck-i.svg", - activeIcon: "https://s3.amazonaws.com/hifi-public/tony/icons/puck-a.svg" + icon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/puck-i.svg"), + activeIcon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/puck-a.svg") }); var shown = false; @@ -85,7 +85,7 @@ function entityExists(entityID) { return Object.keys(Entities.getEntityProperties(entityID)).length > 0; } -var VIVE_PUCK_MODEL = "https://s3.amazonaws.com/hifi-public/tony/vive_tracker_puck_y180z180.obj"; +var VIVE_PUCK_MODEL = ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/vive_tracker_puck_y180z180.obj"); var VIVE_PUCK_DIMENSIONS = { x: 0.0945, y: 0.0921, z: 0.0423 }; // 1/1000th scale of model var VIVE_PUCK_SEARCH_DISTANCE = 1.5; // metres var VIVE_PUCK_SPAWN_DISTANCE = 0.5; // metres diff --git a/scripts/developer/tests/rapidProceduralChange/rapidProceduralChangeTest.js b/scripts/developer/tests/rapidProceduralChange/rapidProceduralChangeTest.js index e28a7b01e2..e4d9619abd 100644 --- a/scripts/developer/tests/rapidProceduralChange/rapidProceduralChangeTest.js +++ b/scripts/developer/tests/rapidProceduralChange/rapidProceduralChangeTest.js @@ -25,8 +25,8 @@ centerUp.y += 0.5; var centerDown = Vec3.sum(MyAvatar.position, Vec3.multiply(3, Quat.getForward(orientation))); centerDown.y -= 0.5; -var ENTITY_SHADER_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/shaders/uniformTest.fs"; -var SKYBOX_SHADER_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/shaders/timerTest.fs"; +var ENTITY_SHADER_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/eric/shaders/uniformTest.fs"); +var SKYBOX_SHADER_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/eric/shaders/timerTest.fs"); var entityData = { ProceduralEntity: { diff --git a/scripts/developer/tests/scriptableResource/lib.js b/scripts/developer/tests/scriptableResource/lib.js index 255b3bd036..bb8dc6a713 100644 --- a/scripts/developer/tests/scriptableResource/lib.js +++ b/scripts/developer/tests/scriptableResource/lib.js @@ -56,7 +56,7 @@ function getFrame(callback) { function prefetch(callback) { // A folder full of individual frames. - var MOVIE_URL = "http://hifi-content.s3.amazonaws.com/james/vidtest/"; + var MOVIE_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/james/vidtest/"); var frames = []; diff --git a/scripts/developer/tests/skybox/skyboxTest.js b/scripts/developer/tests/skybox/skyboxTest.js index 76d80ab153..e0b95a34c7 100644 --- a/scripts/developer/tests/skybox/skyboxTest.js +++ b/scripts/developer/tests/skybox/skyboxTest.js @@ -27,7 +27,7 @@ var PX_RGBA_URL = Script.resolvePath('px_rgba.fs'); var PX_TEX_URL = Script.resolvePath('px_tex.fs'); var PX_TEX_RGBA_URL = Script.resolvePath('px_tex_rgba.fs'); -var TEX_URL = 'https://hifi-public.s3.amazonaws.com/alan/Playa/Skies/Test-Sky_out.png'; +var TEX_URL = ExternalResource.getUrl(ExternalResource.HF_Public, "/alan/Playa/Skies/Test-Sky_out.png"); var NO_TEX = ''; var COLOR = { red: 255, green: 0, blue: 255 }; diff --git a/scripts/developer/tests/tabletEventBridgeTest.js b/scripts/developer/tests/tabletEventBridgeTest.js index 83031741fc..7b58aa45c1 100644 --- a/scripts/developer/tests/tabletEventBridgeTest.js +++ b/scripts/developer/tests/tabletEventBridgeTest.js @@ -17,13 +17,13 @@ var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var tabletButton = tablet.addButton({ text: "SOUNDS", - icon: "http://s3.amazonaws.com/hifi-public/tony/icons/trombone-i.png", - activeIcon: "http://s3.amazonaws.com/hifi-public/tony/icons/trombone-a.png" + icon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/trombone-i.png"), + activeIcon: ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/icons/trombone-a.png") }); -var WEB_BRIDGE_TEST_HTML = "https://s3.amazonaws.com/hifi-public/tony/webBridgeTest.html?2"; -var TROMBONE_URL = "https://s3.amazonaws.com/hifi-public/tony/audio/sad-trombone.wav"; -var SCREAM_URL = "https://s3.amazonaws.com/hifi-public/tony/audio/wilhelm-scream.wav"; +var WEB_BRIDGE_TEST_HTML = ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/webBridgeTest.html?2"); +var TROMBONE_URL = ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/audio/sad-trombone.wav"); +var SCREAM_URL = ExternalResource.getUrl(ExternalResource.HF_Public, "/tony/audio/wilhelm-scream.wav"); tabletButton.clicked.connect(function () { if (shown) { diff --git a/scripts/developer/utilities/tools/disableAvatarAnimations.js b/scripts/developer/utilities/tools/disableAvatarAnimations.js index fc3415fb80..ed524491e6 100644 --- a/scripts/developer/utilities/tools/disableAvatarAnimations.js +++ b/scripts/developer/utilities/tools/disableAvatarAnimations.js @@ -15,7 +15,7 @@ var skeletonModelURL = ""; var jointCount = 0; var excludedRoles = ["rightHandGraspOpen", "rightHandGraspClosed", "leftHandGraspOpen", "leftHandGraspClosed"]; -var IDLE_URL = "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/idle.fbx"; +var IDLE_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/ozan/dev/anim/standard_anims_160127/idle.fbx"); function overrideAnims() { var roles = MyAvatar.getAnimationRoles(); diff --git a/scripts/developer/utilities/workload/test_physics_scene.js b/scripts/developer/utilities/workload/test_physics_scene.js index e923bd0fea..833bbf10a1 100644 --- a/scripts/developer/utilities/workload/test_physics_scene.js +++ b/scripts/developer/utilities/workload/test_physics_scene.js @@ -85,7 +85,7 @@ function addObject(a, b, c, lifetime) { rotation: stageOrientation, dimensions: OBJECT_DIM, lifetime: (lifetime === undefined) ? DEFAULT_LIFETIME : lifetime, - modelURL: "https://hifi-content.s3.amazonaws.com/jimi/props/cones/trafficCone.fbx", + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, "/jimi/props/cones/trafficCone.fbx"), shapeType:shapeTypes[4], dynamic: true, gravity:{"x":0,"y":-9.8,"z":0}, diff --git a/scripts/system/audio.js b/scripts/system/audio.js index a161b40ffd..5727f78a35 100644 --- a/scripts/system/audio.js +++ b/scripts/system/audio.js @@ -14,7 +14,7 @@ (function() { // BEGIN LOCAL_SCOPE var TABLET_BUTTON_NAME = "AUDIO"; -var HOME_BUTTON_TEXTURE = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"; +var HOME_BUTTON_TEXTURE = ExternalResource.getUrl(ExternalResource.HF_Content, "/alan/dev/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"); var AUDIO_QML_SOURCE = "hifi/audio/Audio.qml"; var MUTE_ICONS = { diff --git a/scripts/system/avatarFinderBeacon.js b/scripts/system/avatarFinderBeacon.js index 00f3d15fbb..8679b1427c 100644 --- a/scripts/system/avatarFinderBeacon.js +++ b/scripts/system/avatarFinderBeacon.js @@ -20,8 +20,8 @@ var beacons = {}; // List of .fst files used by AC scripts, that should be ignored in the script in case TRY_TO_IGNORE_AC_AGENTS is enabled var POSSIBLE_AC_AVATARS = [ - 'http://hifi-content.s3.amazonaws.com/ozan/dev/avatars/invisible_avatar/invisible_avatar.fst', - 'http://hifi-content.s3.amazonaws.com/ozan/dev/avatars/camera_man/pod/_latest/camera_man_pod.fst' + ExternalResource.getUrl(ExternalResource.HF_Content, "/ozan/dev/avatars/invisible_avatar/invisible_avatar.fst"), + ExternalResource.getUrl(ExternalResource.HF_Content, "/ozan/dev/avatars/camera_man/pod/_latest/camera_man_pod.fst") ]; AvatarFinderBeacon = function(avatar) { diff --git a/scripts/system/commerce/wallet.js b/scripts/system/commerce/wallet.js index 86806fd8b4..1dac9d111a 100644 --- a/scripts/system/commerce/wallet.js +++ b/scripts/system/commerce/wallet.js @@ -338,7 +338,7 @@ var SEND_MONEY_PARTICLE_PROPERTIES = { radiusSpread: 0, radiusStart: 0.2, speedSpread: 0, - textures: "http://hifi-content.s3.amazonaws.com/alan/dev/Particles/Bokeh-Particle-HFC.png", + textures: ExternalResource.getUrl(ExternalResource.HF_Content, "/alan/dev/Particles/Bokeh-Particle-HFC.png"), type: 'ParticleEffect' }; diff --git a/scripts/system/controllers/controllerModules/equipEntity.js b/scripts/system/controllers/controllerModules/equipEntity.js index 1deb97c20e..0540f8d669 100644 --- a/scripts/system/controllers/controllerModules/equipEntity.js +++ b/scripts/system/controllers/controllerModules/equipEntity.js @@ -20,7 +20,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js"); Script.include("/~/system/libraries/utils.js"); -var DEFAULT_SPHERE_MODEL_URL = "http://hifi-content.s3.amazonaws.com/alan/dev/equip-Fresnel-3.fbx"; +var DEFAULT_SPHERE_MODEL_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/alan/dev/equip-Fresnel-3.fbx"); var EQUIP_SPHERE_SCALE_FACTOR = 0.65; diff --git a/scripts/system/controllers/grab.js b/scripts/system/controllers/grab.js index 0bd2e9df9a..1a3ff052c2 100644 --- a/scripts/system/controllers/grab.js +++ b/scripts/system/controllers/grab.js @@ -164,8 +164,8 @@ var beacon = { }; // TODO: play sounds again when we aren't leaking AudioInjector threads -// var grabSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/eric/sounds/CloseClamp.wav"); -// var releaseSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/eric/sounds/ReleaseClamp.wav"); +// var grabSound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Public, "/eric/sounds/CloseClamp.wav")); +// var releaseSound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Public, "/eric/sounds/ReleaseClamp.wav")); // var VOLUME = 0.0; diff --git a/scripts/system/libraries/WebTablet.js b/scripts/system/libraries/WebTablet.js index 9f2142504c..287cdf0da1 100644 --- a/scripts/system/libraries/WebTablet.js +++ b/scripts/system/libraries/WebTablet.js @@ -37,7 +37,7 @@ var TABLET_NATURAL_DIMENSIONS = {x: 32.083, y: 48.553, z: 2.269}; var HOME_BUTTON_TEXTURE = Script.resourcesPath() + "images/button-close.png"; // var HOME_BUTTON_TEXTURE = Script.resourcesPath() + "meshes/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-close.png"; -// var TABLET_MODEL_PATH = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet-with-home-button.fbx"; +// var TABLET_MODEL_PATH = ExternalResource.getUrl(ExternalResource.HF_Content, "/alan/dev/tablet-with-home-button.fbx"); var LOCAL_TABLET_MODEL_PATH = Script.resourcesPath() + "meshes/tablet-with-home-button-small-bezel.fbx"; var HIGH_PRIORITY = 1; diff --git a/scripts/system/libraries/networkingConstants.js b/scripts/system/libraries/networkingConstants.js index 5c390eec0b..a83d2cb4b4 100644 --- a/scripts/system/libraries/networkingConstants.js +++ b/scripts/system/libraries/networkingConstants.js @@ -10,8 +10,8 @@ var INTERFACE_METADATA_SOURCE = "https://cdn.vircadia.com/dist/launcher/vircadiaMeta.json"; // Base CDN URLs -var CONTENT_CDN_URL = "https://content.highfidelity.com/"; // "https://content.vircadia.com/"; -var PUBLIC_BUCKET_CDN_URL = "http://s3.amazonaws.com/hifi-public/"; +var CONTENT_CDN_URL = ExternalResource.HF_Content; // "https://cdn-1.vircadia.com/" + usCDN; +var PUBLIC_BUCKET_CDN_URL = ExternalResource.HF_Public; var euCDN = "eu-c-1/"; var usCDN = "us-c-1/"; diff --git a/scripts/system/makeUserConnection.js b/scripts/system/makeUserConnection.js index 37d7d898bc..1483b65a9b 100644 --- a/scripts/system/makeUserConnection.js +++ b/scripts/system/makeUserConnection.js @@ -35,8 +35,8 @@ var CONNECTING_TIME = 100; // ms One interval. var PARTICLE_RADIUS = 0.15; // m var PARTICLE_ANGLE_INCREMENT = 360 / 45; // 1hz - var HANDSHAKE_SOUND_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/davidkelly/production/audio/4beat_sweep.wav"; - var SUCCESSFUL_HANDSHAKE_SOUND_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/davidkelly/production/audio/3rdbeat_success_bell.wav"; + var HANDSHAKE_SOUND_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/davidkelly/production/audio/4beat_sweep.wav"); + var SUCCESSFUL_HANDSHAKE_SOUND_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/davidkelly/production/audio/3rdbeat_success_bell.wav"); var PREFERRER_HAND_JOINT_POSTFIX_ORDER = ['Middle1', 'Index1', '']; var HAPTIC_DATA = { initial: { duration: 20, strength: 0.6 }, // duration is in ms @@ -60,7 +60,7 @@ "radiusStart": 0.0025, "emitSpeed": 0.02, "speedSpread": 0.015, - "textures": "http://hifi-content.s3.amazonaws.com/alan/dev/Particles/Bokeh-Particle.png", + "textures": ExternalResource.getUrl(ExternalResource.HF_Content, "/alan/dev/Particles/Bokeh-Particle.png"), "color": {"red": 255, "green": 255, "blue": 255}, "colorFinish": {"red": 0, "green": 164, "blue": 255}, "colorStart": {"red": 255, "green": 255, "blue": 255}, @@ -92,7 +92,7 @@ "radiusStart": 0.04, "speedSpread": 0.00, "radiusSpread": 0.0, - "textures": "http://hifi-content.s3.amazonaws.com/alan/dev/Particles/Bokeh-Particle.png", + "textures": ExternalResource.getUrl(ExternalResource.HF_Content, "/alan/dev/Particles/Bokeh-Particle.png"), "color": {"red": 200, "green": 170, "blue": 255}, "colorFinish": {"red": 0, "green": 134, "blue": 255}, "colorStart": {"red": 185, "green": 222, "blue": 255}, diff --git a/scripts/system/menu.js b/scripts/system/menu.js index d669d3d918..2fbb3d7b0d 100644 --- a/scripts/system/menu.js +++ b/scripts/system/menu.js @@ -13,7 +13,7 @@ /* global Script, HMD, Tablet, Entities */ -var HOME_BUTTON_TEXTURE = "http://hifi-content.s3.amazonaws.com/alan/dev/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"; +var HOME_BUTTON_TEXTURE = ExternalResource.getUrl(ExternalResource.HF_Content, "/alan/dev/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"); // var HOME_BUTTON_TEXTURE = Script.resourcesPath() + "meshes/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"; (function() { diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 3c361b1644..0d60e2331a 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -271,7 +271,7 @@ function onMessage(message) { } var POLAROID_PRINT_SOUND = SoundCache.getSound(Script.resourcesPath() + "sounds/snapshot/sound-print-photo.wav"); -var POLAROID_MODEL_URL = 'http://hifi-content.s3.amazonaws.com/alan/dev/Test/snapshot.fbx'; +var POLAROID_MODEL_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/alan/dev/Test/snapshot.fbx"); var POLAROID_RATE_LIMIT_MS = 1000; var polaroidPrintingIsRateLimited = false; diff --git a/scripts/system/tablet-users.js b/scripts/system/tablet-users.js index 92aefd1e80..af72e951fc 100644 --- a/scripts/system/tablet-users.js +++ b/scripts/system/tablet-users.js @@ -11,7 +11,7 @@ // (function() { // BEGIN LOCAL_SCOPE - var USERS_URL = "https://hifi-content.s3.amazonaws.com/faye/tablet-dev/users.html"; + var USERS_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/faye/tablet-dev/users.html"); var HOME_BUTTON_TEXTURE = Script.resourcesPath() + "meshes/tablet-with-home-button.fbx/tablet-with-home-button.fbm/button-root.png"; var FRIENDS_WINDOW_URL = Account.metaverseServerURL + "/user/friends"; diff --git a/scripts/tutorials/createFloatingLanternBox.js b/scripts/tutorials/createFloatingLanternBox.js index c84214e295..3cf2facdc9 100644 --- a/scripts/tutorials/createFloatingLanternBox.js +++ b/scripts/tutorials/createFloatingLanternBox.js @@ -13,8 +13,8 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -var COMPOUND_SHAPE_URL = "http://hifi-content.s3.amazonaws.com/Examples%20Content/production/maracas/woodenCrate_phys.obj"; -var MODEL_URL = "http://hifi-content.s3.amazonaws.com/Examples%20Content/production/maracas/woodenCrate_VR.fbx"; +var COMPOUND_SHAPE_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/Examples%20Content/production/maracas/woodenCrate_phys.obj"); +var MODEL_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/Examples%20Content/production/maracas/woodenCrate_VR.fbx"); var SCRIPT_URL = Script.resolvePath("./entity_scripts/floatingLanternBox.js?v=" + Date.now()); var START_POSITION = Vec3.sum(MyAvatar.position, Vec3.multiply(Quat.getFront(MyAvatar.orientation), 2)); START_POSITION.y -= .6; diff --git a/scripts/tutorials/createTetherballStick.js b/scripts/tutorials/createTetherballStick.js index b940762137..e976110db2 100644 --- a/scripts/tutorials/createTetherballStick.js +++ b/scripts/tutorials/createTetherballStick.js @@ -24,7 +24,7 @@ var ACTION_DISTANCE = 0.35; var ACTION_TIMESCALE = 0.035; var MAX_DISTANCE_MULTIPLIER = 4; var STICK_SCRIPT_URL = Script.resolvePath("./entity_scripts/tetherballStick.js"); -var STICK_MODEL_URL = "http://hifi-content.s3.amazonaws.com/caitlyn/production/raveStick/newRaveStick2.fbx"; +var STICK_MODEL_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/caitlyn/production/raveStick/newRaveStick2.fbx"); var COLLISION_SOUND_URL = "http://public.highfidelity.io/sounds/Footsteps/FootstepW3Left-12db.wav"; var avatarOrientation = MyAvatar.orientation; @@ -37,7 +37,7 @@ var ballStartPosition = Vec3.sum(stickStartPosition, Vec3.multiply(0.36, front)) var ballID = Entities.addEntity({ type: "Model", - modelURL: "http://hifi-content.s3.amazonaws.com/Examples%20Content/production/marblecollection/Star.fbx", + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, "/Examples%20Content/production/marblecollection/Star.fbx"), name: "TetherballStick Ball", shapeType: "Sphere", position: ballStartPosition, @@ -70,7 +70,7 @@ var lineID = Entities.addEntity({ green: 120, blue: 250 }, - textures: "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png", + textures: ExternalResource.getUrl(ExternalResource.HF_Public, "/alan/Particles/Particle-Sprite-Smoke-1.png"), position: ballStartPosition, dimensions: { x: 10, diff --git a/scripts/tutorials/entity_scripts/ambientSound.js b/scripts/tutorials/entity_scripts/ambientSound.js index cbd94c22e4..662af792a7 100644 --- a/scripts/tutorials/entity_scripts/ambientSound.js +++ b/scripts/tutorials/entity_scripts/ambientSound.js @@ -24,7 +24,7 @@ (function(){ // This sample clip and range will be used if you don't add userData to the entity (see above) var DEFAULT_RANGE = 100; - var DEFAULT_URL = "http://hifi-content.s3.amazonaws.com/ken/samples/forest_ambiX.wav"; + var DEFAULT_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/ken/samples/forest_ambiX.wav"); var DEFAULT_VOLUME = 1.0; var DEFAULT_USERDATA = { diff --git a/scripts/tutorials/entity_scripts/flashlight.js b/scripts/tutorials/entity_scripts/flashlight.js index caa5cc626a..bc19cee926 100644 --- a/scripts/tutorials/entity_scripts/flashlight.js +++ b/scripts/tutorials/entity_scripts/flashlight.js @@ -8,7 +8,7 @@ // Copyright 2015 High Fidelity, Inc. // // This is a toy script that can be added to the Flashlight model entity: -// "https://hifi-public.s3.amazonaws.com/models/props/flashlight.fbx" +// ExternalResource.getUrl(ExternalResource.HF_Public, "/models/props/flashlight.fbx") // that creates a spotlight attached with the flashlight model while the entity is grabbed // // Distributed under the Apache License, Version 2.0. @@ -17,8 +17,8 @@ (function() { - var ON_SOUND_URL = 'http://hifi-public.s3.amazonaws.com/sounds/Switches%20and%20sliders/flashlight_on.wav'; - var OFF_SOUND_URL = 'http://hifi-public.s3.amazonaws.com/sounds/Switches%20and%20sliders/flashlight_off.wav'; + var ON_SOUND_URL = ExternalResource.getUrl(ExternalResource.HF_Public, '/sounds/Switches%20and%20sliders/flashlight_on.wav'); + var OFF_SOUND_URL = ExternalResource.getUrl(ExternalResource.HF_Public, '/sounds/Switches%20and%20sliders/flashlight_off.wav'); //we are creating lights that we don't want to get stranded so lets make sure that we can get rid of them //if you're going to be using this in a dungeon or something and holding it for a long time, increase this lifetime value. diff --git a/scripts/tutorials/entity_scripts/floatingLanternBox.js b/scripts/tutorials/entity_scripts/floatingLanternBox.js index b5fb0c27d9..859897c06a 100644 --- a/scripts/tutorials/entity_scripts/floatingLanternBox.js +++ b/scripts/tutorials/entity_scripts/floatingLanternBox.js @@ -16,7 +16,7 @@ (function() { var _this; - var LANTERN_MODEL_URL = "http://hifi-content.s3.amazonaws.com/DomainContent/Welcome%20Area/Models/chinaLantern_capsule.fbx"; + var LANTERN_MODEL_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/DomainContent/Welcome%20Area/Models/chinaLantern_capsule.fbx"); var LANTERN_SCRIPT_URL = Script.resolvePath("floatingLantern.js?v=" + Date.now()); var LIFETIME = 120; var RESPAWN_INTERVAL = 1000; diff --git a/scripts/tutorials/entity_scripts/sit.js b/scripts/tutorials/entity_scripts/sit.js index 7afc9b30f4..7cc097722b 100644 --- a/scripts/tutorials/entity_scripts/sit.js +++ b/scripts/tutorials/entity_scripts/sit.js @@ -18,7 +18,7 @@ } var SETTING_KEY = "com.highfidelity.avatar.isSitting"; - var ANIMATION_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/clement/production/animations/sitting_idle.fbx"; + var ANIMATION_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/clement/production/animations/sitting_idle.fbx"); var ANIMATION_FPS = 30; var ANIMATION_FIRST_FRAME = 1; var ANIMATION_LAST_FRAME = 10; diff --git a/scripts/tutorials/nBody.js b/scripts/tutorials/nBody.js index 01797201b2..5a39e10f4c 100644 --- a/scripts/tutorials/nBody.js +++ b/scripts/tutorials/nBody.js @@ -18,8 +18,8 @@ var bodies = []; var n = 3; var radius = 0.1; var G = 0.25; -var EARTH = "https://s3-us-west-1.amazonaws.com/hifi-content/seth/production/NBody/earth.fbx"; -var MOON = "https://s3-us-west-1.amazonaws.com/hifi-content/seth/production/NBody/moon.fbx"; +var EARTH = ExternalResource.getUrl(ExternalResource.HF_Content, "/seth/production/NBody/earth.fbx"); +var MOON = ExternalResource.getUrl(ExternalResource.HF_Content, "/seth/production/NBody/moon.fbx"); var COLOR1 = { red: 51, green: 51, blue: 255 }; var COLOR2 = { red: 51, green: 51, blue: 255 }; diff --git a/unpublishedScripts/DomainContent/Cupcake/eatable.js b/unpublishedScripts/DomainContent/Cupcake/eatable.js index 8b261b7ea2..732982adcd 100644 --- a/unpublishedScripts/DomainContent/Cupcake/eatable.js +++ b/unpublishedScripts/DomainContent/Cupcake/eatable.js @@ -10,7 +10,7 @@ // (function () { - var NOMNOM_SOUND = SoundCache.getSound('http://hifi-content.s3.amazonaws.com/DomainContent/production/audio/vegcrunch.wav'); + var NOMNOM_SOUND = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Content, "/DomainContent/production/audio/vegcrunch.wav")); var _entityID; diff --git a/unpublishedScripts/DomainContent/Toybox/doll/doll.js b/unpublishedScripts/DomainContent/Toybox/doll/doll.js index c2e2ef2cda..59e14e5946 100644 --- a/unpublishedScripts/DomainContent/Toybox/doll/doll.js +++ b/unpublishedScripts/DomainContent/Toybox/doll/doll.js @@ -67,7 +67,7 @@ animation: { // Providing actual model fbx for animation used to work, now contorts doll into a weird ball // See bug: https://app.asana.com/0/26225263936266/70097355490098 - // url: "http://hifi-public.s3.amazonaws.com/models/Bboys/bboy2/bboy2.fbx", + // url: ExternalResource.getUrl(ExternalResource.HF_Public, '/models/Bboys/bboy2/bboy2.fbx"), running: false, } }); diff --git a/unpublishedScripts/DomainContent/Toybox/flashlight/flashlight.js b/unpublishedScripts/DomainContent/Toybox/flashlight/flashlight.js index 5cbf93538a..45f26e79e5 100644 --- a/unpublishedScripts/DomainContent/Toybox/flashlight/flashlight.js +++ b/unpublishedScripts/DomainContent/Toybox/flashlight/flashlight.js @@ -8,7 +8,7 @@ // Copyright 2015 High Fidelity, Inc. // // This is a toy script that can be added to the Flashlight model entity: -// "https://hifi-public.s3.amazonaws.com/models/props/flashlight.fbx" +// ExternalResource.getUrl(ExternalResource.HF_Public, "/models/props/flashlight.fbx") // that creates a spotlight attached with the flashlight model while the entity is grabbed // // Distributed under the Apache License, Version 2.0. diff --git a/unpublishedScripts/DomainContent/Toybox/pistol/pistol.js b/unpublishedScripts/DomainContent/Toybox/pistol/pistol.js index 038c53054c..7a887692c3 100644 --- a/unpublishedScripts/DomainContent/Toybox/pistol/pistol.js +++ b/unpublishedScripts/DomainContent/Toybox/pistol/pistol.js @@ -266,7 +266,7 @@ "alphaStart": 0, "alphaFinish": 0, "additiveBlending": 0, - "textures": "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png" + "textures": ExternalResource.getUrl(ExternalResource.HF_Public, "/alan/Particles/Particle-Sprite-Smoke-1.png") }); Script.setTimeout(function() { Entities.editEntity(smoke, { diff --git a/unpublishedScripts/marketplace/blocks/blocksApp.js b/unpublishedScripts/marketplace/blocks/blocksApp.js index 9c10ba8197..4d3518b03f 100644 --- a/unpublishedScripts/marketplace/blocks/blocksApp.js +++ b/unpublishedScripts/marketplace/blocks/blocksApp.js @@ -15,9 +15,9 @@ (function () { var APP_NAME = "BLOCKS"; var APP_URL = "https://poly.google.com/"; - var APP_OUTDATED_URL = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/updateToBlocks.html"; - var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-i.svg"; - var APP_ICON_ACTIVE = "https://hifi-content.s3.amazonaws.com/elisalj/blocks/blocks-a.svg"; + var APP_OUTDATED_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/elisalj/blocks/updateToBlocks.html"); + var APP_ICON = ExternalResource.getUrl(ExternalResource.HF_Content, "/elisalj/blocks/blocks-i.svg"); + var APP_ICON_ACTIVE = ExternalResource.getUrl(ExternalResource.HF_Content, "/elisalj/blocks/blocks-a.svg"); try { print("Current Interface version: " + Window.checkVersion()); diff --git a/unpublishedScripts/marketplace/boppo/boppoClownEntity.js b/unpublishedScripts/marketplace/boppo/boppoClownEntity.js index 36f2bf5ab0..f5b57a7426 100644 --- a/unpublishedScripts/marketplace/boppo/boppoClownEntity.js +++ b/unpublishedScripts/marketplace/boppo/boppoClownEntity.js @@ -11,7 +11,6 @@ /* globals LookAtTarget */ (function() { - var SFX_PREFIX = 'https://hifi-content.s3-us-west-1.amazonaws.com/caitlyn/production/elBoppo/sfx/'; var CHANNEL_PREFIX = 'io.highfidelity.boppo_server_'; var PUNCH_SOUNDS = [ 'punch_1.wav', @@ -41,7 +40,7 @@ var BoppoClownEntity = function () { _this = this; PUNCH_SOUNDS.forEach(function(punch) { - _punchSounds.push(SoundCache.getSound(SFX_PREFIX + punch)); + _punchSounds.push(SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Content, '/caitlyn/production/elBoppo/sfx/' + punch))); }); }; diff --git a/unpublishedScripts/marketplace/boppo/boppoServer.js b/unpublishedScripts/marketplace/boppo/boppoServer.js index f03154573c..3831290d91 100644 --- a/unpublishedScripts/marketplace/boppo/boppoServer.js +++ b/unpublishedScripts/marketplace/boppo/boppoServer.js @@ -9,7 +9,6 @@ // (function() { - var SFX_PREFIX = 'https://hifi-content.s3-us-west-1.amazonaws.com/caitlyn/production/elBoppo/sfx/'; var CLOWN_LAUGHS = [ 'clown_laugh_1.wav', 'clown_laugh_2.wav', @@ -168,12 +167,12 @@ _boppoClownID = null; _coolDown = false; CLOWN_LAUGHS.forEach(function(clownLaugh) { - _clownLaughs.push(SoundCache.getSound(SFX_PREFIX + clownLaugh)); + _clownLaughs.push(SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Content, + clownLaugh))); }); - _tickTockSound = SoundCache.getSound(SFX_PREFIX + TICK_TOCK_SOUND); - _boxingBellRingStart = SoundCache.getSound(SFX_PREFIX + BOXING_RING_BELL_START); - _boxingBellRingEnd = SoundCache.getSound(SFX_PREFIX + BOXING_RING_BELL_END); - _music = SoundCache.getSound(SFX_PREFIX + BOPPO_MUSIC); + _tickTockSound = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Content, TICK_TOCK_SOUND)); + _boxingBellRingStart = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Content, BOXING_RING_BELL_START)); + _boxingBellRingEnd = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Content, BOXING_RING_BELL_END)); + _music = SoundCache.getSound(ExternalResource.getUrl(ExternalResource.HF_Content, BOPPO_MUSIC)); _boppoEntities = {}; }; @@ -200,9 +199,9 @@ var boppoBaseProperties = Entities.getEntityProperties(_entityID, ['position', 'rotation']); _boppoClownID = Entities.addEntity({ angularDamping: 0.0, - collisionSoundURL: 'https://hifi-content.s3.amazonaws.com/caitlyn/production/elBoppo/51460__andre-rocha-nascimento__basket-ball-01-bounce.wav', + collisionSoundURL: ExternalResource.getUrl(ExternalResource.HF_Content, 'caitlyn/production/elBoppo/51460__andre-rocha-nascimento__basket-ball-01-bounce.wav'), collisionsWillMove: true, - compoundShapeURL: 'https://hifi-content.s3.amazonaws.com/caitlyn/production/elBoppo/bopo_phys.obj', + compoundShapeURL: ExternalResource.getUrl(ExternalResource.HF_Content, 'caitlyn/production/elBoppo/bopo_phys.obj'), damping: 1.0, density: 10000, dimensions: { @@ -217,7 +216,7 @@ y: -25, z: 0 }, - modelURL: 'https://hifi-content.s3.amazonaws.com/caitlyn/production/elBoppo/elBoppo3_VR.fbx', + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, 'caitlyn/production/elBoppo/elBoppo3_VR.fbx'), name: 'El Boppo the Punching Bag Clown', registrationPoint: { x: 0.5, diff --git a/unpublishedScripts/marketplace/boppo/clownGloveDispenser.js b/unpublishedScripts/marketplace/boppo/clownGloveDispenser.js index cd0a0c0614..0fe915146b 100644 --- a/unpublishedScripts/marketplace/boppo/clownGloveDispenser.js +++ b/unpublishedScripts/marketplace/boppo/clownGloveDispenser.js @@ -35,7 +35,7 @@ y: -9.8, z: 0 }, - modelURL: "https://hifi-content.s3.amazonaws.com/caitlyn/production/elBoppo/LFT_glove_VR3.fbx", + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, "/caitlyn/production/elBoppo/LFT_glove_VR3.fbx"), name: "Boxing Glove - Left", registrationPoint: { x: 0.5, @@ -76,7 +76,7 @@ y: -9.8, z: 0 }, - modelURL: "https://hifi-content.s3.amazonaws.com/caitlyn/production/elBoppo/RT_glove_VR2.fbx", + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, "/caitlyn/production/elBoppo/RT_glove_VR2.fbx"), name: "Boxing Glove - Right", registrationPoint: { x: 0.5, diff --git a/unpublishedScripts/marketplace/boppo/createElBoppo.js b/unpublishedScripts/marketplace/boppo/createElBoppo.js index 4df6a2acda..2769c357a2 100644 --- a/unpublishedScripts/marketplace/boppo/createElBoppo.js +++ b/unpublishedScripts/marketplace/boppo/createElBoppo.js @@ -10,12 +10,11 @@ /* globals SCRIPT_IMPORT_PROPERTIES */ -var MODELS_PATH = 'https://hifi-content.s3.amazonaws.com/DomainContent/Welcome%20Area/production/models/boxingRing/'; var WANT_CLEANUP_ON_SCRIPT_ENDING = false; var getScriptPath = function(localPath) { if (this.isCleanupAndSpawnScript) { - return 'https://hifi-content.s3.amazonaws.com/DomainContent/Welcome%20Area/Scripts/boppo/' + localPath; + return ExternalResource.getUrl(ExternalResource.HF_Content, 'DomainContent/Welcome%20Area/Scripts/boppo/' + localPath); } return Script.resolvePath(localPath); }; @@ -34,7 +33,7 @@ var boxingRing = Entities.addEntity({ y: 4.0418000221252441, z: 3.0490000247955322 }, - modelURL: MODELS_PATH + 'assembled/boppoBoxingRingAssembly.fbx', + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, 'DomainContent/Welcome%20Area/production/models/boxingRing/assembled/boppoBoxingRingAssembly.fbx'), name: 'Boxing Ring Assembly', rotation: { w: 0.9996337890625, @@ -62,7 +61,7 @@ var boppoEntities = [ y: 0.25536194443702698, z: 0.059455446898937225 }, - modelURL: MODELS_PATH + 'boxingGameSign/boppoSignFrame.fbx', + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, 'DomainContent/Welcome%20Area/production/models/boxingGameSign/boppoSignFrame.fbx'), parentID: boxingRing, localPosition: { x: -1.0251024961471558, @@ -150,7 +149,7 @@ var boppoEntities = [ y: 0.1884911060333252, z: 0.059455446898937225 }, - modelURL: MODELS_PATH + 'boxingGameSign/boppoSignFrame.fbx', + modelURL: ExternalResource.getUrl(ExternalResource.HF_Content, 'DomainContent/Welcome%20Area/production/models/boxingGameSign/boppoSignFrame.fbx'), parentID: boxingRing, localPosition: { x: -0.78200173377990723, diff --git a/unpublishedScripts/marketplace/dart/createDart.js b/unpublishedScripts/marketplace/dart/createDart.js index ff13a695a8..d031a94eb0 100644 --- a/unpublishedScripts/marketplace/dart/createDart.js +++ b/unpublishedScripts/marketplace/dart/createDart.js @@ -10,7 +10,7 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -var MODEL_URL = "https://hifi-content.s3.amazonaws.com/wadewatts/dart.fbx"; +var MODEL_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/wadewatts/dart.fbx"); var SCRIPT_URL = Script.resolvePath("./dart.js?v=" + Date.now()); var START_POSITION = Vec3.sum(MyAvatar.position, Vec3.multiply(Quat.getFront(MyAvatar.orientation), 0.75)); var START_ROTATION = MyAvatar.orientation diff --git a/unpublishedScripts/marketplace/dart/dart.js b/unpublishedScripts/marketplace/dart/dart.js index 9debe910e3..5968eb8335 100644 --- a/unpublishedScripts/marketplace/dart/dart.js +++ b/unpublishedScripts/marketplace/dart/dart.js @@ -12,7 +12,7 @@ (function() { var THROW_FACTOR = 3; - var DART_SOUND_URL = Script.resolvePath('https://hifi-content.s3.amazonaws.com/wadewatts/dart.wav?v=' + Date.now()); + var DART_SOUND_URL = Script.resolvePath(ExternalResource.getUrl(ExternalResource.HF_Content, '/wadewatts/dart.wav?v=') + "?" + Date.now()); var Dart = function() {}; diff --git a/unpublishedScripts/marketplace/emoji-tablet/emojiTablet.js b/unpublishedScripts/marketplace/emoji-tablet/emojiTablet.js index b4d01e77cf..e6ada1ed79 100644 --- a/unpublishedScripts/marketplace/emoji-tablet/emojiTablet.js +++ b/unpublishedScripts/marketplace/emoji-tablet/emojiTablet.js @@ -12,13 +12,13 @@ /// http://creativecommons.org/licenses/ /// -var lib = Script.require("https://hifi-content.s3.amazonaws.com/elisalj/emoji_scripts/emojiLib.js?" + Date.now()); +var lib = Script.require(ExternalResource.getUrl(ExternalResource.HF_Content, "/elisalj/emoji_scripts/emojiLib.js") + "?" + Date.now()); (function() { var APP_NAME = "EMOJIS"; - var APP_URL = "https://hifi-content.s3.amazonaws.com/elisalj/emoji_scripts/emojiTabletUI.html?" + Date.now(); - var APP_ICON = "https://hifi-content.s3.amazonaws.com/elisalj/emoji_scripts/icons/emoji-i.svg"; + var APP_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/elisalj/emoji_scripts/emojiTabletUI.html") + "?" + Date.now(); + var APP_ICON = ExternalResource.getUrl(ExternalResource.HF_Content, "/elisalj/emoji_scripts/icons/emoji-i.svg"); var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); var button = tablet.addButton({ diff --git a/unpublishedScripts/marketplace/gameTable/games/deckOfCards/deckOfCards.js b/unpublishedScripts/marketplace/gameTable/games/deckOfCards/deckOfCards.js index 4fd47fcb0e..f37560132c 100644 --- a/unpublishedScripts/marketplace/gameTable/games/deckOfCards/deckOfCards.js +++ b/unpublishedScripts/marketplace/gameTable/games/deckOfCards/deckOfCards.js @@ -13,8 +13,8 @@ var _this; var MAPPING_NAME = "hifi-gametable-cards-dev-" + Math.random(); var PLAYING_CARD_SCRIPT_URL = Script.resolvePath('playingCard.js'); - var PLAYING_CARD_MODEL_URL = 'http://hifi-content.s3.amazonaws.com/thoys/production/gameTable/assets/deckOfCards/playing_card.fbx'; - var PLAYING_CARD_BACK_IMAGE_URL = "http://hifi-content.s3.amazonaws.com/thoys/production/gameTable/assets/deckOfCards/back.jpg"; + var PLAYING_CARD_MODEL_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/thoys/production/gameTable/assets/deckOfCards/playing_card.fbx"); + var PLAYING_CARD_BACK_IMAGE_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/thoys/production/gameTable/assets/deckOfCards/back.jpg"); var PLAYING_CARD_DIMENSIONS = { x: 0.2621, y: 0.1, diff --git a/unpublishedScripts/marketplace/gameTable/games/deckOfCards/playingCard.js b/unpublishedScripts/marketplace/gameTable/games/deckOfCards/playingCard.js index 4a28fc09fd..9c12bf7ce0 100644 --- a/unpublishedScripts/marketplace/gameTable/games/deckOfCards/playingCard.js +++ b/unpublishedScripts/marketplace/gameTable/games/deckOfCards/playingCard.js @@ -13,9 +13,9 @@ var _this; - var CARD_MODEL_URL = 'http://hifi-content.s3.amazonaws.com/thoys/production/gameTable/assets/deckOfCards/playing_card.fbx'; - var CARD_BACK_IMAGE_URL = "http://hifi-content.s3.amazonaws.com/thoys/production/gameTable/assets/deckOfCards/images/back.jpg"; - var CARD_IMAGE_BASE_URL = "http://hifi-content.s3.amazonaws.com/thoys/production/gameTable/assets/deckOfCards/images/playingcard_old-"; + var CARD_MODEL_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/thoys/production/gameTable/assets/deckOfCards/playing_card.fbx"); + var CARD_BACK_IMAGE_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/thoys/production/gameTable/assets/deckOfCards/images/back.jpg"); + var CARD_IMAGE_BASE_URL = ExternalResource.getUrl(ExternalResource.HF_Content, "/thoys/production/gameTable/assets/deckOfCards/images/playingcard_old-"); function PlayingCard() { _this = this; diff --git a/unpublishedScripts/marketplace/shortbow/enemyClientEntity.js b/unpublishedScripts/marketplace/shortbow/enemyClientEntity.js index 1ff114012c..8e954a37c8 100644 --- a/unpublishedScripts/marketplace/shortbow/enemyClientEntity.js +++ b/unpublishedScripts/marketplace/shortbow/enemyClientEntity.js @@ -110,7 +110,7 @@ "y": 0.80860012769699097, "z": -0.23394235968589783 }, - "textures": "https://hifi-public.s3.amazonaws.com/alan/Particles/Particle-Sprite-Smoke-1.png", + "textures": ExternalResource.getUrl(ExternalResource.HF_Public, "/alan/Particles/Particle-Sprite-Smoke-1.png"), "type": "ParticleEffect" };