Make addition of config object specific to gltf files

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-11-13 15:11:24 -07:00
parent 4f7febcd26
commit 85757bc0b3

View File

@@ -130,20 +130,23 @@ class GlModelHooks {
* @param SpecialUpload $uploadFormObj current SpecialUpload object
*/
public static function onUploadFormBeforeProcessing( $uploadFormObj ) {
$uploadFormObj->mComment .= <<<CONF
<mvconfig>
{
"viewerConfig": {
"default": {
"camera-controls": true
preg_match('/(glb|gltf)$/', $uploadFormObj->mUpload->getTitle(), $isGltf);
if ($isGltf) {
$uploadFormObj->mComment .= <<<CONF
<mvconfig>
{
"viewerConfig": {
"default": {
"camera-controls": true
}
},
"annotations": {},
"annotationSets": {}
}
},
"annotations": {},
"annotationSets": {}
</mvconfig>
CONF;
}
</mvconfig>
CONF;
return true;
}