addExtraTypes('model/gltf-binary glb gltf'); $mime->addExtraInfo('model/gltf-binary [DRAWING]'); } public static function onMimeMagicImproveFromExtension( MimeAnalyzer $mimeAnalyzer, $ext, &$mime ) { if ( $mime !== 'model/gltf-binary' && in_array( $ext, ['glb', 'gltf'] ) ) { $mime = 'model/gltf-binary'; } } function doTransform($image, $dstPath, $dstUrl, $params, $flags = 0) { } public static function onBeforePageDisplay(OutputPage $out) { preg_match('/(getHTML(),$findGltf); if ($findGltf[0]) { $out->addModules('ext.glmv'); } } public static function onImageBeforeProduceHTML( DummyLinker &$linker, Title &$title, &$file, array &$frameParams, array &$handlerParams, &$time, &$result, Parser $parser, string &$query, &$widthOption ) { if ($file->getMimeType() !== 'model/gltf-binary') { return true; } $result = ''; #echo ''; return false; } public static function console_log($data, $add_script_tags = false) { $command = 'console.log('. json_encode($data, JSON_HEX_TAG).');'; if ($add_script_tags) { $command = ''; } echo $command; } }