Make addition of config object specific to gltf files
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user