diff options
| author | Rider Linden <rider@lindenlab.com> | 2026-08-10 15:45:03 -0700 |
|---|---|---|
| committer | Rider Linden <rider@lindenlab.com> | 2026-08-10 15:45:03 -0700 |
| commit | 5e2d671895b292726f923db5f8e7375097b6e159 (patch) | |
| tree | ef2c79039d435c94b36d3b8f2ddd35ab3e367f38 /indra/newview/llscripteditorws.cpp | |
| parent | 309fc5b4c21151e3664f5bdab99f57bae24266a0 (diff) | |
Refresh the object's data when it is published. (link children seem to be an issue still)
Diffstat (limited to 'indra/newview/llscripteditorws.cpp')
| -rw-r--r-- | indra/newview/llscripteditorws.cpp | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/indra/newview/llscripteditorws.cpp b/indra/newview/llscripteditorws.cpp index 3fbcd5c384..95e06583d3 100644 --- a/indra/newview/llscripteditorws.cpp +++ b/indra/newview/llscripteditorws.cpp @@ -2086,7 +2086,13 @@ std::string LLScriptEditorWSServer::getPrimName(LLViewerObject* obj) } LLSelectNode* node = LLSelectMgr::instance().getSelection()->findNode(obj); - return (node && !node->mName.empty()) ? node->mName : std::string(); + if (node && !node->mName.empty()) + { + return node->mName; + } + + // Never emit an empty prim/object name to downstream tooling. + return obj->getID().asString(); } bool LLScriptEditorWSServer::publishObject(const LLUUID& object_id) @@ -2114,6 +2120,13 @@ bool LLScriptEditorWSServer::publishObject(const LLUUID& object_id) // Collect root + all children std::vector<LLViewerObject*> prims = collect_linkset(root); + // Request object properties for each prim in the linkset (root + children), + // matching the hover path so name/description metadata is refreshed. + for (LLViewerObject* prim : prims) + { + LLSelectMgr::instance().requestObjectPropertiesFamily(prim); + } + // Set up a PendingPublish to coordinate inventory loading across all prims. // We register a listener and call requestInventory() on every prim. // If inventory is already loaded, requestInventory() fires the callback @@ -2196,6 +2209,31 @@ void LLScriptEditorWSServer::buildAndSendPublish(const LLUUID& object_id) LLPublishedObjectMgr::PublishedObjectInfo& published_info = mPublishedObjectManager.finalizePendingPublish(object_id, std::move(info)); + // Align outgoing publish payload with any property responses that arrived + // while inventory-gated publish was still pending. + pub["object_name"] = published_info.mObjectName; + pub["object_description"] = published_info.mObjectDescription; + if (pub.has("linked_objects")) + { + LLSD& linked_objects = pub["linked_objects"]; + for (S32 i = 0; i < linked_objects.size(); ++i) + { + const LLUUID link_id = linked_objects[i]["link_id"].asUUID(); + auto prim_it = std::find_if( + published_info.mPrims.begin(), + published_info.mPrims.end(), + [&](const LLPublishedObjectMgr::PublishedPrimInfo& p) + { + return p.mPrimID == link_id; + }); + if (prim_it != published_info.mPrims.end()) + { + linked_objects[i]["link_name"] = prim_it->mPrimName; + linked_objects[i]["link_description"] = prim_it->mPrimDescription; + } + } + } + // Send notification LLSD message; message["object"] = pub; @@ -2204,6 +2242,13 @@ void LLScriptEditorWSServer::buildAndSendPublish(const LLUUID& object_id) LL_INFOS("ScriptEditorWS") << "Published object " << object_id << " (" << pub["object_name"].asString() << ") with " << (prims.size() - 1) << " linked prim(s)" << LL_ENDL; + + // Re-request object properties now that the object is published so + // onObjectPropertyChanged can emit object.update for root and linked prims. + for (LLViewerObject* prim : prims) + { + LLSelectMgr::instance().requestObjectPropertiesFamily(prim); + } } void LLScriptEditorWSServer::onLinksetChildAdded(const LLUUID& root_id, LLViewerObject* child) @@ -2344,6 +2389,8 @@ void LLScriptEditorWSServer::onObjectPropertyChanged( LLUUID root_id = prim->getRootEdit()->getID(); + mPublishedObjectManager.recordPendingPropertyChange(root_id, prim_id, name, desc); + bool should_refresh_inventory = mPublishedObjectManager.markPrimInventorySerialAndDetectChange( root_id, prim_id, |
