{"action":"closed","issue":{"url":"https://api.github.com/repos/assimp/assimp/issues/641","labels_url":"https://api.github.com/repos/assimp/assimp/issues/641/labels{/name}","comments_url":"https://api.github.com/repos/assimp/assimp/issues/641/comments","events_url":"https://api.github.com/repos/assimp/assimp/issues/641/events","html_url":"https://github.com/assimp/assimp/issues/641","id":101931458,"number":641,"title":"IOSystem relative file path bug?","user":{"login":"jeannekamikaze","id":1595451,"avatar_url":"https://avatars.githubusercontent.com/u/1595451?v=3","gravatar_id":"","url":"https://api.github.com/users/jeannekamikaze","html_url":"https://github.com/jeannekamikaze","followers_url":"https://api.github.com/users/jeannekamikaze/followers","following_url":"https://api.github.com/users/jeannekamikaze/following{/other_user}","gists_url":"https://api.github.com/users/jeannekamikaze/gists{/gist_id}","starred_url":"https://api.github.com/users/jeannekamikaze/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeannekamikaze/subscriptions","organizations_url":"https://api.github.com/users/jeannekamikaze/orgs","repos_url":"https://api.github.com/users/jeannekamikaze/repos","events_url":"https://api.github.com/users/jeannekamikaze/events{/privacy}","received_events_url":"https://api.github.com/users/jeannekamikaze/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-19T16:10:25Z","updated_at":"2015-08-30T13:23:08Z","closed_at":"2015-08-30T13:23:08Z","body":"Hello Assimp team,\r\n\r\nI am having trouble implementing an `IOSystem` to read assets from zip files. The problem that I am having is that the `Importer` is calling my `IOSystem`'s `Open()` function with relative paths, and so I do not know how the `IOSystem` is supposed to find the files.\r\n\r\nThe zip file I am testing this with has the following layout:\r\n\r\n    test/\r\n        foo.obj\r\n        foo.mtl\r\n \r\nWhere foo.obj is an OBJ file that references the file foo.mtl as follows:\r\n\r\n    mtllib foo.mtl\r\n\r\nI instance an importer, pass it an instance of my `IOSystem`, and attempt to load the OBJ model:\r\n\r\n    Importer importer;\r\n    importer.setIOHandler(new MyIOSystem);\r\n    const aiScene* scene = importer.ReadFile(“test/foo.obj, flags);\r\n\r\nThe importer then calls my `IOSystem`’s `Open()` function with `file = “test/foo.obj”`. The `IOSystem` successfully loads the OBJ file and returns it to the importer. The importer then attempts to load the associated material file `foo.mtl`, but this time it calls my `IOSystem`’s `Open()` function with `file = “foo.mtl”` instead of `file = “test/foo.mtl”`, i.e. it calls the `IOSystem` with a path relative to the OBJ file, so my `IOSystem` fails to find the file. How is the `IOSystem` supposed to know that the MTL file is also inside the `test/` directory? Shouldn't the importer be calling the `IOSystem` with an \"absolute\" path?\r\n \r\nThanks,\r\n \r\nJeanne-Kamikaze"}}