OSDN Git Service
(root)
/
meshio
/
pymeshio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
implement converter
[meshio/pymeshio.git]
/
pymeshio
/
pmd
/
__init__.py
diff --git
a/pymeshio/pmd/__init__.py
b/pymeshio/pmd/__init__.py
index
61b1d01
..
839b637
100644
(file)
--- a/
pymeshio/pmd/__init__.py
+++ b/
pymeshio/pmd/__init__.py
@@
-1,7
+1,21
@@
# coding: utf-8
"""
# coding: utf-8
"""
-PMDの読み込み
-http://blog.goo.ne.jp/torisu_tetosuki/e/209ad341d3ece2b1b4df24abf619d6e4
+========================
+MikuMikuDance PMD format
+========================
+
+file format
+~~~~~~~~~~~
+* http://blog.goo.ne.jp/torisu_tetosuki/e/209ad341d3ece2b1b4df24abf619d6e4
+
+specs
+~~~~~
+* textencoding: bytes(cp932)
+* coordinate: left handed y-up(DirectX)
+* uv origin:
+* face: only triangle
+* backculling:
+
"""
import os
import sys
"""
import os
import sys
@@
-11,16
+25,31
@@
from .. import common
class Vertex(object):
class Vertex(object):
- """pmd vertex struct.
-
- Attributes:
- pos: Vector3
- normal: Vector3
- uv: Vector2
- bone0: bone index
- bone1: bone index
- weight0: bone0 influence
- edge_flag: int flag
+ """
+ ==========
+ pmd vertex
+ ==========
+ two bone weighted vertex with normal and uv.
+
+ format
+ ~~~~~~
+ * http://blog.goo.ne.jp/torisu_tetosuki/e/5a1b16e2f61067838dfc66d010389707
+
+ :IVariables:
+ pos
+ Vector3
+ normal
+ Vector3
+ uv
+ Vector2
+ bone0
+ bone index
+ bone1
+ bone index
+ weight0
+ bone0 influence. min: 0, max: 100
+ edge_flag
+ int flag. 0: edge on, 1: edge off
"""
__slots__=['pos', 'normal', 'uv', 'bone0', 'bone1', 'weight0', 'edge_flag']
def __init__(self, pos, normal, uv,
"""
__slots__=['pos', 'normal', 'uv', 'bone0', 'bone1', 'weight0', 'edge_flag']
def __init__(self, pos, normal, uv,
@@
-63,18
+92,34
@@
class Vertex(object):
class Material(object):
class Material(object):
- """pmd material struct.
-
- Attributes:
- diffuse_color: RGB
- alpha: float
- specular_factor: float
- specular_color: RGB
- ambient_color: RGB
- toon_index: int
- edge_flag: int
- vertex_count: indices length
- texture_file: texture file path
+ """
+ ============
+ pmd material
+ ============
+
+ format
+ ~~~~~~
+ * http://blog.goo.ne.jp/torisu_tetosuki/e/ea0bb1b1d4c6ad98a93edbfe359dac32
+
+ :IVariables:
+ diffuse_color
+ RGB
+ alpha
+ float
+ specular_factor
+ float
+ specular_color
+ RGB
+ ambient_color
+ RGB
+ toon_index
+ int
+ edge_flag
+ int
+ vertex_count
+ indices length
+ texture_file
+ texture file path
"""
__slots__=[
'diffuse_color', 'alpha',
"""
__slots__=[
'diffuse_color', 'alpha',
@@
-116,22
+161,40
@@
class Material(object):
class Bone(object):
class Bone(object):
- """pmd material struct.
-
- Attributes:
- _name:
- index:
- type:
- ik:
- pos:
- _english_name:
- ik_index:
- parent_index:
- tail_index:
-
- parent:
- tail:
- children:
+ """
+ ==========
+ pmd bone
+ ==========
+
+ format
+ ~~~~~~
+ * http://blog.goo.ne.jp/torisu_tetosuki/e/638463f52d0ad6ca1c46fd315a9b17d0
+
+ :IVariables:
+ name
+ bone name
+ english_name
+ bone english_name
+ index
+ boen index(append for internal use)
+ type
+ bone type
+ ik
+ ik(append for internal use)
+ pos
+ bone head position
+ ik_index
+ ik target bone index
+ parent_index
+ parent bone index
+ tail_index
+ tail bone index
+ parent
+ parent bone(append for internal use)
+ tail
+ tail bone(append for internal use)
+ children
+ children bone(append for internal use)
"""
# kinds
ROTATE = 0
"""
# kinds
ROTATE = 0