Add function to get a list of objects in the region
tracked
Thunder Rahja
Sensors and listeners are limited in what objects they can detect, and both may require extensive setup and overhead in order to pick up all objects of interest in a region.
I suggest a new function to retrieve a list of object UUIDs that the owner has permission to return, whether at the region or parcel level, or the owner's own objects otherwise.
list llGetObjectList ( list filters, integer start, integer count )
Return a list of object keys matching provided filters. The list should be in the same order that the simulator stores object data, which presumably has the oldest objects first and newest objects last.
Some possible filters:
- OBJECT_LIST_FILTER_BY_NAME, string pattern
- OBJECT_LIST_FILTER_BY_OWNER_KEY, key id
- OBJECT_LIST_FILTER_BY_PARCEL, vector pos
- OBJECT_LIST_FILTER_BY_TYPE, integer type
pattern
would ideally be the same format as used for llLinksetDataFindKeys. type
would ideally align with object types used by llDetectedType.Objects owned by estate managers always have permission to return any objects in the region, so they should be allowed to see a list of all objects in the region with or without filters. Objects that are owned by the same resident/group as parcel(s) in the region have the same privilege. Objects that are given object return permission by a group role on group-owned land require the owner be present in the region to return objects, so the same behavior should be expected for this function.
Applications:
- Updating all instances of an object in a region, without requiring a listener or even an active script in the objects
- Finding and returning objects with high resource consumption (land impact, script memory, etc)
- Finding one's own objects when you don't have permission to return objects for the parcel/region
Log In
Spidey Linden
tracked
Issue tracked. We have no estimate when it may be implemented. Please see future updates here.
Lucia Nightfire
How about additional filters such as in_my_field_of_view (only works if camera tracking perms are present) and sort_by_distance? I've been needing something that returns a list of objects in my camera's FOV for years now.
Thunder Rahja
Lucia Nightfire: You can do this already with a sensor in an attachment while in mouselook, or you can narrow down a list of objects that may be in your FOV by checking the outputs of llWorldPosToHUD, using the positions of objects of interest as inputs.
Lucia Nightfire
Thunder Rahja I should have clarified, when alt-camming, IE, when you are not in mouselook and are camming around in the region and not just nearby, either.
Peter Stindberg
Would come in very handy for my current project, but I fear the amount of data potentially returned would overwhelm script memory by orders of magnitude.
Thunder Rahja
Peter Stindberg The
start
and count
parameters are also from llLinksetDataFindKeys and should behave similarly to allow pagination of data as to avoid overwhelming scripts.