OSDN Git Service

add blender26-meshio
[meshio/pymeshio.git] / blender26-meshio / __init__.py
1 # coding: utf-8
2
3 bl_info={
4         'category': 'Import-Export',
5         'name': 'extended MikuMikuDance model format(.pmx)',
6         'author': 'ousttrue',
7         'blender': (2, 6, 0),
8         'location': 'File > Import-Export',
9         'description': 'Import from the extended MikuMikuDance Model Format(.pmx)',
10         'warning': '', # used for warning icon and text in addons panel
11         'wiki_url': 'http://sourceforge.jp/projects/meshio/wiki/FrontPage',
12         }
13
14 if "bpy" in locals():
15     import imp
16     if "import_pmx" in locals():
17         imp.reaload(import_pmx)
18
19
20 import bpy
21 import bpy_extras
22
23
24 class ImportPMX(bpy.types.Operator, bpy_extras.io_utils.ImportHelper):
25     '''Import from the extended MikuMikuDance Model Format(.pmx)'''
26     bl_idname='import_scene.mmd_pmx'
27     bl_label='Import PMX'
28     bl_options={'UNDO'}
29     filename_ext='.pmx'
30     filter_glob=bpy.props.StringProperty(
31             default="*.pmx", options={'HIDDEN'})
32
33
34     def execute(self, context):
35         from . import import_pmx
36         keywords=self.as_keywords()
37         return import_pmx.load(self, context, **keywords)
38
39
40 def menu_func_import(self, context):
41     self.layout.operator(ImportPMX.bl_idname, 
42             text="MikuMikuDance model (.pmx)",
43             icon='PLUGIN'
44             )
45
46 def register():
47     bpy.utils.register_module(__name__)
48     bpy.types.INFO_MT_file_import.append(menu_func_import)
49
50 def unregister():
51     bpy.utils.unregister_module(__name__)
52     bpy.types.INFO_MT_file_import.remove(menu_func_import)
53
54
55 if __name__=="__main__":
56     register()
57