Skip to content

Commit

Permalink
core: frontend: Update models assets to /src location
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Feb 26, 2024
1 parent 170473f commit 6605861
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Expand Up @@ -91,12 +91,12 @@ import { Dictionary, Indexed, Keyed } from '@/types/common'
import { PingType } from '@/types/ping'
import { sleep } from '@/utils/helper_functions'
const models: Record<string, string> = import.meta.glob('/public/assets/vehicles/models/**', { eager: true })
const models: Record<string, string> = import.meta.glob('/src/assets/vehicles/models/**', { eager: true })
function get_model(vehicle_name: string, frame_name: string): undefined | string {
const release_path = `assets/vehicles/models/${vehicle_name}/${frame_name}.glb`
if (models[`/public/${release_path}`]) {
return `/assets/vehicles/models/${vehicle_name}/${frame_name}.glb`
const release_path = `/src/assets/vehicles/models/${vehicle_name}/${frame_name}.glb`
if (models[release_path]) {
return release_path
}
return undefined
}
Expand Down Expand Up @@ -349,8 +349,8 @@ export default Vue.extend({
const file = new File([await cropped_image.toBlob(mimeType)], 'viewer.png', { type: mimeType })
saveAs(file)
},
async reloadAnnotations() {
const json = await models[`./${this.vehicle_folder}/${this.frame_name}.json`]
reloadAnnotations() {
const json = models[`/src/assets/vehicles/models/${this.vehicle_folder}/${this.frame_name}.json`]
if (json) {
this.annotations = json.annotations ?? {}
}
Expand Down
8 changes: 4 additions & 4 deletions core/frontend/src/components/wizard/Wizard.vue
Expand Up @@ -280,12 +280,12 @@ import RequireInternet from './RequireInternet.vue'
const WIZARD_VERSION = 4
const models: Record<string, string> = import.meta.glob('/public/assets/vehicles/models/**', { eager: true })
const models: Record<string, string> = import.meta.glob('/src/assets/vehicles/models/**', { eager: true })
function get_model(vehicle_name: string, frame_name: string): undefined | string {
const release_path = `assets/vehicles/models/${vehicle_name}/${frame_name}.glb`
if (models[`/public/${release_path}`]) {
return `/assets/vehicles/models/${vehicle_name}/${frame_name}.glb`
const release_path = `/src/assets/vehicles/models/${vehicle_name}/${frame_name}.glb`
if (models[release_path]) {
return release_path
}
return undefined
}
Expand Down

0 comments on commit 6605861

Please sign in to comment.