From 9a1c0af61d1a21294ef0f40563da2e99a3174d12 Mon Sep 17 00:00:00 2001 From: buttle Date: Wed, 6 Oct 2021 12:53:50 +0200 Subject: [PATCH] adds skybox --- src/Site/BlockLayout/Render3D.php | 8 +++++++- view/common/block-layout/render-3d.phtml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Site/BlockLayout/Render3D.php b/src/Site/BlockLayout/Render3D.php index f21d764..96e72d1 100644 --- a/src/Site/BlockLayout/Render3D.php +++ b/src/Site/BlockLayout/Render3D.php @@ -91,6 +91,12 @@ class Render3D extends AbstractBlockLayout } $width = $block->dataValue('width'); $height = $width; + $skybox = null; + foreach($urls as $url) { + if (strpos($url, "sky-box-image")) { + $skybox = $url; + } + } return $view->partial('common/block-layout/render-3d', [ 'model_type' => $model_type, 'title' => $block->dataValue('title'), @@ -99,7 +105,7 @@ class Render3D extends AbstractBlockLayout 'item_url' => $attachments[0]->item()->url(), 'renderSourceLink' => $block->dataValue('renderSourceLink'), 'addPreLoadImage' => 1, - 'skybox' => 0, + 'skybox' => $skybox, 'urls' => $urls, 'id' => 'v3d-' . ++$id, 'mediaTypes' => $media_types, diff --git a/view/common/block-layout/render-3d.phtml b/view/common/block-layout/render-3d.phtml index 0b05c53..1d6fc0f 100644 --- a/view/common/block-layout/render-3d.phtml +++ b/view/common/block-layout/render-3d.phtml @@ -41,7 +41,7 @@ model-viewer { camera-controls="" background-color="#455A64" - skybox-image="{{ object['skybox'] }}" + skybox-image="" >