Give Resource Providers a chance to load files.
File resolution only checks local file system. Resource providers may still be able to load from a path even if it is not resolved. PiperOrigin-RevId: 867534134 Change-Id: I802566136b965ad839393f56a4d4924dda2e1973
This commit is contained in:
committed by
Copybara-Service
parent
8557cf201b
commit
be93e8eeb2
@@ -84,7 +84,7 @@ std::string ResolveFile(const std::string& filename,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SaveToWebp(int width, int height, const std::byte* data,
|
void SaveToWebp(int width, int height, const std::byte* data,
|
||||||
|
|||||||
@@ -145,14 +145,8 @@ void App::InitEmptyModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void App::LoadModelFromFile(const std::string& filepath) {
|
void App::LoadModelFromFile(const std::string& filepath) {
|
||||||
|
|
||||||
const std::string resolved_file =
|
const std::string resolved_file =
|
||||||
platform::ResolveFile(filepath, search_paths_);
|
platform::ResolveFile(filepath, search_paths_);
|
||||||
if (resolved_file.empty()) {
|
|
||||||
SetLoadError("File not found: " + filepath);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
model_holder_ = platform::ModelHolder::FromFile(resolved_file);
|
model_holder_ = platform::ModelHolder::FromFile(resolved_file);
|
||||||
if (model_holder_->ok()) {
|
if (model_holder_->ok()) {
|
||||||
OnModelLoaded(filepath, kModelFromFile);
|
OnModelLoaded(filepath, kModelFromFile);
|
||||||
|
|||||||
Reference in New Issue
Block a user