Jump to content

how to move texture on a face by a script


RhaDo2496
 Share

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

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

Recommended Posts

You could use llGetLinkPrimitiveParams and llSetLinkLinkPrimitiveParams, in each case using the PRIM_TEXTURE parameter. Note, however, that NULL_KEY is returned when the owner does not have full permissions to the object and the texture is not in the prim's inventory. Since that's the case, and since you made the texture yourself, it would be much easier to simply hard code the texture's UUID into your script and apply it  directly.

  • Thanks 1
Link to comment
Share on other sites

Afraid not. It can be a trivially small script, though, just handling the link_message() event sent from a master script in root. I know it's not super efficient to do it this way, but when the "efficient script" functions were introduced, they cut some corners, including the oft-requested abiliity to specify individual parameters.

(There's a totally impractical way to leave the script out of the link most of the time, by pushing it only when needed using llRemoteLoadScriptPin(), but that's crazy slow and resource intensive, and totally not a thing to do here.)


... and ETA. I should have known better than to say something isn't possible. No sooner had I posted than I remembered a trick I used once upon a time to "fake" texture offset with texture anim (back when there were bugs in offsets to normal- and specular-maps), which could be done with llSetLinkTextureAnim() from a remote root script. In this little demo, the state_entry specifies a (Mole's) texture UUID just to set up the prim for demonstration, but the texture offset stuff happens in touch_start without referencing that UUID.

integer NUMBER_FACE = 0;integer NUMBER_LINK = LINK_THIS;string NUMBER_TEXTURE = "f16e2a6b-39b7-a4c9-0904-7b5ef84b56ad";integer COLUMNS = 4;integer ROWS = 4;integer numberShowing;default{    state_entry()    {        // Set texture section showing by default        // This first is optional to get around an old viewer bug that may be obsolete        llSetLinkPrimitiveParamsFast(NUMBER_LINK,            [ PRIM_TEXTURE, NUMBER_FACE, NUMBER_TEXTURE            , <1.0/COLUMNS, 1.0/ROWS, 0.0>    // repeats            , <(1-COLUMNS)*(0.5/COLUMNS), (ROWS-1)*(0.5/ROWS), 0.0>    // offsets            , 0.0   // rotation in radians            ]);        llSetTextureAnim(FALSE, NUMBER_FACE, COLUMNS, ROWS,            0.0, 0.0, 0.0);    }    on_rez(integer start_param)    {        llResetScript();    }    touch_start(integer total_number)    {        numberShowing = ++numberShowing % (ROWS*COLUMNS);        llSetTextureAnim(ANIM_ON, NUMBER_FACE, COLUMNS, ROWS,            (float)numberShowing, 0.0, 0.0);    }}
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

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