diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-09-24 11:05:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-09-24 11:05:43 +0400 |
commit | 6a4b9298c80d0f27637f88cca0ad9f05040608d3 (patch) | |
tree | b53d155d0339d16b743ae1ed483786ab79393788 /release | |
parent | 99643037caef3539fdac807b22431bd6cc5deba7 (diff) |
patch [#23968] filter_filetypes property to allow operators to filter by file extensions in the file selector
modified the patch to store the string internally rather then an array of allocated string pointers, less hassle with memory allocation.
changed to use fnmatch, so *.foo is needed (not .foo as with the patch)
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/op/io_anim_bvh/__init__.py | 1 | ||||
-rw-r--r-- | release/scripts/op/io_scene_3ds/__init__.py | 1 | ||||
-rw-r--r-- | release/scripts/op/io_scene_obj/__init__.py | 1 | ||||
-rw-r--r-- | release/scripts/op/io_shape_mdd/__init__.py | 2 | ||||
-rw-r--r-- | release/scripts/ui/space_filebrowser.py | 22 | ||||
-rw-r--r-- | release/scripts/ui/space_userpref.py | 1 |
6 files changed, 20 insertions, 8 deletions
diff --git a/release/scripts/op/io_anim_bvh/__init__.py b/release/scripts/op/io_anim_bvh/__init__.py index b8bdec592bc..e7b922e1ceb 100644 --- a/release/scripts/op/io_anim_bvh/__init__.py +++ b/release/scripts/op/io_anim_bvh/__init__.py @@ -36,6 +36,7 @@ class BvhImporter(bpy.types.Operator, ImportHelper): bl_label = "Import BVH" filename_ext = ".bvh" + filter_glob = StringProperty(default="*.bvh", options={'HIDDEN'}) scale = FloatProperty(name="Scale", description="Scale the BVH by this value", min=0.0001, max=1000000.0, soft_min=0.001, soft_max=100.0, default=0.1) frame_start = IntProperty(name="Start Frame", description="Starting frame for the animation", default=1) diff --git a/release/scripts/op/io_scene_3ds/__init__.py b/release/scripts/op/io_scene_3ds/__init__.py index 242ed751ceb..139a88209d2 100644 --- a/release/scripts/op/io_scene_3ds/__init__.py +++ b/release/scripts/op/io_scene_3ds/__init__.py @@ -36,6 +36,7 @@ class Import3DS(bpy.types.Operator, ImportHelper): bl_label = 'Import 3DS' filename_ext = ".3ds" + filter_glob = StringProperty(default="*.3ds", options={'HIDDEN'}) constrain_size = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0) use_image_search = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True) diff --git a/release/scripts/op/io_scene_obj/__init__.py b/release/scripts/op/io_scene_obj/__init__.py index d689d849725..4d7da65a7b0 100644 --- a/release/scripts/op/io_scene_obj/__init__.py +++ b/release/scripts/op/io_scene_obj/__init__.py @@ -37,6 +37,7 @@ class ImportOBJ(bpy.types.Operator, ImportHelper): bl_label = "Import OBJ" filename_ext = ".obj" + filter_glob = StringProperty(default="*.obj;*.mtl", options={'HIDDEN'}) CREATE_SMOOTH_GROUPS = BoolProperty(name="Smooth Groups", description="Surround smooth groups by sharp edges", default= True) CREATE_FGONS = BoolProperty(name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default= True) diff --git a/release/scripts/op/io_shape_mdd/__init__.py b/release/scripts/op/io_shape_mdd/__init__.py index 9e54477afbb..6453d70f569 100644 --- a/release/scripts/op/io_shape_mdd/__init__.py +++ b/release/scripts/op/io_shape_mdd/__init__.py @@ -37,6 +37,8 @@ class ImportMDD(bpy.types.Operator, ImportHelper): bl_label = "Import MDD" filename_ext = ".mdd" + filter_glob = StringProperty(default="*.mdd", options={'HIDDEN'}) + frame_start = IntProperty(name="Start Frame", description="Start frame for inserting animation", min=-300000, max=300000, default=0) frame_step = IntProperty(name="Step", min=1, max=1000, default=1) diff --git a/release/scripts/ui/space_filebrowser.py b/release/scripts/ui/space_filebrowser.py index 6b51ff42c10..499fd63f1e6 100644 --- a/release/scripts/ui/space_filebrowser.py +++ b/release/scripts/ui/space_filebrowser.py @@ -57,15 +57,21 @@ class FILEBROWSER_HT_header(bpy.types.Header): row = layout.row(align=True) row.active = params.use_filter - + row.prop(params, "use_filter_folder", text="") - row.prop(params, "use_filter_blender", text="") - row.prop(params, "use_filter_image", text="") - row.prop(params, "use_filter_movie", text="") - row.prop(params, "use_filter_script", text="") - row.prop(params, "use_filter_font", text="") - row.prop(params, "use_filter_sound", text="") - row.prop(params, "use_filter_text", text="") + + if params.filter_glob: + #if st.operator and hasattr(st.operator, "filter_glob"): + # row.prop(params, "filter_glob", text="") + row.label(params.filter_glob) + else: + row.prop(params, "use_filter_blender", text="") + row.prop(params, "use_filter_image", text="") + row.prop(params, "use_filter_movie", text="") + row.prop(params, "use_filter_script", text="") + row.prop(params, "use_filter_font", text="") + row.prop(params, "use_filter_sound", text="") + row.prop(params, "use_filter_text", text="") def register(): diff --git a/release/scripts/ui/space_userpref.py b/release/scripts/ui/space_userpref.py index e8f4af47d2a..a2be1b8a3b3 100644 --- a/release/scripts/ui/space_userpref.py +++ b/release/scripts/ui/space_userpref.py @@ -1085,6 +1085,7 @@ class WM_OT_addon_install(bpy.types.Operator): filepath = StringProperty(name="File Path", description="File path to write file to") filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'}) filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'}) + filter_glob = StringProperty(default="*.py;*.zip", options={'HIDDEN'}) def execute(self, context): import traceback |