diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-22 02:29:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-22 02:29:49 +0400 |
commit | b56d2f97662e0277076b7a7fd1f7a19380dc9f63 (patch) | |
tree | e2bb3fb3affd60a14229fd38098a3c804a8e3b03 /release/scripts/startup/bl_operators | |
parent | 95f66f162ce695310872950232b6a00633646e1e (diff) |
fix [#30623] user-defined render presets bug
this report exposed multiple bugs in blender when using a non utf8 compatible home directory.
- bpy.utils.script_paths() would crash when homedir wasn't utf8 (reported bug)
- PyC_DefaultNameSpace() - would raise an error when running when __file__ was non utf8.
- preset filepath property was not set to accept non utf8.
- bpy.paths.display_name would raise an error on non utf8 paths, (used for preset draw)
Diffstat (limited to 'release/scripts/startup/bl_operators')
-rw-r--r-- | release/scripts/startup/bl_operators/presets.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 1a17cd9f000..abd940e06f9 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -20,7 +20,7 @@ import bpy from bpy.types import Menu, Operator - +from bpy.props import StringProperty, BoolProperty class AddPresetBase(): '''Base preset class, only for subclassing @@ -31,13 +31,13 @@ class AddPresetBase(): # bl_label = "Add a Python Preset" bl_options = {'REGISTER'} # only because invoke_props_popup requires. - name = bpy.props.StringProperty( + name = StringProperty( name="Name", description="Name of the preset, used to make the path name", maxlen=64, options={'SKIP_SAVE'}, ) - remove_active = bpy.props.BoolProperty( + remove_active = BoolProperty( default=False, options={'HIDDEN', 'SKIP_SAVE'}, ) @@ -166,12 +166,10 @@ class ExecutePreset(Operator): bl_idname = "script.execute_preset" bl_label = "Execute a Python Preset" - filepath = bpy.props.StringProperty( - name="Path", - description="Path of the Python file to execute", - maxlen=512, + filepath = StringProperty( + subtype='FILE_PATH', ) - menu_idname = bpy.props.StringProperty( + menu_idname = StringProperty( name="Menu ID Name", description="ID name of the menu this was called from", ) @@ -456,7 +454,7 @@ class AddPresetOperator(AddPresetBase, Operator): bl_label = "Operator Preset" preset_menu = "WM_MT_operator_presets" - operator = bpy.props.StringProperty( + operator = StringProperty( name="Operator", maxlen=64, options={'HIDDEN'}, |