| Home | Trees | Indices | Help | 
        
  | 
  
|---|
| 
       | 
  
A .tri file contains facial expression data, that is, morphs for dynamic expressions such as smile, frown, and so on.
>>> # check and read tri file >>> stream = open('tests/tri/mmouthxivilai.tri', 'rb') >>> data = TriFormat.Data() >>> data.inspect(stream) >>> # do some stuff with header? >>> data.num_vertices 89 >>> data.num_tri_faces 215 >>> data.num_quad_faces 0 >>> data.num_uvs 89 >>> data.num_morphs 18 >>> data.read(stream) # doctest: +ELLIPSIS >>> print([str(morph.name.decode("ascii")) for morph in data.morphs]) ['Fear', 'Surprise', 'Aah', 'BigAah', 'BMP', 'ChJSh', 'DST', 'Eee', 'Eh', 'FV', 'I', 'K', 'N', 'Oh', 'OohQ', 'R', 'Th', 'W']
>>> for stream, data in TriFormat.walkData('tests/tri'): ... print(stream.name) tests/tri/mmouthxivilai.tri
>>> data = TriFormat.Data() >>> from tempfile import TemporaryFile >>> stream = TemporaryFile() >>> data.write(stream)
    
  | 
|||
| 
        TriFormat This class implements the TRI format.  | 
  |||
    
  | 
|||
        __package__ = 
     | 
  |||
| Home | Trees | Indices | Help | 
        
  | 
  
|---|
| Generated by Epydoc 3.0.1 on Mon Oct 10 19:03:24 2011 | http://epydoc.sourceforge.net |