// SPDX-License-Identifier: MIT // Copyright (c) 2026 Incoprea // Capture a child’s local animation bounds // Not compiled or tested in-world // Setup: Put in your own rezzed test object. Put in an animated child; start by touching that child. Owner-touch starts a thirty-sample session; touch again ends early. // Stop / restore: Automatically stops after thirty samples. Disable/remove to stop; no scene properties are changed. // Notes: Root movement does not affect the local envelope. Stops if the script prim ceases to be a child; no animation is changed. // License: see LICENSE in this distribution. // Original Incoprea. MIT. Test on a spare copy first. integer active; integer samples; float began; vector low; vector high; finish() { llSetTimerEvent(0.0); active=FALSE; llOwnerSay("Observed child local envelope min="+(string)low+" max="+(string)high+" span="+(string)(high-low)); } default { touch_start(integer n) { if(llDetectedKey(0)!=llGetOwner())return; if(active) { finish(); return; } samples=0; began=llGetTime(); if(llGetLinkNumber()<2) { llOwnerSay("Use a linked child."); return; } low=llGetLocalPos(); high=low; active=TRUE; llSetTimerEvent(1.0); llOwnerSay("Measurement session started."); } timer() { if(!active)return; ++samples; if(llGetLinkNumber()<2) { finish(); return; } vector p=llGetLocalPos(); if(p.xhigh.x)high.x=p.x; if(p.y>high.y)high.y=p.y; if(p.z>high.z)high.z=p.z; if(samples>=30)finish(); } changed(integer flags) { if(flags&CHANGED_OWNER)llResetScript(); } }