Ensure resource providers are correctly initialized.

PiperOrigin-RevId: 854095105
Change-Id: I028265d7f51e6ab178f4f3a1d801ba773093214f
This commit is contained in:
Haroon Qureshi
2026-01-09 02:06:21 -08:00
committed by Copybara-Service
parent ce74475c39
commit 2c4f710cf4
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -75,6 +75,8 @@ int main(int argc, char** argv, char** envp) {
const std::string ini_path = std::string(home ? home : ".") + "/.mujoco.ini";
mjpResourceProvider resource_provider;
mjp_defaultResourceProvider(&resource_provider);
resource_provider.open = [](mjResource* resource) {
const std::string resolved_path = Resolve(resource->name);
FileResource* f = new FileResource(resolved_path);
+2
View File
@@ -72,6 +72,8 @@ void Init() {
const std::string ini_path = "";
mjpResourceProvider resource_provider;
mjp_defaultResourceProvider(&resource_provider);
resource_provider.open = [](mjResource* resource) {
AssetRegistry& r = AssetRegistry::Instance();
return static_cast<int>(r.Get(resource->name).size());