URDF loader: resources path, "package://" removal, error messages, zero material path in .obj loader

This commit is contained in:
Oleg Klimov
2017-03-08 14:49:39 +03:00
parent 7ffbd35d42
commit 5b2a9d1a01
4 changed files with 389 additions and 422 deletions

View File

@@ -507,6 +507,16 @@ LoadObj(
const char* filename,
const char* mtl_basepath)
{
std::string tmp = filename;
if (!mtl_basepath) {
int last_slash = 0;
for (int c=0; c<(int)tmp.size(); ++c)
if (tmp[c]=='/' || tmp[c]=='\\')
last_slash = c;
tmp = tmp.substr(0, last_slash);
mtl_basepath = tmp.c_str();
//fprintf(stderr, "MTL PATH '%s' orig '%s'\n", mtl_basepath, filename);
}
shapes.resize(0);
std::vector<vertex_index> allIndices;