• All submissions to this site are governed by Second Life Project Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.
Issue Details (XML | Word | Printable)

Key: SVC-2105
Type: New Feature New Feature
Status: Open Open
Priority: Critical Critical
Assignee: Babbage Linden
Reporter: Haravikk Mistral
Votes: 45
Watchers: 10
Operations

If you were logged in you would be able to see more operations.
2. Second Life Service - SVC

llSetLinkListPrimitiveParams() for setting multiple, specific linked items

Created: 07/Apr/08 06:34 AM   Updated: Thursday 05:39 PM
Return to search
Component/s: Scripts
Affects Version/s: 1.20.0 Server, 1.21.0 Server, 1.22.1 Server, 1.22.2 Server, 1.22.3 Server, 1.22.4 Server, 1.23.4 Server, 1.24 Server, 1.25 Server, 1.26 Server, 1.27 Server, 1.30 Server
Fix Version/s: None

Issue Links:
Duplicate
 
Relates


 Description  « Hide
Okay, llSetLinkPrimitiveParams() has been a huge help for manipulating complex objects with a single script, however, it's main limitation is that it can only take a single link-number at a time, OR it can manipulate all/most links simultaneously. This isn't ideal if you have a linked set with X links, but only want to manipulate Y amount of them.

For example:
I have a 5 prims elevator as follows:
1 - Elevator floor
2 - Elevator walls
3 - Elevator roof
4 - Elevator door
5 - Elevator door

The two elevator doors are both opened using exactly the same primitive parameters, however, currently I have to do it using two calls to llSetLinkPrimitiveParams() using the same list, or have child-scripts in the doors so that I can do this simultaneously.

This proposal is therefore for the following function:

llSetLinkListPrimitiveParams(list links, list parameters);

links - this a list of integers declaring the link numbers that this function should be applied to. Invalid links are ignored, while non-integer values result in an immediate error. Use of LINK_SET and LINK_ALL_OTHERS is redundant and also ignored.
parameters - this is identical to the parameters used in llSetPrimitiveParams() and llSetLinkPrimitiveParams().

This allows us to apply identical parameters to multiple primitives in a set, but without having to do them one at a time, or with child-scripts, or by changing all primitives.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Brandon Shinobu added a comment - 28/Aug/08 12:51 PM - edited
So for example:

llSetLinkListPrimitiveParams( [5,6,8] , [PRIM_FULLBRIGHT,ALL_SIDES,TRUE] )

To set 5,6 and 8 to fullbright.

Summon Qarl!


BETLOG Hax added a comment - 28/Aug/08 03:07 PM - edited
Voted yes.
My comment below is not very well thought out, but i felt some alternate syntax might be worth consideration.

