Skip to content

Instantly share code, notes, and snippets.

@spotco
Created April 29, 2019 05:31
Show Gist options
  • Select an option

  • Save spotco/48c72662ddf89321fb6732ca8b5fa025 to your computer and use it in GitHub Desktop.

Select an option

Save spotco/48c72662ddf89321fb6732ca8b5fa025 to your computer and use it in GitHub Desktop.
texture_usage_count.lua
local textures = {}
local function r_itr(cur)
for _,child in pairs(cur:GetChildren()) do
r_itr(child)
end
if cur.ClassName == "Decal" or cur.ClassName == "Texture" then
if textures[cur.Texture] == nil then
textures[cur.Texture] = 0
end
textures[cur.Texture] = textures[cur.Texture]+1
end
end
r_itr(game.Selection:Get()[1])
for k,v in pairs(textures) do
print(k,v)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment