glb + scene + scene_import

This commit is contained in:
Brandon Thomas committed 2024-03-19 21:46:28 -04:00
1 parent 5e74bc2fbb
commit ef02a8acb6
2 files changed
+17 -4

No files matched your search

@@ -107,9 +107,10 @@ describe('media files', () => {
});
// Production examples:
// [without subtype] https://feature-mvp--fakeyou.netlify.app/media/m_tcj2zzncmvmn32f0yavmys5jdrc8cc (Majora's Mask GLB)
// [scene_import subtype] https://feature-mvp--fakeyou.netlify.app/media/m_a504ma0n7vv3y80bw7bvgx7q2cecmb (Goron GLB)
// [scene media_class] https://feature-mvp--fakeyou.netlify.app/media/m_2yw1ytwec9wj8y74k3kc26grn4q341 (Joel's island GLB)
// [without subtype] https://feature-mvp--fakeyou.netlify.app/media/m_tcj2zzncmvmn32f0yavmys5jdrc8cc (Majora's Mask GLB)
// [scene_import subtype] https://feature-mvp--fakeyou.netlify.app/media/m_a504ma0n7vv3y80bw7bvgx7q2cecmb (Goron GLB)
// [scene media_class] https://feature-mvp--fakeyou.netlify.app/media/m_2yw1ytwec9wj8y74k3kc26grn4q341 (Joel's island GLB)
// [scene media_class + scene_import] https://feature-mvp--fakeyou.netlify.app/studio-intro/m_zk0qkm1tgsdbh6e3c9kedy34vaympd (Scott's island)
describe('generic scene file (not storyteller studio scene)', () => {
test('glb without subtype', () => {
mediaFile.media_type = MediaFileType.GLB;
@@ -137,6 +138,15 @@ describe('media files', () => {
const url = GetEngineUrl({mode: EngineMode.Studio, asset: mediaFile });
expect(url).toEqual("https://engine.fakeyou.com/?mode=studio&sceneImport=remote://MEDIA_FILE_TOKEN.glb");
});
test('glb with scene media_class and scene_import subtype', () => {
mediaFile.media_type = MediaFileType.GLB;
mediaFile.media_class = MediaFileClass.Scene;
mediaFile.maybe_media_subtype = MediaFileSubtype.SceneImport;
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:
@@ -55,7 +55,10 @@ export function GetEngineUrl(args: GetEngineUrlArgs) : string {
if (
args.asset.media_type === MediaFileType.GLB &&
args.asset.media_class === MediaFileClass.Scene &&
args.asset.maybe_media_subtype === MediaFileSubtype.StorytellerScene
(
args.asset.maybe_media_subtype === MediaFileSubtype.StorytellerScene ||
args.asset.maybe_media_subtype === MediaFileSubtype.SceneImport
)
) {
// GLB Scenes
// NB: Not sure if `maybe_media_subtype` is required to be "storyteller_scene".