[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30236] trunk/blender/release/scripts/op/ presets.py: - presets were not being written with 'import bpy' at the start .
Campbell Barton
ideasman42 at gmail.com
Mon Jul 12 20:15:48 CEST 2010
Revision: 30236
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30236
Author: campbellbarton
Date: 2010-07-12 20:15:48 +0200 (Mon, 12 Jul 2010)
Log Message:
-----------
- presets were not being written with 'import bpy' at the start.
- attribute save_keyconfig defaulted to True when unset, not sure why, but .
- use repr() rather then str() so strings are quoted without manually checking. also converts less common chars properly \m \" etc.
Modified Paths:
--------------
trunk/blender/release/scripts/op/presets.py
Modified: trunk/blender/release/scripts/op/presets.py
===================================================================
--- trunk/blender/release/scripts/op/presets.py 2010-07-12 17:56:26 UTC (rev 30235)
+++ trunk/blender/release/scripts/op/presets.py 2010-07-12 18:15:48 UTC (rev 30236)
@@ -47,20 +47,18 @@
target_path = bpy.utils.preset_paths(self.preset_subdir)[0] # we need some way to tell the user and system preset path
filepath = os.path.join(target_path, filename)
- if getattr(self, "save_keyconfig", True):
+ if getattr(self, "save_keyconfig", False):
bpy.ops.wm.keyconfig_export(filepath=filepath, kc_name=self.properties.name)
file_preset = open(filepath, 'a')
file_preset.write("wm.active_keyconfig = kc\n\n")
else:
file_preset = open(filepath, 'w')
+ file_preset.write("import bpy\n")
for rna_path in self.preset_values:
value = eval(rna_path)
- if type(value) == str:
- value = "'%s'" % value
+ file_preset.write("%s = %s\n" % (rna_path, repr(value)))
- file_preset.write("%s = %s\n" % (rna_path, value))
-
file_preset.close()
return {'FINISHED'}
More information about the Bf-blender-cvs
mailing list