MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / ParseFromFile

Method ParseFromFile

engine/3rdparty/tinyobjloader/tiny_obj_loader.h:3273–3295  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3271}
3272
3273bool ObjReader::ParseFromFile(const std::string &filename,
3274 const ObjReaderConfig &config) {
3275 std::string mtl_search_path;
3276
3277 if (config.mtl_search_path.empty()) {
3278 //
3279 // split at last '/'(for unixish system) or '\\'(for windows) to get
3280 // the base directory of .obj file
3281 //
3282 size_t pos = filename.find_last_of("/\\");
3283 if (pos != std::string::npos) {
3284 mtl_search_path = filename.substr(0, pos);
3285 }
3286 } else {
3287 mtl_search_path = config.mtl_search_path;
3288 }
3289
3290 valid_ = LoadObj(&attrib_, &shapes_, &materials_, &warning_, &error_,
3291 filename.c_str(), mtl_search_path.c_str(),
3292 config.triangulate, config.vertex_color);
3293
3294 return valid_;
3295}
3296
3297bool ObjReader::ParseFromString(const std::string &obj_text,
3298 const std::string &mtl_text,

Callers 3

sample.pyFile · 0.80
loadStaticMeshMethod · 0.80

Calls 4

LoadObjFunction · 0.85
substrMethod · 0.80
emptyMethod · 0.45
c_strMethod · 0.45