22import * as path from 'path'
33import { CustomError } from '../customError'
44import { tl } from '../intl'
5+ import { normalizePath } from '../misc'
56import { format } from '../replace'
67
78export function getTexturePath ( texture : any ) {
@@ -32,8 +33,11 @@ export function getTexturePath(texture: any) {
3233 const textureIndex = relative . indexOf ( 'textures' ) // Locate 'texture' in the path
3334 if ( textureIndex > - 1 ) {
3435 relative . splice ( textureIndex , 1 ) // Remove 'texture' from the path
35- console . log ( 'Texture Path' , `${ namespace } :${ path . join ( ...relative ) } ` )
36- return `${ namespace } :${ path . join ( ...relative ) } ` // Generate texture path
36+ const textureReference = `${ namespace } :${ normalizePath (
37+ path . join ( ...relative )
38+ ) } ` // Generate texture path
39+ console . log ( 'Texture Reference:' , textureReference )
40+ return textureReference
3741 }
3842 }
3943 }
@@ -69,8 +73,11 @@ export function getModelPath(modelPath: string, modelName: string) {
6973 const modelsIndex = relative . indexOf ( 'models' ) // Locate 'texture' in the path
7074 if ( modelsIndex > - 1 ) {
7175 relative . splice ( modelsIndex , 1 ) // Remove 'texture' from the path
72- console . log ( 'Model Path' , `${ namespace } :${ path . join ( ...relative ) } ` )
73- return `${ namespace } :${ path . join ( ...relative ) } ` // Generate texture path
76+ const modelReference = `${ namespace } :${ normalizePath (
77+ path . join ( ...relative )
78+ ) } ` // Generate texture path
79+ console . log ( 'Model Reference:' , modelReference )
80+ return modelReference
7481 }
7582 }
7683 }
@@ -83,7 +90,7 @@ export function getModelPath(modelPath: string, modelName: string) {
8390 lines : format (
8491 tl ( 'animatedJava.popup.error.unableToGenerateModelPath.body' ) ,
8592 {
86- modelName
93+ modelName,
8794 }
8895 )
8996 . split ( '\n' )
0 commit comments