// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Replace faces sharing one diffuse asset // Not compiled or tested in-world // Setup: Put inside a test prim with at most32 faces. Add a texture named replacement with permissions that allow reuse. Owner-touch a face; next touch restores. // Stop / restore: Owner-touch again to restore before removing, resetting, relinking or transferring. Snapshots are memory-only; deletion/reset does not undo changes. Keep an untouched backup. // Notes: Only this prim is edited. Preserves each face’s repeats, offsets and rotation. Does not touch normal, specular or PBR assets. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Test on a spare copy first. list saved; integer active; default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; integer i; if(active) { for(i=0;i32)return; if(llGetInventoryType("replacement")!=INVENTORY_TEXTURE) { llOwnerSay("Add replacement texture."); return; } string asset=llList2String(llGetLinkPrimitiveParams(LINK_THIS,[PRIM_TEXTURE,face]),0); if((key)asset==NULL_KEY) { llOwnerSay("Selected texture key is not readable."); return; } for(i=0;i