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