threepipe
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

AssetManager.ts 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  1. import {ImportAssetOptions, ImportResult, ProcessRawOptions, RootSceneImportResult} from './IAssetImporter'
  2. import {
  3. BaseEvent,
  4. Cache as threeCache,
  5. Camera,
  6. EventDispatcher,
  7. Light,
  8. LinearFilter,
  9. LinearMipmapLinearFilter,
  10. LoadingManager,
  11. PerspectiveCamera,
  12. TextureLoader,
  13. } from 'three'
  14. import {ISerializedConfig, IViewerPlugin, ThreeViewer} from '../viewer'
  15. import {AssetImporter} from './AssetImporter'
  16. import {generateUUID, getTextureDataType, overrideThreeCache} from '../three'
  17. import {IAsset} from './IAsset'
  18. import {
  19. AddObjectOptions,
  20. AmbientLight2,
  21. DirectionalLight2,
  22. HemisphereLight2,
  23. ICamera,
  24. iCameraCommons,
  25. ILight,
  26. iLightCommons,
  27. IMaterial,
  28. iMaterialCommons,
  29. IObject3D,
  30. iObjectCommons,
  31. ISceneEvent,
  32. ITexture,
  33. PerspectiveCamera2,
  34. PointLight2,
  35. RectAreaLight2,
  36. SpotLight2,
  37. upgradeTexture,
  38. } from '../core'
  39. import {Importer} from './Importer'
  40. import {MaterialManager} from './MaterialManager'
  41. import {DRACOLoader2, GLTFLoader2, JSONMaterialLoader, MTLLoader2, OBJLoader2, ZipLoader} from './import'
  42. import {RGBELoader} from 'three/examples/jsm/loaders/RGBELoader.js'
  43. import {FBXLoader} from 'three/examples/jsm/loaders/FBXLoader.js'
  44. import {EXRLoader} from 'three/examples/jsm/loaders/EXRLoader.js'
  45. import {Class, ValOrArr} from 'ts-browser-helpers'
  46. import {ILoader} from './IImporter'
  47. import {AssetExporter} from './AssetExporter'
  48. import {IExporter} from './IExporter'
  49. import {GLTFExporter2} from './export'
  50. export interface AssetManagerOptions{
  51. /**
  52. * simple memory based cache for downloaded files, default = false
  53. */
  54. simpleCache?: boolean
  55. /**
  56. * Cache Storage for downloaded files, can use with `caches.open`
  57. * When true and by default uses `caches.open('threepipe-assetmanager')`, set to false to disable
  58. * @default true
  59. */
  60. storage?: Cache | Storage | boolean
  61. }
  62. export interface AddAssetOptions extends AddObjectOptions{
  63. /**
  64. * Automatically set any loaded HDR, EXR file as the scene environment map
  65. * @default true
  66. */
  67. autoSetEnvironment?: boolean
  68. /**
  69. * Automatically set any loaded image(ITexture) file as the scene background
  70. */
  71. autoSetBackground?: boolean
  72. }
  73. export type ImportAddOptions = ImportAssetOptions & AddAssetOptions
  74. export type AddRawOptions = ProcessRawOptions & AddAssetOptions
  75. /**
  76. * Asset Manager
  77. *
  78. * Utility class to manage import, export, and material management.
  79. * @category Asset Manager
  80. */
  81. export class AssetManager extends EventDispatcher<BaseEvent&{data?: ImportResult}, 'loadAsset'|'processStateUpdate'> {
  82. readonly viewer: ThreeViewer
  83. readonly importer: AssetImporter
  84. readonly exporter: AssetExporter
  85. readonly materials: MaterialManager
  86. private _storage?: Cache | Storage
  87. get storage() {
  88. return this._storage
  89. }
  90. constructor(viewer: ThreeViewer, {simpleCache = false, storage}: AssetManagerOptions = {}) {
  91. super()
  92. this._sceneUpdated = this._sceneUpdated.bind(this)
  93. this.addAsset = this.addAsset.bind(this)
  94. this.addRaw = this.addRaw.bind(this)
  95. this.addImported = this.addImported.bind(this)
  96. this.importer = new AssetImporter(!!viewer.getPlugin('debug'))
  97. this.exporter = new AssetExporter()
  98. this.materials = new MaterialManager()
  99. this.viewer = viewer
  100. this.viewer.scene.addEventListener('addSceneObject', this._sceneUpdated)
  101. this.viewer.scene.addEventListener('materialChanged', this._sceneUpdated)
  102. this.viewer.scene.addEventListener('beforeDeserialize', this._sceneUpdated)
  103. this._initCacheStorage(simpleCache, storage ?? true)
  104. this._setupObjectProcess()
  105. this._setupProcessState()
  106. this._addImporters()
  107. this._addExporters()
  108. }
  109. async addAsset<T extends ImportResult = ImportResult>(assetOrPath?: string | IAsset | IAsset[] | File | File[], options?: ImportAddOptions): Promise<(T | undefined)[]> {
  110. if (!this.importer || !this.viewer) return []
  111. const imported = await this.importer.import<T>(assetOrPath, options)
  112. if (!imported) {
  113. console.warn('Unable to import', assetOrPath, imported)
  114. return []
  115. }
  116. return this.loadImported<(T | undefined)[]>(imported, options)
  117. }
  118. // materials: IMaterial[] = []
  119. // textures: ITexture[] = []
  120. // todo move this function to viewer
  121. async loadImported<T extends ValOrArr<ImportResult | undefined> = ImportResult>(imported: T, {
  122. autoSetEnvironment = true,
  123. autoSetBackground = false,
  124. ...options
  125. }: AddAssetOptions = {}): Promise<T | never[]> {
  126. const arr: (ImportResult | undefined)[] = Array.isArray(imported) ? imported : [imported]
  127. let ret: T = Array.isArray(imported) ? [] : undefined as any
  128. for (const obj of arr) {
  129. if (!obj) {
  130. if (Array.isArray(ret)) ret.push(undefined)
  131. continue
  132. }
  133. let r = obj
  134. switch (obj.assetType) {
  135. case 'material':
  136. this.materials.registerMaterial(<IMaterial>obj)
  137. break
  138. case 'texture':
  139. if (autoSetEnvironment && (
  140. obj.__rootPath?.endsWith('.hdr') || obj.__rootPath?.endsWith('.exr')
  141. )) this.viewer.scene.environment = <ITexture>obj
  142. if (autoSetBackground) this.viewer.scene.background = <ITexture>obj
  143. break
  144. case 'model':
  145. case 'light':
  146. case 'camera':
  147. r = await this.viewer.addSceneObject(<IObject3D | RootSceneImportResult>obj, options) // todo update references in scene update event
  148. break
  149. case 'config':
  150. if (options?.importConfig !== false) await this.viewer.importConfig(<ISerializedConfig>obj)
  151. break
  152. default:
  153. // legacy
  154. if (obj.type && typeof obj.type === 'string' && (Array.isArray((obj as any).plugins) ||
  155. (obj as any).type === 'ThreeViewer' || this.viewer.getPlugin((obj as any).type))) {
  156. await this.viewer.importConfig(<ISerializedConfig>obj)
  157. }
  158. break
  159. }
  160. this.dispatchEvent({type: 'loadAsset', data: obj})
  161. if (Array.isArray(ret)) ret.push(r)
  162. else ret = r as T
  163. }
  164. return ret || []
  165. }
  166. /**
  167. * same as {@link loadImported}
  168. * @param imported
  169. * @param options
  170. */
  171. async addProcessedAssets<T extends ImportResult | undefined = ImportResult>(imported: (T | undefined)[], options?: AddAssetOptions): Promise<(T | undefined)[]> {
  172. return this.loadImported(imported, options)
  173. }
  174. async addAssetSingle<T extends ImportResult = ImportResult>(asset?: string | IAsset | File, options?: ImportAssetOptions): Promise<T | undefined> {
  175. return !asset ? undefined : (await this.addAsset<T>(asset, options))?.[0]
  176. }
  177. // processAndAddObjects
  178. async addRaw<T extends (ImportResult | undefined) = ImportResult>(res: T | T[], options: AddRawOptions = {}): Promise<(T | undefined)[]> {
  179. const r = await this.importer.processRaw<T>(res, options)
  180. return this.loadImported<T[]>(r, options)
  181. }
  182. async addRawSingle<T extends ImportResult | undefined = ImportResult | undefined>(res: T, options: AddRawOptions = {}): Promise<T | undefined> {
  183. return (await this.addRaw<T>(res, options))?.[0]
  184. }
  185. private _sceneUpdated(event: ISceneEvent) { // todo: check if objects are added some other way.
  186. if (event.type === 'addSceneObject') {
  187. const target = event.object as ImportResult
  188. switch (target.assetType) {
  189. case 'material':
  190. this.materials.registerMaterial(<IMaterial>target)
  191. break
  192. case 'texture':
  193. break
  194. case 'model':
  195. case 'light':
  196. case 'camera':
  197. break
  198. default:
  199. break
  200. }
  201. } else if (event.type === 'materialChanged') {
  202. const target = event.material as IMaterial | IMaterial[] | undefined
  203. const targets = Array.isArray(target) ? target : target ? [target] : []
  204. for (const t of targets) {
  205. this.materials.registerMaterial(t)
  206. }
  207. } else if (event.type === 'beforeDeserialize') {
  208. // object/material/texture to be deserialized
  209. const data = event.data
  210. const meta = event.meta
  211. if (!data.metadata) {
  212. console.warn('Invalid data(no metadata)', data)
  213. }
  214. if (event.material) {
  215. if (data.metadata?.type !== 'Material') {
  216. console.warn('Invalid material data', data)
  217. }
  218. JSONMaterialLoader.DeserializeMaterialJSON(data, this.viewer, meta, event.material).then(() => {
  219. //
  220. })
  221. }
  222. } else {
  223. console.error('Unexpected')
  224. }
  225. }
  226. dispose() {
  227. this.importer.dispose()
  228. this.materials.dispose()
  229. this.processState.clear()
  230. this.viewer.scene.removeEventListener('addSceneObject', this._sceneUpdated)
  231. this.viewer.scene.removeEventListener('materialChanged', this._sceneUpdated)
  232. this.exporter.dispose()
  233. }
  234. protected _addImporters() {
  235. const viewer = this.viewer
  236. if (!viewer) return
  237. const importers: Importer[] = [
  238. new Importer(TextureLoader, ['webp', 'png', 'jpeg', 'jpg', 'svg', 'ico', 'data:image', 'avif'], [
  239. 'image/webp', 'image/png', 'image/jpeg', 'image/svg+xml', 'image/gif', 'image/bmp', 'image/tiff', 'image/x-icon', 'image/avif',
  240. ], false), // todo: use ImageBitmapLoader if supported (better performance)
  241. new Importer<JSONMaterialLoader>(JSONMaterialLoader,
  242. ['mat', ...this.materials.templates.map(t => t.typeSlug!).filter(v => v)], // todo add others
  243. [], false, (loader) => {
  244. if (loader) loader.viewer = this.viewer
  245. return loader
  246. }),
  247. new Importer(class extends RGBELoader {
  248. constructor(manager: LoadingManager) {
  249. super(manager)
  250. this.setDataType(getTextureDataType(viewer.renderManager.renderer))
  251. }
  252. }, ['hdr'], ['image/vnd.radiance'], false),
  253. new Importer(class extends EXRLoader {
  254. constructor(manager: LoadingManager) {
  255. super(manager)
  256. this.setDataType(getTextureDataType(viewer.renderManager.renderer))
  257. }
  258. }, ['exr'], ['image/x-exr'], false),
  259. new Importer(FBXLoader, ['fbx'], ['model/fbx'], true),
  260. new Importer(ZipLoader, ['zip', 'glbz', 'gltfz'], ['application/zip', 'model/gltf+zip', 'model/zip'], true), // gltfz and glbz are invented zip files with gltf/glb inside along with resources
  261. new Importer(OBJLoader2 as any as Class<ILoader>, ['obj'], ['model/obj'], true),
  262. new Importer(MTLLoader2 as any as Class<ILoader>, ['mtl'], ['model/mtl'], false),
  263. new Importer<GLTFLoader2>(GLTFLoader2, ['gltf', 'glb', 'data:model/gltf', 'data:model/glb'], ['model/gltf', 'model/gltf+json', 'model/gltf-binary', 'model/glb'], true, (l, _, i) => l?.setup(this.viewer, i.extensions)),
  264. new Importer(DRACOLoader2, ['drc'], ['model/mesh+draco', 'model/drc'], true),
  265. ]
  266. this.importer.addImporter(...importers)
  267. }
  268. protected _addExporters() {
  269. const exporters: IExporter[] = [
  270. {
  271. ext: ['gltf', 'glb'], extensions: [], ctor: (_, exporter) => {
  272. const ex = new GLTFExporter2()
  273. // This should be added at the end.
  274. ex.setup(this.viewer, exporter.extensions)
  275. return ex
  276. },
  277. },
  278. ]
  279. this.exporter.addExporter(...exporters)
  280. }
  281. private _initCacheStorage(simpleCache?: boolean, storage?: Cache | Storage | boolean) {
  282. if (storage === true && window?.caches) {
  283. window.caches.open?.('threepipe-assetmanager').then(c => {
  284. this._initCacheStorage(simpleCache, c)
  285. this._storage = c
  286. })
  287. return
  288. }
  289. if (simpleCache || storage) {
  290. // three.js built-in simple memory cache. used in FileLoader.js todo: use local storage somehow
  291. if (simpleCache) threeCache.enabled = true
  292. if (storage && window.Cache && typeof window.Cache === 'function' && storage instanceof window.Cache) {
  293. overrideThreeCache(storage)
  294. // todo: clear cache
  295. }
  296. }
  297. this._storage = typeof storage === 'boolean' ? undefined : storage
  298. }
  299. protected _setupObjectProcess() {
  300. this.importer.addEventListener('processRaw', (event) => {
  301. // console.log('preprocess mat', mat)
  302. const mat = event.data as IMaterial
  303. if (!mat || !mat.isMaterial || !mat.uuid) return
  304. if (this.materials?.findMaterial(mat.uuid)) {
  305. console.warn('imported material uuid already exists, creating new uuid')
  306. mat.uuid = generateUUID()
  307. if (mat.userData.uuid) mat.userData.uuid = mat.uuid
  308. }
  309. // todo: check for name exists also
  310. this.materials.registerMaterial(mat)
  311. })
  312. this.importer.addEventListener('processRawStart', (event) => {
  313. // console.log('preprocess mat', mat)
  314. const res = event.data!
  315. const options = event.options! as ProcessRawOptions
  316. // if (!res.assetType) {
  317. // if (res.isBufferGeometry) { // for eg stl todo
  318. // res = new Mesh(res, new MeshStandardMaterial())
  319. // }
  320. // if (res.isObject3D) {
  321. // }
  322. // }
  323. if (res.isObject3D) {
  324. const cameras: Camera[] = []
  325. const lights: Light[] = []
  326. res.traverse((obj: any) => {
  327. if (obj.material) {
  328. const materials = Array.isArray(obj.material) ? obj.material : [obj.material]
  329. const newMaterials = []
  330. for (const material of materials) {
  331. const mat = this.materials.convertToIMaterial(material, {createFromTemplate: options.replaceMaterials !== false}) || material
  332. mat.uuid = material.uuid
  333. mat.userData.uuid = material.uuid
  334. newMaterials.push(mat)
  335. }
  336. if (Array.isArray(obj.material)) obj.material = newMaterials
  337. else obj.material = newMaterials[0]
  338. }
  339. if (obj.isCamera) cameras.push(obj)
  340. if (obj.isLight) lights.push(obj)
  341. })
  342. for (const camera of cameras) {
  343. if ((camera as PerspectiveCamera2).assetType === 'camera') continue
  344. // todo: OrthographicCamera
  345. if (!(camera as PerspectiveCamera).isPerspectiveCamera || !camera.parent || options.replaceCameras === false) {
  346. iCameraCommons.upgradeCamera.call(camera)
  347. } else {
  348. const newCamera: ICamera = (camera as any).iCamera ??
  349. new PerspectiveCamera2('', this.viewer.canvas)
  350. if (camera === newCamera) continue
  351. camera.parent.children.splice(camera.parent.children.indexOf(camera), 1, newCamera)
  352. newCamera.parent = camera.parent as any
  353. newCamera.copy(camera as any)
  354. camera.parent = null
  355. ;(newCamera as any).uuid = camera.uuid
  356. newCamera.userData.uuid = camera.uuid
  357. ;(camera as any).iCamera = newCamera
  358. // console.log('replacing camera', camera, newCamera)
  359. }
  360. }
  361. for (const light of lights) {
  362. if ((light as ILight).assetType === 'light') continue
  363. if (!light.parent || options.replaceLights === false) {
  364. iLightCommons.upgradeLight.call(light)
  365. } else {
  366. const newLight: ILight | undefined = (light as any).iLight ??
  367. (light as any).isDirectionalLight ? new DirectionalLight2() :
  368. (light as any).isPointLight ? new PointLight2() :
  369. (light as any).isSpotLight ? new SpotLight2() :
  370. (light as any).isAmbientLight ? new AmbientLight2() :
  371. (light as any).isHemisphereLight ? new HemisphereLight2() :
  372. (light as any).isRectAreaLight ? new RectAreaLight2() :
  373. undefined
  374. if (light === newLight || !newLight) continue
  375. light.parent.children.splice(light.parent.children.indexOf(light), 1, newLight)
  376. newLight.parent = light.parent as any
  377. newLight.copy(light as any)
  378. light.parent = null
  379. ;(newLight as any).uuid = light.uuid
  380. newLight.userData.uuid = light.uuid
  381. ;(light as any).iLight = newLight
  382. }
  383. }
  384. iObjectCommons.upgradeObject3D.call(res)
  385. } else if (res.isMaterial) {
  386. iMaterialCommons.upgradeMaterial.call(res)
  387. // todo update res by generating new material?
  388. } else if (res.isTexture) {
  389. upgradeTexture.call(res)
  390. if (event?.options?.generateMipmaps !== undefined)
  391. res.generateMipmaps = event?.options.generateMipmaps
  392. if (!res.generateMipmaps && !res.isRenderTargetTexture) { // todo: do we need to check more?
  393. res.minFilter = res.minFilter === LinearMipmapLinearFilter ? LinearFilter : res.minFilter
  394. res.magFilter = res.magFilter === LinearMipmapLinearFilter ? LinearFilter : res.magFilter
  395. }
  396. }
  397. // todo other asset/object types?
  398. })
  399. }
  400. /**
  401. * State of download/upload/process/other processes in the viewer.
  402. * Subscribes to importer and exporter by default, more can be added by plugins like {@link FileTransferPlugin}
  403. */
  404. processState: Map<string, {state: string, progress?: number | undefined}> = new Map()
  405. /**
  406. * Set process state for a path
  407. * Progress should be a number between 0 and 100
  408. * Pass undefined in value to remove the state
  409. * @param path
  410. * @param value
  411. */
  412. setProcessState(path: string, value: {state: string, progress?: number | undefined} | undefined) {
  413. if (value === undefined) this.processState.delete(path)
  414. else this.processState.set(path, value)
  415. this.dispatchEvent({type: 'processStateUpdate'})
  416. }
  417. protected _setupProcessState() {
  418. this.importer.addEventListener('importFile', (data: any) => {
  419. this.setProcessState(data.path, data.state !== 'done' ? {
  420. state: data.state,
  421. progress: data.progress ? data.progress * 100 : undefined,
  422. } : undefined)
  423. })
  424. this.importer.addEventListener('processRawStart', (data: any) => {
  425. this.setProcessState(data.path, {
  426. state: 'processing',
  427. progress: undefined,
  428. })
  429. })
  430. this.importer.addEventListener('processRaw', (data: any) => {
  431. this.setProcessState(data.path, undefined)
  432. })
  433. this.exporter.addEventListener('exportFile', (data: any) => {
  434. this.setProcessState(data.obj.name, data.state !== 'done' ? {
  435. state: data.state,
  436. progress: data.progress ? data.progress * 100 : undefined,
  437. } : undefined)
  438. })
  439. }
  440. // region deprecated
  441. /**
  442. * @deprecated use addRaw instead
  443. * @param res
  444. * @param options
  445. */
  446. async addImported<T extends (ImportResult | undefined) = ImportResult>(res: T | T[], options: AddRawOptions = {}): Promise<(T | undefined)[]> {
  447. console.error('addImported is deprecated, use addRaw instead')
  448. return this.addRaw(res, options)
  449. }
  450. /**
  451. * @deprecated use addAsset instead
  452. * @param path
  453. * @param options
  454. */
  455. public async addFromPath(path: string, options: ImportAddOptions = {}): Promise<any[]> {
  456. console.error('addFromPath is deprecated, use addAsset instead')
  457. return this.addAsset(path, options)
  458. }
  459. /**
  460. * @deprecated use {@link ThreeViewer.exportConfig} instead
  461. * @param binary - if set to false, encodes all the array buffers to base64
  462. */
  463. exportViewerConfig(binary = true): Record<string, any> {
  464. if (!this.viewer) return {}
  465. console.error('exportViewerConfig is deprecated, use viewer.toJSON instead')
  466. return this.viewer.toJSON(binary, undefined)
  467. }
  468. /**
  469. * @deprecated use {@link ThreeViewer.exportPluginsConfig} instead
  470. * @param filter
  471. */
  472. exportPluginPresets(filter?: string[]) {
  473. console.error('exportPluginPresets is deprecated, use viewer.exportPluginsConfig instead')
  474. return this.viewer?.exportPluginsConfig(filter)
  475. }
  476. /**
  477. * @deprecated use {@link ThreeViewer.exportPluginConfig} instead
  478. * @param plugin
  479. */
  480. exportPluginPreset(plugin: IViewerPlugin) {
  481. console.error('exportPluginPreset is deprecated, use viewer.exportPluginConfig instead')
  482. return this.viewer?.exportPluginConfig(plugin)
  483. }
  484. /**
  485. * @deprecated use {@link ThreeViewer.importPluginConfig} instead
  486. * @param json
  487. * @param plugin
  488. */
  489. async importPluginPreset(json: any, plugin?: IViewerPlugin) {
  490. console.error('importPluginPreset is deprecated, use viewer.importPluginConfig instead')
  491. return this.viewer?.importPluginConfig(json, plugin)
  492. }
  493. // todo continue from here by moving functions to the viewer.
  494. /**
  495. * @deprecated use {@link ThreeViewer.importConfig} instead
  496. * @param viewerConfig
  497. */
  498. async importViewerConfig(viewerConfig: any) {
  499. return this.viewer?.importConfig(viewerConfig)
  500. }
  501. /**
  502. * @deprecated use {@link ThreeViewer.fromJSON} instead
  503. * @param viewerConfig
  504. */
  505. applyViewerConfig(viewerConfig: any, resources?: any) {
  506. console.error('applyViewerConfig is deprecated, use viewer.fromJSON instead')
  507. return this.viewer?.fromJSON(viewerConfig, resources)
  508. }
  509. /**
  510. * @deprecated moved to {@link ThreeViewer.loadConfigResources}
  511. * @param json
  512. * @param extraResources - preloaded resources in the format of viewer config resources.
  513. */
  514. async importConfigResources(json: any, extraResources?: any) {
  515. if (!this.importer) throw 'Importer not initialized yet.'
  516. if (json.__isLoadedResources) return json
  517. return this.viewer?.loadConfigResources(json, extraResources)
  518. }
  519. /**
  520. * @deprecated not a plugin anymore
  521. */
  522. static readonly PluginType = 'AssetManager'
  523. // endregion
  524. }