diff --git a/src/experimental/platform/ux/plugin.h b/src/experimental/platform/ux/plugin.h index a8eaf23e..482a666e 100644 --- a/src/experimental/platform/ux/plugin.h +++ b/src/experimental/platform/ux/plugin.h @@ -68,7 +68,8 @@ struct ModelPlugin final { // Callback for when the plugin wants to load a new model. This function will // return a buffer containing the model data as well as the content type of - // the buffer. Returns nullptr if no model needs to be loaded.s + // the buffer. If buf == model_name, then we assume that model_name stores the + // path of the model to load. Returns nullptr if no model needs to be loaded. GetModelToLoadFn get_model_to_load = nullptr; // Callback when a new model is loaded. diff --git a/src/experimental/studio/app.cc b/src/experimental/studio/app.cc index 0176d03f..ef2ddfde 100644 --- a/src/experimental/studio/app.cc +++ b/src/experimental/studio/app.cc @@ -421,7 +421,9 @@ void App::ProcessPendingLoads() { const char* buf = plugin->get_model_to_load( plugin, &size, content_type, sizeof(content_type), model_name, sizeof(model_name)); - if (buf && size) { + if (buf && buf == model_name) { + LoadModelFromFile(model_name); + } else if (buf && size) { const std::byte* bytes = reinterpret_cast(buf); LoadModelFromBuffer({bytes, bytes + size}, content_type, model_name); }