Make wavefront material parser use relative path for textures

This commit is contained in:
2019-09-27 10:08:57 -05:00
parent 819b3989de
commit 0b40e042bf

View File

@@ -100,7 +100,9 @@ class IMICFPS
when 'd' # Dissolved (Transparency)
when 'illum' # Illumination model
when 'map_Kd' # Diffuse texture
@model.materials[@model.current_material].set_texture(array[1])
texture = File.basename(array[1])
texture_path = "#{File.expand_path("../../", @model.file_path)}/textures/#{texture}"
@model.materials[@model.current_material].set_texture(texture_path)
end
end
end