• 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-4252
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Unassigned
Reporter: Sebastean Steamweaver
Votes: 16
Watchers: 6
Operations

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

Constants for llSet(Link)Primitive Params: PRIM_RELATIVE_* Constants

Created: 13/May/09 05:05 PM   Updated: 11/Aug/09 12:24 PM
Return to search
Component/s: Performance, Scripts
Affects Version/s: None
Fix Version/s: None

Issue Links:
Relates


 Description  « Hide

The basic problem that scripters face

Is the inability to tell where or at what rotation a child prim is in a linkset, among other properties. Because of this, they cannot write their scripts to act accordingly. I would like to propose the following, which would solve many of the issues that arises from this:

PRIM_RELATIVE_POSITION
PRIM_RELATIVE_ROTATION
PRIM_RELATIVE_SIZE
PRIM_RELATIVE_GLOW
PRIM_RELATIVE_COLOR

Basic principle:
Child link's position is <2.3, 0, 1>. You want it to be <2.3, 1, 1>. So you llSetLinkPrimitiveParams ( [ PRIM_RELATIVE_POSITION, <0, 1, 0>] )
<2.3, 0, 1> + <0, 1, 0> = <2.3, 1, 1>

The benefits of this would be many

Not only could content be changed based on the current properties of the prim, changes could be excluded from being made.

Take PRIM_RELATIVE_COLOR for example:
You want to change the alpha, but not the color. In order to do this, you use ZERO_VECTOR for the color (or <0,0,0> if you prefer), and the positive or negative float you wish to use for the alpha level. The color would be added to the current vector used for the color, and would not change, but the alpha level would.

This same principle could be applied to other properties of the prim

Such as PRIM_RELATIVE_FLEXIBLE. To further extend this, boolean properties like PHANTOM and PHYSICS could be toggled by using the positive or negative numbers, and properties like MATERIAL could be adjusted the same way. For PRIM_RELATIVE_TEXTURE the same could be done, but using NULL_KEY for cases you do not wish the texture to change (or possibly a new TEXTURE_IGNORE constant).

Furthermore, if there is a specific parameter of a property you want to set to a specific amount without changing the other parameters, you can still do this! Simply set the single parameter beyond the known max or minimum, and then call that constant again with the amount subtracted or added which you need that parameter to be. Again, take PRIM_COLOR for example:

You want the color to be blue, but it's an odd shade of dark red and slighly transparent. You want to change the color to true blue, but don't want to change the transparency:

llSetLinkPrimitiveParams ( [ PRIM_RELATIVE_COLOR, ALL_SIDES, <-10,-10,-10>, 0.0, PRIM_RELATIVE_COLOR, ALL_SIDES, <0,0,1>, 0.0]);

<-10,-10,-10> will be treated as <0,0,0>, giving you a clean slate to set the color by, and you can perform it in one function call!

This does not have to apply to only child prims!

Having these constants would also allow you to save script memory and processing time by not always having to remember the current position or rotation of your entire objects, but instead, being able to use these constants to always set it based on its current property. You have an object that could be anywhere in a sim, that you want to move up 5 meters. Instead of llSetPos(llGetPos()+offset), or storing a global function with the position, you could do llSetPrimitiveParams([PRIM_RELATIVE_POSITION,<0,0,5>]) and have it be automatically set for you. I am not proposing that it would always replace such variables, but in many instances it could.

If it is not possible to make new constants

Then it might be possible to use the same constants, but creating a new function which automatically uses the regular constants and applies them as relative values:

llSetLinkRelativeParams()

And if that function was created, as I am a proponent of SVC-2105, I would recommend also the creation of llSetLinkListRelativeParams()

This is not intended to replace llGetLinkPrimitiveParams

These constants can be used to perform many functions, some of which could be achieved by llGetLinkPrimitiveParams, but they also have other uses which are unique to them! If at some point in the future we did get a llGetLinkPrimitiveParams or similar set of functions, we could actually use it in conjunction with these contants because of its other benefits, such as the ability to set only specific parameters, and being able to manipulate objects based on current properties automatically (using only one function call). Certainly, there are things these constants couldn't do that we could with llGetLinkPrimitiveParams, but there is a lot we could do, that we cannot currently, without them, including things that llGetLinkPrimitiveParams would not allow us to do. I believe this proposal stands on its own, with its own specific benefits to our scripting future.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Sebastean Steamweaver added a comment - 13/May/09 07:06 PM
Edited to resolve some ambiguity between positional and directional vectors (meant to be positional).

pavig lok added a comment - 14/May/09 12:04 AM
I think this is a great idea, the more options for dealing intelligently with linksets the better.

I do note however that llGetLinkPrimitiveParams was SVC-224 and this is SVC-4252. Does this mean that nearly 4000 issues have been logged since the debates about providing these types of functions began?

Copybotting has been around since the beginning, and the only value differentiation between a copied product and an original is in the uncopyable scripting. This is a useful function but it doesn't replace others which deal with linksets - indeed it appears to provide functionality which we would get for minimal extra effort should SVC-224 come to pass.

With a good suite of tools for dealing with linksets (which includes this, 2105 and 224 in my wildest dreams) we could make products far more elegant and interesting than simple prim ripoffs. Please give us the tools to make stuff that has more value than pirated copies.


