Jump to content

How to identify prims in the linkset?


lucynes1
 Share

You are about to reply to a thread that has been inactive for 539 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hello! I encountered some issue, hope somebody will help me..

In order to edit the prims in the linkset (by llSetLinkPrimitiveParamsFast function or any other) I need to know the prim's link number. 
The problem is that the link number may change during adding/removing prims from the linkset and probably some other cases too.
if link numbering changes, how can I identify the prim then? I heard that people use prim names and descriptions to do that,
but the user or 3rd party scripts may change prims' names and descriptions - or sometimes simply the newly added prim to the linkset
may simply have the same name as some prim being already in the linkset. The prim may be mesh or non-mesh.

So my question is.. when I create my fresh linkset, how to mark the prims so I can always get their link number in order to edit them,
even if relinking happens so my llSetLinkPrimitiveParamsFast function always edits the right prim? What is the most universal and "pro" way to do this? 

Thank you in advance for help! ❤️

Edited by lucynes1
Link to comment
Share on other sites

  • lucynes1 changed the title to How to identify prims in the linkset?

Trying to make something fool-proof is probably unnecessary. Just write some documentation for the end-user, so that they're aware of whatever traits your script cares about.

Basically "Note: The script does X based on link names, edit at your own risk!" (Or even turn that into a feature they can take advantage of.)

Edited by Wulfie Reanimator
  • Like 2
Link to comment
Share on other sites

There's llGetLinkKey.

I guess the way to use this would be to run through the linkset saving the key and the link number of the critical prims based on their names or descriptions when the linkset is first made. Then when/if the changed event is triggered with CHANGED_LINK set, you'd run through the linkset again resaving the link numbers of the links whose keys you've saved. And you could use LSD to save this data so that it survives a script reset.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

6 minutes ago, KT Kingsley said:

There's llGetLinkKey.

I guess the way to use this would be to run through the linkset saving the key and the link number of the critical prims based on their names or descriptions when the linkset is first made.

And whenever the object is rezzed, since everything will be assigned new instance uuids.

  • Like 1
  • Thanks 2
Link to comment
Share on other sites

1 hour ago, Fenix Eldritch said:

And whenever the object is rezzed, since everything will be assigned new instance uuids.

1 hour ago, KT Kingsley said:

There's llGetLinkKey.

I guess the way to use this would be to run through the linkset saving the key and the link number of the critical prims based on their names or descriptions when the linkset is first made. Then when/if the changed event is triggered with CHANGED_LINK set, you'd run through the linkset again resaving the link numbers of the links whose keys you've saved. And you could use LSD to save this data so that it survives a script reset.

is that the only case the prim changes UUID? What if avatar the object is attached to moves/teleports to another region? or if the prim moves to another region by physics? or what if the region restarts?

Edited by lucynes1
Link to comment
Share on other sites

24 minutes ago, lucynes1 said:

is that the only case the prim changes UUID? What if avatar the object is attached to moves/teleports to another region? or if the prim moves to another region by physics? or what if the region restarts?

The Keys of the object and each prim in the object should not change unless taken into inventory and re-rezzed in-world.  Similarly, a new "copy" from inventory would also get different Keys.  Keys are persistant for rezzed objects.

(Man, I hope that I am right! Someone will say if I am wrong.)

One reason I believe the "Keys" are stable for rezzed objects is, there are heavy script dependences.  For example:  Many objects are scripted to rez "child" objects, and send their own "parent" Key to the "child" object (or vice-versa, a "child" sends its key to the "parent").  This allows the "child" object to communicate with the Parent.  If those Keys change, then those scripts break. (Many objects are scripted to initially send "channel" numbers instead of Keys to their rezzed "child" objects, etc.)

Link to comment
Share on other sites

37 minutes ago, lucynes1 said:

is that the only case the prim changes UUID? What if avatar the object is attached to moves/teleports to another region? or if the prim moves to another region by physics? or what if the region restarts?

From the wiki: https://wiki.secondlife.com/wiki/UUID#Instance_UUIDs

Quote

Instance UUIDs

Every time an object is rezzed, all the prims (including the root prim) are assigned instance UUIDs. An avatar's attachment keeps its instance UUID when the user teleports or moves from one region to another (they are not kept when an avatar logs off). The instance UUID is what is returned by llGetKey and other functions.

Additionally, the UUID of a rezzed object will not change if it enters a new region via physics, nor will it change if the region restarts. It's only when the object is rezzed does it get its instance uuid.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

You may find these userful:

https://marketplace.secondlife.com/p/BikeClone-Tools-Powerful-builder-utilities-Replicater-Cloner-Networked-texture-map-part-clone/2971259

this above include a tool to associate every linkset number to its geometry, position, etc

https://marketplace.secondlife.com/p/Scobas-Object-Duplicator/3393548

I used them in the past to duplicate a linkset where the texture changer was strictly depending on each prim number.

There are also systems to save extra informations in the object description or in the floating text ( llSetText, llGetText )

Edited by 2Tessa
  • Like 1
Link to comment
Share on other sites

@Fenix Eldritch @KT Kingsley

I did test it and it seems to work! Thank you! I've just learnt most efficient way to handle link numbers and I don't rely on any data the users or 3rd party scripts change! Hurray!!! ❤️

@2Tessa

Thanks for the link! But i won't use it - checking geometry every time i want to change something would take too much both time and script memory.

Edited by lucynes1
  • Like 1
Link to comment
Share on other sites

https://wiki.secondlife.com/wiki/LlGetLinkName

In the "Useful Snippets" section of this page is a basic function that will return the link number of a named link. If you are calling this function often in a script, you may want to optimise for time over memory by caching link names in a list and then poking the list. If not, this may well do you fine.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 539 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...