@detach has two jobs. As a restriction it locks the attachment that issues it (@detach=n) or a whole attachment point (@detach:<point>=n). As a force command it removes attachments: all of them, those on one point, one object by UUID, or the contents of a #RLV folder.
@detach=<n|y> lock/unlock this attachment
@detach:<attachpt>=<n|y> lock/unlock an attachment point
@detach=force detach every (unlocked) attachment
@detach:<attachpt>=force detach everything on that point
@detach:<uuid>=force detach one worn object
@detach:<folder/path>=force detach/unwear the items in a #RLV folder
chest, skull, left shoulder, r upper arm, spine, pelvis, neck, HUD points center 2, top right, top, top left, center, bottom left, bottom, bottom right, and so on. root is accepted as an alias for avatar center. With =force the name must match exactly. Otherwise it is treated as a folder name.#RLV, resolved the same way as for @attach (see Caveats). A leading #RLV/ is stripped.The issuing object can't be detached by the user (menus, inventory, Ctrl-drag, "Wear" replacing it, @detachall and similar force commands from other objects). If it is issued from a child prim, the whole linkset is locked. If a locked object is removed anyway (for example kicked off by llAttachToAvatar from another object, or by a "Wear" that replaced it), the viewer remembers it, moves its restrictions onto the inventory item, and re-attaches it after RestrainedLoveReattachDelay seconds (default 15 in Marine's viewer). The restrictions are then moved back onto the reattached object.
No object currently on the point, or attached there later, can be detached by the user. The in-world "Attach To" pie menu refuses that point.
Force detaching respects every lock: a locked object, a locked point, a locked folder, or a nostrip item stays put. @detach=force with no option goes through every attachment point and detaches whatever is detachable. It doesn't touch clothing; use @remoutfit for that.
With a folder, only the items directly in that folder are removed (objects, clothing, active gestures deactivated, and EEP settings items reset to region environment unless @setenv is active). Single no-modify objects in subfolders whose name contains an attachment point are also removed. Items directly inside #RLV itself are never touched. Use @detachall to include subfolders.
. are ignored. @detach:cuffs=force can therefore hit a folder named "Leather cuffs". Text after a | in each path component is ignored, so @getinvworn output can be fed straight back.nostrip is never force-removed.@detach:<point>=n doesn't stop something being attached to an empty point by script (llAttachToAvatar) or by inventory "Attach To". The viewer's illegal-attach check only looks at @addattach. Once attached there, the object is locked. The spec says the point is locked "full or empty". For a guaranteed empty point, combine with @addattach:<point>.@detach=y) or logs out with the avatar, the garbage collector releases its other restrictions too. Locks are re-sent by the object's own script on rez/login, and commands received during login are queued and run once the viewer is ready.detach event removes the lock before the viewer can tell the detach was illegal, so the object won't be re-attached.// Lock this collar on
llOwnerSay("@detach=n");
// Keep whatever is on the left hand there
llOwnerSay("@detach:left hand=n");
// Strip everything from the "Restraints/Cuffs" outfit folder
llOwnerSay("@detach:Restraints/Cuffs=force");
// Remove one worn object by key (e.g. found via a sensor on attachments)
llOwnerSay("@detach:" + (string)target + "=force");
canDetachWithExplanation(LLViewerObject*), RRInterface.cpp 6000-6067: a detach entry from any prim of the same root, then detach/detachthis/detachallthis issued by the object itself, then folder locks, nostrip, detach:<point> (with root alias), and remattach[:<point>]. Point check: 6076-6092.mContainsDetach / mHasLockedHuds: 403-421.force() 2098-2107 (UUID, then exact point name or empty, then folder). The #RLV/ prefix is stripped at 2004-2011. forceDetach() 2642-2669, forceDetachByUuid() 2671-2691, forceDetachByName() 3669-3828, folder lookup getCategoryUnderRlvShare() 3123-3189.root to Avatar Center in its lock checks (mkrlinterface.cpp 7108-7182). Its @getattach renames the point to "root", and @detach:root=force fails to find a point. It may then fall back to a folder lookup.isRestoringOutfit()), and doesn't treat items received during the session as unlocked (RL_ALLOW_ATTACH_DETACH_RECENTLY_RECEIVED_ITEMS is 0). Marine allows detaching a just-received item unless it sits in a ~ folder.norelay when they come through a relay (@relayed).This command works differently from RLVa's @detach; see the comparison.