Package pymeshio :: Package vmd
[hide private]
[frames] | no frames]

Source Code for Package pymeshio.vmd

 1  # coding: utf-8 
 2  """ 
 3  VMDの読み込み 
 4  http://yumin3123.at.webry.info/200810/article_4.html 
 5  http://atupdate.web.fc2.com/vmd_format.htm 
 6  """ 
 7  __author__="ousttrue" 
 8  __license__="zlib" 
 9  __versioon__="1.0.0" 
10   
11   
12  import io 
13  import os 
14  import struct 
15  from .. import common 
16   
17   
18 -class MorphFrame(object):
19 """ 20 morphing animation data. 21 """ 22 __slots__=['name', 'frame', 'ratio']
23 - def __init__(self, name):
24 self.name=name 25 self.frame=-1 26 self.ratio=0
27
28 - def __cmp__(self, other):
29 return cmp(self.frame, other.frame)
30 31
32 -class BoneFrame(object):
33 """ 34 bone animation data. 35 """ 36 __slots__=['name', 'frame', 'pos', 'q', 'complement']
37 - def __init__(self, name):
38 self.name=name 39 self.frame=-1 40 self.pos=common.Vector3() 41 self.q=common.Quaternion()
42
43 - def __cmp__(self, other):
44 return cmp(self.frame, other.frame)
45
46 - def __str__(self):
47 return '<BoneFrame "%s" %d %s%s>' % (self.name, self.frame, self.pos, self.q)
48 49
50 -class Motion(object):
51 __slots__=[ 52 'model_name', 53 'motions', 54 'shapes', 55 'cameras', 56 'lights', 57 'last_frame', 58 ]
59 - def __init__(self):
60 self.model_name='' 61 self.motions=[] 62 self.shapes=[] 63 self.cameras=[] 64 self.lights=[] 65 self.last_frame=0
66
67 - def __str__(self):
68 return '<VMDLoader model: "%s", motion: %d, shape: %d, camera: %d, light: %d>' % ( 69 self.model_name, len(self.motions), len(self.shapes), 70 len(self.cameras), len(self.lights))
71