Haravikk Mistral added a comment - 14/May/09 07:39 AM
I like the idea, as it could simplify a number of operations that would require messier solutions whenever llGetLinkPrimitiveParams() is added. However I have some issues:

Firstly, I think this issue should be distanced from llGetLinkPrimitiveParams; the idea has its own merits and is while related to that function, it isn't an integral part of this issue. I'd recommend removing that from the description/title and just propose this idea as it is. Also I think that this feature isn't really suited to the critical rating.

Secondly, and the main thing that I think may stop this is that relative operations will require each prim being adjusted to be considered by the simulator. Sure that's exactly what llGetLinkPrimitiveParams() scripts would need to do anyway, but the point is that it may break the llSetLinkPrimitiveParams() methodology which is simply to set-values on one or more prims without any regard to their existing or other values, which gives a minimum of processing overhead. In the end this would certainly simplify scripts, but may be hiding the more complex nature of the operation, as setting values is easy, and can be done in bulk quite quickly, but adjusting values requires examination of them which is slower.


Sebastean Steamweaver added a comment - 14/May/09 08:13 AM
@Haravikk

Hmm. In light of what you've said, would you be more in favor of a separate, dedicated function like the one I proposed at the end of the JIRA, llSetLinkRelativeParams? I suppose I should also add llSetRelativeParams() to that, if such were the case.

As for the critical rating, I placed it as such basically out of concern, and gauging it by the llGetLinkPrimitiveParams function JIRA. From my perspective, I see the script limits coming closer, with no (visible) effort on LL's part to bring us functions to help us reduce script load on our side. I really do believe that most of the script load we have these days is due to our own inefficient tools, and that if we were given more efficient tools to work with in scripts, the script load on servers would decrease dramatically. Trying to limit scripts before giving us ways to decrease the load ourselves by greater efficiency seems . . . like putting the cart before the horse. I'm very concerned that we are at least given ways to compensate for however the new limits effect us.

As for its relation to llGetLinkPrimitiveParams, I see your point. When I originally came up with this, it was immediately associated with that issue in my mind, since its main purpose (for me) was to solve the functionality we were missing from a lack of llGetLinkPP, and I had hoped that those in favor of llGLPP would also be in favor of this. At the same time, it does have its own distinct characteristics and benefits. I was afraid that it would be largely ignored unless people saw a plain reason to be in favor of it.


Argent Stonecutter added a comment - 15/May/09 04:44 AM
How about PRIM_REL_PATH_CUT?

This might be useful, but it;s not capable of replacing even MOST legitimate uses for llGetLinkPrimitiveParams(). And the "problem" it's supposedly avoiding is a non-issue: anyone who wants to violate copyright isn't going to have the slightest compunction over briefly adding to sim load by propagating their cloning script through a linkset.


Sebastean Steamweaver added a comment - 15/May/09 05:11 AM - edited
@Argent

PRIM_REL_PATH_CUT? I'd suggest going with current standards that address the entire property and not a single parameter you can take care of that just by using PRIM_RELATIVE_TYPE and the proceedure I described above for changing only a single parameter. Very handy, isn't it?

I'm very glad you agree that it's useful However, I'm not sure I understand your reasoning for saying it can't replace "most legitimate uses" for llGetLinkPrimtiiveParams. It's purpose was never to completely replace it, as I said myself in the proposal, but it does provide us with a large amount of functionality that we are missing by not having llGetLinkPrimitiveParams, plus other things that llGetLinkPrimitiveParams could not provide.

As for the security issue, this proposal was never meant to solve any security issue, nor have I ever once stated that llGetLinkPrimitiveParams was a security issue, but simply be pallatable to both sides.

The performance notes I made were just benefits that this proposal has in and of itself, since it would allow us to perform in one function call many operations that would otherwise require two. It's relation to llGetLinkPrimitiveParams is purely that it provides us with some of the missing functionality. It would allow us to help decrease server load. I really am not talking at all about anyone who might or might not misuse llGetLinkPrimitiveParams.

I really wonder why people keep feeling they need to defend the argument that llGetLinkPrimitieParams is not a security threat, when I've never once suggested that it was, and in fact have said I'm of the opposite opinion multiple times?


Sierra Janus added a comment - 15/May/09 05:15 AM
My comment from SVC-224:
Unfortunately there is probably more uninformed vocal content creators who will bitch to Linden Labs about the lack of meaningless and bypassable security measures than there are informed scripters and informed content creators combined, I think the security measures listed in the proposal were just there is make it palatable to those content creators so they can dwell in their false sense of security and still vote for the proposal. Their false sense of security can't be any worse than it is now.
All I can say is any function than can do what this proposal does will still be better than having no function at all.

Sebastean Steamweaver added a comment - 17/May/09 11:36 PM
Per Haravikk's suggestion, I have revised this issue to draw it away from llGetLinkPrimitiveParams to emphasize its own merits more, and the options it can provide us.

Sebastean Steamweaver added a comment - 11/Aug/09 11:59 AM
Not entirely sure how this got set to critical, but I don't think it's quite that pressing. Reducing the priority to Normal.