game-framework icon indicating copy to clipboard operation
game-framework copied to clipboard

`getMaterialTexture` in model.lua fails to to build filenames correctly

Open andrewmcwatters opened this issue 3 years ago • 5 comments

Describe the bug getMaterialTexture in model.lua:ln:105 fails to build correct filenames to material textures. This is caused by outdated assimp bindings causing the first 4 characters of filenames to be missing.

To Reproduce Steps to reproduce the behavior:

  1. Run ./lgf
  2. See error

Expected behavior Running ./lgf should not produce crashes. getMaterialTexture should provide correct filenames.

Additional context Stack traceback:

luajit: ...mcwatters/Planimeter/lgf/lua/framework/graphics/mesh.lua:27: not found
stack traceback:
	[C]: in function 'error'
	...cwatters/Planimeter/lgf/lua/framework/graphics/image.lua:29: in function 'constructor'
	/Users/andrewmcwatters/Planimeter/lgf/lib/class.lua:130: in function 'newImage'
	...mcwatters/Planimeter/lgf/lua/framework/graphics/mesh.lua:27: in function 'constructor'
	/Users/andrewmcwatters/Planimeter/lgf/lib/class.lua:130: in function 'processMesh'
	...cwatters/Planimeter/lgf/lua/framework/graphics/model.lua:193: in function 'processNode'
	...cwatters/Planimeter/lgf/lua/framework/graphics/model.lua:219: in function 'constructor'
	/Users/andrewmcwatters/Planimeter/lgf/lib/class.lua:130: in function 'newModel'
	/Users/andrewmcwatters/Planimeter/lgf/main.lua:55: in function 'load'
	...rs/andrewmcwatters/Planimeter/lgf/lua/framework/init.lua:89: in function 'main'
	...rs/andrewmcwatters/Planimeter/lgf/lua/framework/init.lua:272: in main chunk
	[C]: at 0x0100c371d0

Filenames created:

models/DamagedHelmet/gltf/ult_AO.jpg
models/DamagedHelmet/gltf/ult_emissive.jpg
models/DamagedHelmet/gltf/ult_albedo.jpg
models/DamagedHelmet/gltf/ult_normal.jpg

Filenames expected:

models/DamagedHelmet/gltf/Default_AO.jpg
models/DamagedHelmet/gltf/Default_emissive.jpg
models/DamagedHelmet/gltf/Default_albedo.jpg
models/DamagedHelmet/gltf/Default_normal.jpg

See also https://github.com/LWJGL/lwjgl3/issues/516

andrewmcwatters avatar Oct 24 '21 20:10 andrewmcwatters