From f378dc9d6b8f74d34b4dfd3b65cf564c689bdb95 Mon Sep 17 00:00:00 2001 From: Mike Date: Fri, 23 Oct 2026 09:49:49 -0400 Subject: Add a loopback MCP server for the running viewer (#44) The server is off by default and listens on 127.0.0.1. It can see and act in the logged-in session, including inventory, object contents, script editing, mesh and material upload, and animated mesh. --- indra/newview/llpreviewscript.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'indra/newview/llpreviewscript.cpp') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index ffb748baae..8364b7d964 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -2304,6 +2304,23 @@ void LLLiveLSLEditor::callbackLSLCompileFailed(const LLSD& compile_errors) closeIfNeeded(); } +void LLLiveLSLEditor::openInExternalEditorWhenReady() +{ + if (!mScriptEd) + { + return; + } + if (mAssetStatus == PREVIEW_ASSET_LOADED) + { + if (getIsModifiable()) + { + mScriptEd->openInExternalEditor(); + } + return; + } + mOpenExternalWhenLoaded = true; +} + void LLLiveLSLEditor::loadAsset() { //LL_INFOS() << "LLLiveLSLEditor::loadAsset()" << LL_ENDL; @@ -2415,6 +2432,11 @@ void LLLiveLSLEditor::onLoadComplete(const LLUUID& asset_id, instance->mScriptEd->setEnableEditing(true); instance->mAssetStatus = PREVIEW_ASSET_LOADED; instance->mScriptEd->setAssetID(asset_id); + if (instance->mOpenExternalWhenLoaded && instance->getIsModifiable()) + { + instance->mOpenExternalWhenLoaded = false; + instance->mScriptEd->openInExternalEditor(); + } } else { @@ -2431,6 +2453,7 @@ void LLLiveLSLEditor::onLoadComplete(const LLUUID& asset_id, { LLNotificationsUtil::add("UnableToLoadScript"); } + instance->mOpenExternalWhenLoaded = false; instance->mAssetStatus = PREVIEW_ASSET_ERROR; } } -- cgit v1.3