// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Alpha cutout preview // Not compiled or tested in-world // Setup: Use a diffuse texture with transparency. Set FACE and preview a 128 cutoff. // Stop / restore: Owner-touch again to restore the startup snapshot before removing or resetting. A reset while previewing loses the original snapshot. // Notes: Classic-material controls only; PBR materials may display differently. Use a spare prim and textures whose settings you can read and restore. Another controller must not edit the same face during the preview. Hard cutouts differ from blended transparency and can remove soft edges. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Not compiled or tested in-world. integer preview; list saved; integer FACE=0; default { state_entry() { saved = llGetLinkPrimitiveParams(LINK_THIS, [PRIM_ALPHA_MODE, FACE]); } touch_start(integer count) { if (llDetectedKey(0) != llGetOwner()) return; preview = !preview; if (preview) { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ALPHA_MODE,FACE,PRIM_ALPHA_MODE_MASK,128]); } else { llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_ALPHA_MODE,FACE]+saved); llOwnerSay("Original setting restored."); } } }