Skip to content

Commit

Permalink
Assume all assets for a .json are in the same directory as the .json,…
Browse files Browse the repository at this point in the history
… unless offset in the .mtl file.

Update the bundler script and one asset to reflect this change.
  • Loading branch information
vkoskiv committed Jun 16, 2020
1 parent 179c66e commit e4f9018
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion input/shapes/gridplane.mtl
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
map_Kd shapes/grid.png
map_Kd grid.png
2 changes: 1 addition & 1 deletion scripts/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def copy_file(src, dest):
texs = textures_from_mtl(assetPath + path_offset + mtl)
for tex in texs:
mkdir_if_need(destPath + '/' + path_offset + dest_offset)
copy_file(assetPath + tex, destPath + '/' + path_offset + dest_offset)
copy_file(assetPath + path_offset + tex, destPath + '/' + path_offset + dest_offset)
shutil.make_archive(destPath, 'zip', destPath)
shutil.rmtree(destPath)
print('\n\nBundle ' + destPath + '.zip created!')
Expand Down
2 changes: 1 addition & 1 deletion src/utils/loaders/sceneloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ bool loadMesh(struct renderer *r, char *inputFilePath, int idx, int meshCount) {
}

//Load textures for meshes
loadMeshTextures(r->prefs.assetPath, newMesh);
loadMeshTextures(getFilePath(inputFilePath), newMesh);

//Delete OBJ data
delete_obj_data(&data);
Expand Down

0 comments on commit e4f9018

Please sign in to comment.