Skip to content

Add LEAP API to query scene-level attached objects (getAttachedObjectsList) #5742

@kurtlinden

Description

@kurtlinden

Summary

There is currently no LEAP API to query which objects are attached to the agent's avatar at the scene level. The only way to check attachments via LEAP is by reading the Current Outfit Folder (COF) through the Inventory API, which reflects inventory state rather than what's actually rezzed in the scene graph. This would be useful for implementing tests in viewer automation.

Problem

COF and the scene graph are not always in sync. An item can be listed in COF before its scene object has fully rezzed (e.g., after a teleport or region crossing), or conversely, a scene object can persist briefly after being removed from COF. There's also no way to query which attachment point an object is on, or its local position/rotation, through any existing LEAP operation.

Proposal

Add a new LEAP operation — e.g., getAttachedObjectsList — that iterates gAgentAvatarp->getAttachedObjects() and returns scene-level data for each attached object.

Suggested response schema

{
  "attachments": [
    {
      "object_id": "<scene object UUID>",
      "inventory_item_id": "<inventory item UUID>",
      "name": "Party Hat",
      "attachment_point": "Skull",
      "attachment_point_index": 2,
      "position": [0.0, 0.12, 0.25],
      "rotation": [0.0, 0.0, 0.0, 1.0],
      "is_temporary": false
    }
  ]
}
Field Source Purpose
object_id LLViewerObject::getID() Confirms the object exists in the scene graph
inventory_item_id LLViewerObject::getAttachmentItemID() Correlates scene object back to inventory
name Object name Human-readable identification
attachment_point LLViewerJointAttachment::getName() Which body part the object is on
position / rotation Attachment local offset Object placement relative to attach point
is_temporary Temp-attach flag Distinguishes temp-attached objects

Implementation notes

  • Most likely lives on LLAgentAPI alongside existing agent LEAP operations, or on a new dedicated listener.
  • Core data comes from iterating gAgentAvatarp->getAttachedObjects() and serializing each LLViewerJointAttachment's object list.
  • Read-only, no security implications — this is the agent's own avatar data.

Motivation

This fills a gap in the LEAP API surface. Scene-level queries exist for the camera, the agent's position, and UI state, but not for the agent's attachments. Having this would enable:

  • Distinguishing "worn in inventory" vs. "rezzed in scene"
  • Querying attachment point assignments
  • Reading attachment position/rotation offsets
  • Identifying temp-attached objects


This repo is using Opire - what does it mean? 👇
💵 Everyone can add rewards for this issue commenting /reward 100 (replace 100 with the amount).
🕵️‍♂️ If someone starts working on this issue to earn the rewards, they can comment /try to let everyone know!
🙌 And when they open the PR, they can comment /claim #5742 either in the PR description or in a PR's comment.

🪙 Also, everyone can tip any user commenting /tip 20 @kurtlinden (replace 20 with the amount, and @kurtlinden with the user to tip).

📖 If you want to learn more, check out our documentation.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions