secondlife / jira-archive

2 stars 0 forks source link

[BUG-232631] New constant: PRIM_LINK_SUBSET #9867

Open sl-service-account opened 1 year ago

sl-service-account commented 1 year ago

How would you like the feature to work?

Used to get or set multiple specific links with a single PrimParameters call with finer control that would be allowed with the existing LINK_* numbers and with better efficiency than targeting each link with PRIM_LINK_TARGET. Since we cannot have lists within lists, I propose this constant takes an additional string parameter which itself is a CSV (comma separated value) list of link numbers.

[PIRM_LINK_SUBSET, string comma_separated_string_of_link_targets ]

Example: The following code would change the prim size of links 1, 5, and 8 within the linkset.

llSetPrimitiveParams( [ PRIM_LINK_SUBSET, "1,5,8", PRIM_SIZE, <1,1,1> ] );

Alternatively, I had considered this parameter instead taking a variable number of integer parameters, with the first one specifying how many link_targets would be specified in sequence. Though I think that may be too unwieldy.

If a nonexistant link target is specified, it is silently ignored (similar to how PRIM_LINK_TARGET ignores numbers outside the current linkset). If an invalid character (anything other than a number or comma) is used in the string, a runtime error is thrown.

Why is this feature important to you? How would it benefit the community?

I feel this is important because it enhances how creators can apply the same set of parameters to a subset of links without having to duplicate the parameters for each link target. This would result in much more efficient lists for this use case.

With the existing PRIM_LINK_TARGET, you must re-specify all the parameters for each instance of PRIM_LINK_TARGET. This can be potentially wasteful if you are targeting a large number of child prims andr affecting a large amount of the same changes to each. The idea behind this suggestion is that you could specify all of the targets in one go, and then not have to duplicate the same parameters list x amount of times.

Granted, this use case is specifically targeted towards the scenario where you want to apply the same changes to all those child prims. Normally in those cases, you would use the special LINK_* numbers, but those only support a limited grouping: LINK_ROOT, LINK_SET, LINK_ALL OTHERS, LINK_CHILDREN, LINK_THIS. They do not allow for any finer control in selecting subsets with a single call.

Thank you for any consideration.

Links

Related

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-232631 | | Summary | New constant: PRIM_LINK_SUBSET | | Type | New Feature Request | | Priority | Unset | | Status | Accepted | | Resolution | Accepted | | Reporter | Fenix Eldritch (fenix.eldritch) | | Created at | 2022-09-13T15:04:04Z | | Updated at | 2023-01-11T19:02:58Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2022-09-14T13:07:59.187-0500', 'How would you like the feature to work?': 'Used to get or set multiple specific links with a single PrimParameters call. Because we cannot have lists within lists, I propose this constant takes an additional string parameter which itself is a comma separated list of link numbers.\r\n\r\n{noformat}[PIRM_LINK_SUBSET, string comma_separated_string_of_link_targets ]{noformat}\r\n\r\nExample:\r\nThe following code would change the prim size of links 1, 5, and 8 within the linkset. \r\n{code}\r\nllSetPrimitiveParams( [ PRIM_LINK_SUBSET, "1,5,8", PRIM_SIZE, <1,1,1> ] );\r\n{code}\r\n\r\nAlternatively, I had considered this parameter instead taking a variable number of integer parameters, with the first one specifying how many link_targets would be specified in sequence. Though I think that may be too unwieldy.\r\n\r\nIf a nonexistant link target is specified, it is silently ignored (similar to how PRIM_LINK_TARGET ignores numbers outside the current linkset). If an invalid character (anything other than a number or comma) is used in the string, a runtime error is thrown.', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'Target Viewer Version': 'viewer-development', 'Why is this feature important to you? How would it benefit the community?': 'I feel this is important because it enhances how creators can apply the same set of parameters to a subset of links without having to duplicate the parameters for each link target. This would result in much more efficient lists for this use case.\r\n\r\nCurrently, we only have access to the handful of special LINK parameters: LINK_ROOT, LINK_SET, LINK_ALL OTHERS, LINK_CHILDREN, LINK_THIS. While useful, they are limited. Suppose you want to apply a long list of parameters to only four links within a larger set... in that case, your options are to either chain all four of them together (one for each link target) for a massive list in a single PrimParameters call, or call PrimParameters four times with the same parameter list, targeting a new link each time. \r\n\r\nThus suggestion allows you to use a single PrimParameters call, without needing to duplicate the parameter list for each target.', } ```
sl-service-account commented 1 year ago

Maestro Linden commented at 2022-09-14T18:07:59Z

Hi [~fenix.eldritch], I'd recommend checking out https://wiki.secondlife.com/wiki/PRIM_LINK_TARGET , which lets you get or set properties on multiple prims within a single llSetPrimitiveParams() or llGetPrimitiveParams() call (and also works with all the variant functions).

For your example with resizing prims 1, 5, and 8 in a single call, you can simply do:

llSetLinkPrimitiveParamsFast(1, [ PRIM_SIZE, <1,1,1>, PRIM_LINK_TARGET, 5,  PRIM_SIZE, <1,1,1>, PRIM_LINK_TARGET, 8, PRIM_SIZE, <1,1,1>] );
sl-service-account commented 1 year ago

Fenix Eldritch commented at 2022-09-15T16:23:37Z

Hi Maestro, yes I understand that you can use PRIM_LINK_TARGET to do that... But in doing so we have to repeat the PRIM_SIZE parameters for each new target. And while that example is trivial, I was thinking about the case when you have a long list of many parameters. In that scenario, if you wanted to apply this big list to multiple link targets in a single PrimParameters call, you would be duplicating the prim parameters list for each link target - which in turn consumes more memory.

The goal of this suggestion was to allow for users to target a subset of link numbers without needing a PRIM_LINK_TARGET + attributes list for each one.

sl-service-account commented 1 year ago

Fenix Eldritch commented at 2022-09-16T12:36:26Z

I tried rewording a couple sections of the suggestion to hopefully clarify my intent.

sl-service-account commented 1 year ago

Kyle Linden commented at 2022-09-28T18:17:29Z

Thank you for the suggestion, we may implement some version of this at a future date.