Set-N-Delete: no-prim-all

Remove all prim properties that can not be set from Edit.

no-prim-all.lua
-- no-prim-all - Reset all prim properties
-- self-deleting
 
local function main()
 
    -- Loop through all links in the object
    local num_links = ll.GetNumberOfPrims()
    for i = 0, num_links do
        -- Reset particles
        ll.LinkParticleSystem(i, {})
 
        -- Reset sit targets
        ll.LinkSitTarget(i, ZERO_VECTOR, ZERO_ROTATION)
 
        -- Reset many things
        ll.SetLinkPrimitiveParamsFast(i, {
            PRIM_TEXT, "", ZERO_VECTOR, 1.0,
            PRIM_OMEGA, ZERO_VECTOR, 0.0, 0.0,
            PRIM_CLICK_ACTION, CLICK_ACTION_NONE
        })
 
        -- Reset camera offsets
        ll.SetLinkCamera(i, ZERO_VECTOR, ZERO_VECTOR)
    end
 
    -- Reset prim media
    for i = 0, ll.GetLinkNumberOfSides(ll.GetLinkNumber())-1 do
        local clearMediaSucceeded = ll.ClearPrimMedia(i)
    end
 
    -- Reset animation properties on all faces
    ll.SetTextureAnim(0, ALL_SIDES, 1, 1, 0.0, TWO_PI, 0.0)
 
    -- Reset key frame properties
    ll.SetKeyframedMotion({}, {})
 
    -- and delete me
    ll.RemoveInventory(ll.GetScriptName())
end
 
main()

LSL