(Yeah I know, lists inside lists ~= arrays)
llSetLinkListPrimitiveParams( [
[5, 6, 8], PRIM_POSITION, vector position
[6, 8], PRIM_SIZE, vector size
[8] PRIM_FULLBRIGHT,ALL_SIDES,TRUE
);

...or getting even more silly.. linknum bitmasks
llSetLinkListPrimitiveParams( [
00010011, PRIM_POSITION, vector position
00001110, PRIM_SIZE, vector size
00001000, PRIM_FULLBRIGHT,ALL_SIDES,TRUE
]);

anyway.. for discussion.


Haravikk Mistral added a comment - 28/Aug/08 03:31 PM
While they would be nice features to have BETLOG I'm afraid lists within lists isn't very likely any-time soon, unless we went into the more complicated syntax of defining lengths (i.e - first value tells the sim how many prims you're going to specify, thus it can count these then know when to start interpreting commands). However that can get very unwieldy very fast.

As for bit-masks, that only works if the links are all number as powers of two (1, 2, 4, 8, 16 etc.) and would reduce us to only 32 primitives in a linked set.

I think for now the best thing we can hope for is a basic llSetLinkListPrimitiveParams() function, and maybe getting rid of the 0.2 second delay and replace it with a more useful throttling system (e.g if a script is sending too many object updates per second then it starts to get throttled).


Brandon Shinobu added a comment - 08/Oct/08 04:39 PM
Of course, who then defines "too many"? I'd be a proponent of that instead of a delay, but just the same, it would be most useful for extensive changes, such as in avatars when changing looks. You might need a series of them to change several groups.

Zaphod Zepp added a comment - 18/Jan/09 05:06 PM - edited
Absolutely agree on the need for this, as currently it's simply not possibly to adjust the positions/rotations etc. of multiple prims simultaneously, making prim animation very restrictive (or at least, looking very messy).

My suggestion is a single list with a delimeter constant indicating the end of adjustments for a particular prim. Technically like this you don't even need a new function name, as if you don't use the delimeter, it's the same as llSetLinkPrimitiveParams. E.g:

llSetLinkListPrimitiveParams([2, PRIM_POSITION, newPos2, PRIM_ROTATION, newRot2, NEXT_PRIM, 3, PRIM_POSITION, newPos3, PRIM_ROTATION, newRot3, NEXT_PRIM, 4, PRIM_POSITION, newPos4, etc. etc...]);

either that or two new functions:

llBeginAdjustPrims();
llEndAdjustPrims();

that basically queue up all the adjustments and fire one simultaneous change event at the end.
And I'd certainly also vote for at least halving the delay time on such a function - having to run multiple scripts simultaneously to get more than 5fps animation is messy indeed.

Glad to see others have raised the need for this function. But to be truly useful a llGetLinkPrimitiveParams() function is definitely also needed.


Haravikk Mistral added a comment - 19/Jan/09 03:55 AM
Hmm, while I do like your suggestion you seem to be going more for sending multiple different llSetPrimitiveParams() requests to multiple different child-prims in a single action. While this is desirable, I feel it may be better placed as its own issue, as really this is for applying the same, single set of parameters to multiple primitives. This has the advantage that the list-size is much smaller, and in theory processing it (on the simulator's side) should be a lot easier, as the changes for one primitive should be identical to the changes to another.

Zaphod Zepp added a comment - 19/Jan/09 05:57 PM
True, so I guess ideally the same function would support either...hmm, how about

llSetLinkListPrimitiveParams([LINK_LIST_START, 1, 2, 3, LINK_LIST_END, PRIM_POSITION, newPos, PRIM_ROTATION, newRot, NEXT_PRIM,
LINK_LIST_START, 4, 5, LINK_LIST_END, PRIM_POSITION, newPos2, etc. etc.]);

LINK_LIST_START...LINK_LIST_END would be optional - you could simply specify a (positive) prim number if you were only applying the changes to a single prim.

This wouldn't be all that useful for what I want to do because while I am moving/rotation a bunch of prims together, their actual positions are all subtly different.
If you could specify, e.g. PRIM_POSITION_RELATIVE, to provide a vector by which to move all the same prims from their current positions, I'd be very happy!

Also, I realised this isn't the same syntax as llSetLinkPrimitiveParams, which takes two parameters, the first being the single link number, the latter being the list of changes to make to it.


BETLOG Hax added a comment - 20/Jan/09 03:47 PM
Following the brainfart i posted above, I think the simplest way would be:
llSetLinkPrimitiveParams(
[5, 6, 8], [
PRIM_POSITION, position
,PRIM_SIZE, size
,PRIM_FULLBRIGHT,ALL_SIDES,TRUE
]
,[6, 8], [
, PRIM_SIZE, size
]
,[8], [
,PRIM_FULLBRIGHT,ALL_SIDES,TRUE
]
);

This is semi-consistent with the existing function too.


Zaphod Zepp added a comment - 20/Jan/09 09:02 PM
That assumes you can have functions taking variable numbers of parameters, which I don't think LSL supports.

Brandon Shinobu added a comment - 01/Apr/09 08:21 AM - edited
Rereading what Zaphod has said, I have to agree. If you cut that down to just two parameters (one list for links, and the second list for prim properties) we'll be good as gold. Sure, it would be nice to set different properties to different sets of links all at once, but unless that's feasible in some manner I'm not aware of, I don't think it'll happen. See my suggestion in the first comment of the JIRA:

" llSetLinkListPrimitiveParams( [5,6,8] , [PRIM_FULLBRIGHT,ALL_SIDES,TRUE] );"

So basically:

llSetLinkListPrimitiveParams( [link list] , [property list] );

Please, get as many people as you can to vote on this. If for no other reason, it'll get more people aware of the need for it, and get people asking LL for a development team on it. Does anyone know an opensource dev who'd be able to write a patch for this feature and attach it?


Haravikk Mistral added a comment - 01/Apr/09 08:49 AM
Yeah that's what I think is best as originally proposed; the main reason I think that we can use LINK_SET etc. in llSetLinkPrimitiveParams() is that it only has to process one list of parameters, which can then be applied to all links in one-go, whereas with different lists for different links really what you're asking for is for the current 0.2 second delay to be removed.

Sebastean Steamweaver added a comment - 13/May/09 05:55 PM
Added a link to SVC-4252 as I suggested a similar function based on a new llSetLinkPrimitiveParams proposal.

Iskar Ariantho added a comment - 31/Jul/09 03:28 PM
Ok, i might be missing something here, but it seems all suggestions allow a way to set prims params without the 0.2 seconds delay impact. Instead of inventing all kind of ways to give link numbers to llSetLinkPrimitiveParams, simply remove its 0.2 penalty? We can than simply call the same function multiple times for multiple linknumbers.

The only argument i find against it would be if SL would process all the changes to the prims instanteniously, making it a single PrimUpdate message to the viewer(s). If they however handle it sequentually internally, resulting in multiple PrimUpdate messages, there wont be much to gain by make "smart" llSetLinkPrimitiveParam's.


Sebastean Steamweaver added a comment - 01/Aug/09 03:42 AM
@Iskar

Simon Linden actually confirmed through some of his own research that scripts using loops to call a function multiple times actually do have a fairly high cost on script time and processing, whereas setting prim properties all at once was a quick and relatively painless process for the server (such as can be done with LINK_SET or LINK_ALL_OTHERS with the current llSetLinkPrimitiveParams). That aside, writing for loops tends to be kind of painful anyway, and if we were able to specify in one function what we need done, rather than have to worry with a for loop each time and iterating all of the variables needed, that would be much easier for scripters alone.

What we're asking for here isn't really anything new. You can already set a bunch of prims with the same properties at once as I pointed out earlier, using LINK_SET and LINK_ALL_OTHERS. What we can't do, is specify which prims we want to make those changes to. That's where llSetLinkListPrimitiveParams would come in. It would let us do the same thing, but only to specific prims in the linkset, greatly reducing the work the script needs to do, and reducing the time it takes to do it.


Sebastean Steamweaver added a comment - 19/Nov/09 05:39 PM - edited
As per Andrew's instructions on Nov. 19th's office hours, I'll be changing priorities on the issues linked to MISC-3007 to make things easier for the lindens who will be working on this issue:

[17:13:13] Andrew Linden: Go ahead and change the priorities on the list. That might be helpful.
[17:13:26] Sebastean Steamweaver: What priority would you prefer them be set to?
[17:13:48] Andrew Linden: Well, the ones you really want set higher than "normal"