Noise params serialization fixup

This commit is contained in:
Gaël C 2022-02-08 19:30:49 +01:00 committed by GitHub
parent b9ee29a945
commit 0dd8e8c242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -497,22 +497,22 @@ end
local function get_current_np_group(setting) local function get_current_np_group(setting)
local value = core.settings:get_np_group(setting.name) local value = core.settings:get_np_group(setting.name)
local t = {}
if value == nil then if value == nil then
t = setting.values return setting.values
else
table.insert(t, value.offset)
table.insert(t, value.scale)
table.insert(t, value.spread.x)
table.insert(t, value.spread.y)
table.insert(t, value.spread.z)
table.insert(t, value.seed)
table.insert(t, value.octaves)
table.insert(t, value.persistence)
table.insert(t, value.lacunarity)
table.insert(t, value.flags)
end end
return t local p = "%g"
return {
p:format(value.offset),
p:format(value.scale),
p:format(value.spread.x),
p:format(value.spread.y),
p:format(value.spread.z),
p:format(value.seed),
p:format(value.octaves),
p:format(value.persistence),
p:format(value.lacunarity),
value.flags
}
end end
local function get_current_np_group_as_string(setting) local function get_current_np_group_as_string(setting)