Last active
March 18, 2021 12:42
-
-
Save cedricduriau/4751d9f8ab0c556e214de6db2eb3d517 to your computer and use it in GitHub Desktop.
Fusion Comp Script to dump all registry attributes into a json file.
This file contains 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 json = require("dkjson") | |
function get_registry_info() | |
local data = {} | |
for _i, registry in ipairs(fusion:GetRegList()) do | |
data[registry.ID] = {} | |
for k, v in pairs(fusion:GetRegAttrs(registry.ID)) do | |
table.insert(data[registry.ID], k) | |
end | |
end | |
return data | |
end | |
function write_json(data, path) | |
local file = io.open(path, "w") | |
local json_str = json.encode(data, {indent=true}) | |
file:write(json_str) | |
file:close() | |
end | |
local path = string.format("%s_%s", os.tmpname(), "reg_attrs.json") | |
local reg_attrs = get_registry_info() | |
write_json(reg_attrs, path) | |
print(path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment