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

Commit

Permalink
Merge pull request #10871 from EtherealEngine/ir-3598-material-save-fix
Browse files Browse the repository at this point in the history
material save fix
  • Loading branch information
DanielBelmes authored Aug 5, 2024
2 parents c108d09 + 716d37e commit 07eb965
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ import { pathJoin, relativePathTo } from '@etherealengine/common/src/utils/miscU
import { EntityUUID, UUIDComponent, getOptionalComponent } from '@etherealengine/ecs'

import { STATIC_ASSET_REGEX } from '@etherealengine/common/src/regex'
import { EditorState } from '@etherealengine/editor/src/services/EditorServices'
import { getState } from '@etherealengine/hyperflux'
import { SourceComponent } from '../../../../scene/components/SourceComponent'
import { GLTFExporterPlugin, GLTFWriter } from '../GLTFExporter'
import { ExporterExtension } from './ExporterExtension'

export default class ImageRoutingExtension extends ExporterExtension implements GLTFExporterPlugin {
replacementImages: { texture: Texture; original: HTMLImageElement }[]

Expand All @@ -48,8 +49,10 @@ export default class ImageRoutingExtension extends ExporterExtension implements
const src = getOptionalComponent(materialEntity, SourceComponent)
if (!src) return
const resolvedPath = STATIC_ASSET_REGEX.exec(src)!
const projectDst = this.writer.options.projectName!
let projectSrc = this.writer.options.projectName!
//const projectDst = this.writer.options.projectName!
// let projectSrc = this.writer.options.projectName!
const projectDst = getState(EditorState).projectName!
let projectSrc = getState(EditorState).projectName!
let relativeSrc = './assets/'
if (resolvedPath) {
projectSrc = resolvedPath[1]
Expand Down

0 comments on commit 07eb965

Please sign in to comment.