mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-06 02:00:46 +00:00
remove an invalid URL type from engine url mapping
This commit is contained in:
1 parent
cf2871c129
commit
41e8a418e7
2 files changed
+13
-23
No files matched your search
@@ -104,15 +104,6 @@ describe('media files', () => {
|
||||
const url = GetEngineUrl({mode: EngineMode.Studio, asset: mediaFile });
|
||||
expect(url).toEqual("https://engine.fakeyou.com/?mode=studio&scene=remote://MEDIA_FILE_TOKEN.scn.ron");
|
||||
});
|
||||
|
||||
test('from media subtype and media type (.glb)', () => {
|
||||
mediaFile.media_type = MediaFileType.GLB;
|
||||
mediaFile.media_class = MediaFileClass.Scene;
|
||||
mediaFile.maybe_media_subtype = MediaFileSubtype.StorytellerScene;
|
||||
|
||||
const url = GetEngineUrl({mode: EngineMode.Studio, asset: mediaFile });
|
||||
expect(url).toEqual("https://engine.fakeyou.com/?mode=studio&sceneImport=remote://MEDIA_FILE_TOKEN.glb");
|
||||
});
|
||||
});
|
||||
|
||||
// Production examples:
|
||||
@@ -136,6 +127,15 @@ describe('media files', () => {
|
||||
const url = GetEngineUrl({mode: EngineMode.Viewer, asset: mediaFile });
|
||||
expect(url).toEqual("https://engine.fakeyou.com/?mode=viewer&sceneImport=https://storage.googleapis.com/dev-vocodes-public/path/to/file.gltf");
|
||||
});
|
||||
|
||||
test('glb with scene media_class and storyteller_scene subtype', () => {
|
||||
mediaFile.media_type = MediaFileType.GLB;
|
||||
mediaFile.media_class = MediaFileClass.Scene;
|
||||
mediaFile.maybe_media_subtype = MediaFileSubtype.StorytellerScene;
|
||||
|
||||
const url = GetEngineUrl({mode: EngineMode.Studio, asset: mediaFile });
|
||||
expect(url).toEqual("https://engine.fakeyou.com/?mode=studio&sceneImport=remote://MEDIA_FILE_TOKEN.glb");
|
||||
});
|
||||
});
|
||||
|
||||
// Production examples:
|
||||
|
||||
@@ -57,8 +57,9 @@ export function GetEngineUrl(args: GetEngineUrlArgs) : string {
|
||||
args.asset.media_class === MediaFileClass.Scene &&
|
||||
args.asset.maybe_media_subtype === MediaFileSubtype.StorytellerScene
|
||||
) {
|
||||
// TODO: GLB docs
|
||||
// NB: Not sure if `maybe_media_subtype` may or may not be required?
|
||||
// GLB Scenes
|
||||
// NB: Not sure if `maybe_media_subtype` is required to be "storyteller_scene".
|
||||
// We'll require it in the file for now, but may loosen this restriction.
|
||||
const sceneUrlRef = `remote://${args.asset.token}.glb`;
|
||||
engineUrl += `&sceneImport=${sceneUrlRef}`;
|
||||
} else if (
|
||||
@@ -69,18 +70,7 @@ export function GetEngineUrl(args: GetEngineUrlArgs) : string {
|
||||
// NB: Storyteller Engine makes the API call to load the scene.
|
||||
// We don't need to pass the bucket path.
|
||||
// The engine, does, however, need a `.scn.ron` file extension.
|
||||
let extension;
|
||||
|
||||
switch (args.asset.media_type) {
|
||||
case MediaFileType.SceneRon:
|
||||
extension = "scn.ron";
|
||||
break;
|
||||
case MediaFileType.GLB:
|
||||
default:
|
||||
extension = "glb";
|
||||
break;
|
||||
}
|
||||
const sceneUrlRef = `remote://${args.asset.token}.${extension}`;
|
||||
const sceneUrlRef = `remote://${args.asset.token}.scn.ron`;
|
||||
engineUrl += `&scene=${sceneUrlRef}`;
|
||||
} else if (
|
||||
args.asset.maybe_media_subtype === MediaFileSubtype.Mixamo
|
||||
|
||||
Reference in new issue
Block a user