OSDN Git Service

fix blender plugin packaging
[meshio/pymeshio.git] / setup.py
1 #!/usr/bin/env python
2 # coding: utf-8
3
4 from setuptools import setup
5 import sys
6 import os
7 import shutil
8
9 name='pymeshio'
10 version='2.3.2'
11 short_description='3d model io library for mqo, pmd, pmx, vmd and vpd'
12 long_description='''\
13 `pymeshio` is a package for 3d model io.
14 create for blender import/expoert plugin backend.
15
16 Requirements
17 ------------
18 * Python 3
19 * Python 2.7
20
21 Features
22 --------
23 * read       Metasequioa mqo format
24 * read/write MikuMikuDance pmd format
25 * read/write MikuMikuDance pmx format
26 * read       MikuMikuDance vmd format
27 * read       MikuMikuDance vpd format
28 * convert    MikuMikuDance pmd format to MikuMikuDance pmx format
29 * blender-2.6 import/export plugin
30
31 Install
32 -------
33 ::
34
35    $ easy_install pymeshio
36    or
37    $ unzip pymeshio-x.x.x.zip
38    $ cd pymeshio-x.x.x
39    $ python setup.py install
40
41 Usage
42 -----
43 ::
44
45     >>> import pymeshio.pmd.reader
46     >>> m=pymeshio.pmd.reader.read_from_file('resources/初音ミクVer2.pmd')
47     >>> print(m)
48     <pmd-1, "初音ミク" vertex: 12354, face: 68883, material: 17, bone: 140 ik: 7, skin: 31>
49     >>> import pymeshio.converter
50     >>> pmx_model=pymeshio.converter.pmd_to_pmx(m)
51     >>> print(pmx_model)
52     <pmx-2.0 "Miku Hatsune" 12354vertices>
53     >>> import pymeshio.pmx.writer
54     >>> import io
55     >>> pymeshio.pmx.writer.write(io.open("out.pmx", "wb"), pmx_model)
56     True
57
58
59 ToDo
60 --------
61
62 * exporter for pmx
63
64
65 New
66 -------
67 2.3.2 (2011-11-07)
68 * fix for blender-2.6
69
70 2.3.1 (2011-10-15)
71 ~~~~~~~~~~~~~~~~~~
72 * bug fix(pmd_to_pmx RigidBody.shape_position)
73 * implement pmx_importer
74
75 2.2.4 (2011-10-13)
76 ~~~~~~~~~~~~~~~~~~
77 * bug fix(__init__ param)
78 * fix blender-2.5 plugin for blender-2.6
79
80 '''
81
82 classifiers=[
83         'Programming Language :: Python :: 3',
84         'License :: OSI Approved :: zlib/libpng License',
85         'Topic :: Multimedia :: Graphics :: 3D Modeling',
86         ]
87
88 # copy pymeshio dir for blender26 plugin
89 PYMESHIO_DIR_IN_BLENDER26='blender26-meshio/pymeshio'
90 if os.path.exists(PYMESHIO_DIR_IN_BLENDER26):
91     shutil.rmtree(PYMESHIO_DIR_IN_BLENDER26)    
92 print("copy pymeshio to %s" % PYMESHIO_DIR_IN_BLENDER26)
93 shutil.copytree('pymeshio', PYMESHIO_DIR_IN_BLENDER26)
94
95
96 setup(
97         name=name,
98         version=version,
99         description=short_description,
100         long_description=long_description,
101         classifiers=classifiers,
102         keywords=['mqo', 'pmd', 'pmx', 'vmd', 'vpd', 'mmd', 'blender'],
103         author='ousttrue',
104         author_email='ousttrue@gmail.com',
105         url='http://meshio.sourceforge.jp/',
106         license='zlib',
107         #package_dir={
108         #    'pymeshio': 'blender25-meshio/pymeshio'
109         #    },
110         packages=['pymeshio'],
111         test_suite='nose.collector',
112         tests_require=['Nose'],
113         zip_safe = (sys.version>="2.5"),   # <2.5 needs unzipped for -m to work
114         entry_points = {
115             'console_scripts': [
116                 'pmd2pmx = pymeshio.main:pmd_to_pmx',
117                 ]
118             }
119         )
120