// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Align classic material UV channels // Not compiled or tested in-world // Setup: Set FACE on a classic material with readable texture settings. Owner-touch aligns; touch again restores the original normal/specular transforms. // Stop / restore: Owner-touch again to restore the startup snapshot before removal or reset, unless setup describes a different cycle. Do not relink during a preview. // Notes: Use a spare modifiable build. Saved state lives only in script memory. Does not replace normal/specular images or change PBR transforms. Useful when maps unexpectedly drift apart. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer preview; integer FACE=0; list normal; list specular; default { state_entry() { normal=llGetLinkPrimitiveParams(LINK_THIS,[PRIM_NORMAL,FACE]); specular=llGetLinkPrimitiveParams(LINK_THIS,[PRIM_SPECULAR,FACE]); } touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; preview=!preview; if(preview) { list diffuse=llGetLinkPrimitiveParams(LINK_THIS,[PRIM_TEXTURE,FACE]); list uv=llList2List(diffuse,1,3); llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_NORMAL,FACE]+llListReplaceList(normal,uv,1,3)+[PRIM_SPECULAR,FACE]+llListReplaceList(specular,uv,1,3)); } else { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_NORMAL,FACE]+normal+[PRIM_SPECULAR,FACE]+specular); } } }