Created
April 29, 2019 05:31
-
-
Save spotco/48c72662ddf89321fb6732ca8b5fa025 to your computer and use it in GitHub Desktop.
texture_usage_count.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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