Jump to content

Set a face's Texture Offset and Repeat in one step?


Domitan Redenblack
 Share

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

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

Recommended Posts

The 'old' way to do things is to use llSetPrimitiveParams(), which lets you set all sorts of things at the same time http://wiki.secondlife.com/wiki/LlSetPrimitiveParams

Most of the individual prim-editing functions have a built-in delay, for some unfathomable reason, which caused all sorts of awkward work-arounds.  LL - hoorah for Kelly :-) - gave us a new function in the 'efficient scripts' project:

llSetLinkPrimitiveParamsFast() will do the same things as llSetPrimitiveParams() but lets you do it to any prim in the link-set and has no built-in script delay.  This last means it's even worth using it 'just' on the current prim:

llSetLinkPrimitiveParamsFast(llGetLinkNumber(), [... rules ...]);

http://wiki.secondlife.com/wiki/LlSetLinkPrimitiveParamsFast

  • Like 1
Link to comment
Share on other sites

 


PeterCanessa Oh wrote:

Most of the individual prim-editing functions have a built-in delay, for some unfathomable reason, which caused all sorts of awkward work-arounds.  LL - hoorah for Kelly :-) - gave us a new function in the 'efficient scripts' project:

 

 

 

Ha, beat me. What was unfathomable thing about the delay? I don't think I was around for that at the time. Is the delay able to mitigate any resource effect of multiple prims changing parameters on a rapid basis (such as a loop) or did it give no real benefit?

  • Like 1
Link to comment
Share on other sites


Adromaw Lupindo wrote:

 What was unfathomable thing about the delay?

Beats me, that's why I said it was unfathomable.  See, for instance, that llSetPrimitiveParams() and llSetLinkPrimitiveParams() halt the script for 0.2s, as do most of the individual prim-editing things.  I wasn't around for the 'whys' of this either.  Maybe Kelly or one of the older residents will respond, although I suspect the decision is lost in the mists of time.

Link to comment
Share on other sites

 


PeterCanessa Oh wrote:


Adromaw Lupindo wrote:

 What was unfathomable thing about the delay?

Beats me, that's why I said it was unfathomable.  See, for instance, that llSetPrimitiveParams() and llSetLinkPrimitiveParams() halt the script for 0.2s, as do most of the individual prim-editing things.  I wasn't around for the 'whys' of this either.  Maybe Kelly or one of the older residents will respond, although I suspect the decision is lost in the mists of time.

 

Might have been due to database lag? Preventing overload of the prim's characteristics in the server database?

 

Link to comment
Share on other sites

Sorry, setting stuff, but confused on params format for setting Texture and Colour params...

 

    /* llSetLinkPrimitiveParamsFast(1,  // Root prim        [ PRIM_NAME, string name ],        [ PRIM_TEXT, string text, vector color, float alpha ], // ????        [ PRIM_COLOR, integer face, vector color, float alpha ], // ????        [ PRIM_TEXTURE, integer face, string Do_Not_Want_to_Change_texture, vector repeats, vector offsets, float rotation_in_radians ]); // ????    */

 Note: I do NOT want to change the texture OR cause it to re-rezz... ty

 

Link to comment
Share on other sites

it was due to object update status  IIRC, which forced updates not only to all viewers, but the assest server as well at one point (I think... it's been a few years since the topic came up). which doesn't quite happen the same way any more.

 

and when you get thouroghly annoyed with not being able to set JUST the offset and scale, use llLinkGetPrimitiveParams() to grab the texture and rotation, before you apply the other two parameters... and jusst insert them

llSetLinkPrimitiveParamsFast( link#, [PRIM_TEXTURE, face#] + llListReplaceList( llGetLinkPrimitiveParams( link#, [PRIM_TEXTURE, face#] ), [scale#, offset#], 1, 2 ) );

PS
if you don't want to mess with alpha, llSetLinkColor has no built in delay, so you don't have to grab it like above, nor hard code it into the script

ETA:
all list parameters go into a single list... the first parameter tells it how many folow up fields it has automatically, so after that it looks for the next parameter that tells it how many more follow it...

ex:
[PRIM_TEXTURE, integer, string, vector, vector, float, PRIM_COLOR, integer, vector, float]

  • Like 2
Link to comment
Share on other sites

 

Does not work:
key kCurTexture = llGetTexture(iInfoFace); llSay(0, "kCurTexture = " + (string)kCurTexture); llSetLinkPrimitiveParamsFast(LINK_ROOT, [ PRIM_NAME, sBoardName + sBoardVersion, PRIM_TEXT, "... in use ...\n" + sItemDialog, <1, 1, 1>, 1.0, PRIM_TEXTURE, iInfoFace, kCurTexture, <1, 1, 1>, <0,0,0>, 0.0, PRIM_COLOR, iInfoFace, <0.8, 0.8, 1.0>, 1.0 ]);

 The above code has Zero effect as far as I can see, while this code below works:

 

Works fine:
llSetText("... in use ...\n" + sItemDialog, <1,1,1>, 1.0); llScaleTexture(1.0, 1.0, iInfoFace); llOffsetTexture(0.0, 0.0, iInfoFace);

 

 

 

Link to comment
Share on other sites

LINK_ROOT does not work in single prim objects

ETA:
if you need a targeted link number for the root, but can't be sure that the item wil be single or multi prim, or which prim the script might end up in, use

!!llGetLinkNumber()

to target the root prim

Link to comment
Share on other sites

the double not version is just the replacement code for LINK_ROOT so that it works in all situations... as you said, if you only need LINK_THIS (which is also buggy for single prim objects IIRC) then the plain call to llGetLinkNumber, just the actual number (zero in this case)

ETA:
I wasn't the first to take note of that hack, Strife had documented it before I caught on to it.... **bleep** Strife, always one step ahead of me (I kid, I have nothing but admiration for scriptings numero uno cabbit)

Link to comment
Share on other sites

 


Void Singer wrote:

it was due to object update status  IIRC, which forced updates not only to all viewers, but the assest server as well at one point (I think... it's been a few years since the topic came up). which doesn't quite happen the same way any more.

Awesome, thank you for following that up Void :)

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4832 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...