forked from bartvdbraak/blender
bugfix [#24157] AddPresetBase class writes incorrect values for float_vector properties
This commit is contained in:
parent
c0b36a0be0
commit
c02526bdf9
@ -63,11 +63,16 @@ class AddPresetBase():
|
|||||||
else:
|
else:
|
||||||
file_preset = open(filepath, 'w')
|
file_preset = open(filepath, 'w')
|
||||||
file_preset.write("import bpy\n")
|
file_preset.write("import bpy\n")
|
||||||
file_preset.write("from mathutils import *\n")
|
|
||||||
|
|
||||||
for rna_path in self.preset_values:
|
for rna_path in self.preset_values:
|
||||||
value = eval(rna_path)
|
value = eval(rna_path)
|
||||||
file_preset.write("%s = %s\n" % (rna_path, repr(value)))
|
# convert thin wrapped sequences to simple lists to repr()
|
||||||
|
try:
|
||||||
|
value = value[:]
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
file_preset.write("%s = %r\n" % (rna_path, value))
|
||||||
|
|
||||||
file_preset.close()
|
file_preset.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user