Skip to content

Instantly share code, notes, and snippets.

@le717
Last active January 3, 2016 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save le717/8497795 to your computer and use it in GitHub Desktop.
Save le717/8497795 to your computer and use it in GitHub Desktop.
From my tutorial "Display Only Certain File Types - Blender 2.6 API" (http://wp.me/p1V5ge-190)
from bpy.props import StringProperty
from bpy_extras.io_utils import ImportHelper
class LDRImporterOps(bpy.types.Operator, ImportHelper):
"""LDR Importer Operator"""
bl_idname = "import_scene.ldraw"
bl_description = "Import an LDraw model (.ldr/.dat)"
bl_label = "Import LDraw Model"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_options = {'REGISTER', 'UNDO'}
### BEGIN LINES FOR YOU TO ADD ###
# File type filter in file browser
filename_ext = ".ldr"
filter_glob = StringProperty(
default="*.ldr;*.dat",
options={'HIDDEN'}
)
### END LINES FOR YOU TO ADD ###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment