Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Commit

Permalink
remove assetTypeOverride from ModelComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
HexaField committed May 29, 2024
1 parent cd1eabd commit 24d5623
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions examples/gltf.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Color, Vector3 } from 'three'
import { getMutableComponent, setComponent } from '@etherealengine/ecs/src/ComponentFunctions'
import { createEntity } from '@etherealengine/ecs/src/EntityFunctions'
import { DndWrapper } from '@etherealengine/editor/src/components/dnd/DndWrapper'
import { SupportedFileTypes } from '@etherealengine/editor/src/constants/AssetTypes'
import { ModelComponent } from '@etherealengine/engine/src/scene/components/ModelComponent'
import { useHookstate } from '@etherealengine/hyperflux'
import { NameComponent } from '@etherealengine/spatial/src/common/NameComponent'
Expand All @@ -15,7 +14,6 @@ import { TransformComponent } from '@etherealengine/spatial/src/transform/compon
import { Engine, EntityUUID, UUIDComponent } from '@etherealengine/ecs'
import { Template } from './utils/template'

import { ExtensionToAssetType, MimeTypeToAssetType } from '@etherealengine/engine/src/assets/constants/fileTypes'
import { BackgroundComponent } from '@etherealengine/spatial/src/renderer/components/SceneComponents'
import { EntityTreeComponent } from '@etherealengine/spatial/src/transform/components/EntityTree'

Expand All @@ -35,7 +33,7 @@ const GLTF = () => {
}, [])

const [{ canDrop, isOver, isDragging, isUploaded }, onDropTarget] = useDrop({
accept: [...SupportedFileTypes, '.glb'],
accept: ['.gltf', '.glb'],
async drop(item: any, monitor) {
if (item.files) {
const dndItem = monitor.getItem()
Expand All @@ -49,10 +47,6 @@ const GLTF = () => {
const gltfFile = files[0]
const model = getMutableComponent(entity, ModelComponent)
model.src.set(URL.createObjectURL(gltfFile))
const assetType = gltfFile.type
? MimeTypeToAssetType[gltfFile.type]
: ExtensionToAssetType[gltfFile.name.split('.').pop()!.toLocaleLowerCase()]
model.assetTypeOverride.set(assetType)

console.log(gltfFile)
} catch (err) {
Expand Down

0 comments on commit 24d5623

Please sign in to comment.