Package pyffi :: Package formats :: Package tri :: Class TriFormat :: Class MorphRecord
[hide private]
[frames] | no frames]

Class MorphRecord

source code

                  object --+                
                           |                
      utils.graph.DetailNode --+            
                               |            
          utils.graph.GlobalNode --+        
                                   |        
object_models.xml.struct_.StructBase --+    
                                       |    
                  TriFormat._MorphRecord --+
                                           |
                                          TriFormat.MorphRecord

>>> # create morph with 3 vertices.
>>> morph = TriFormat.MorphRecord(argument=3)
>>> morph.set_relative_vertices(
...     [(3, 5, 2), (1, 3, 2), (-9, 3, -1)])
>>> # scale should be 9/32768.0 = 0.0002746...
>>> morph.scale # doctest: +ELLIPSIS
0.0002746...
>>> for vert in morph.get_relative_vertices():
...     print([int(1000 * x + 0.5) for x in vert])
[3000, 5000, 2000]
[1000, 3000, 2000]
[-8999, 3000, -999]
Nested Classes [hide private]

Inherited from object_models.xml.struct_.StructBase: __metaclass__

Instance Methods [hide private]
 
get_relative_vertices(self) source code
 
set_relative_vertices(self, vertices) source code
 
apply_scale(self, scale)
Apply scale factor to data.
source code

Inherited from object_models.xml.struct_.StructBase: __init__, __str__, deepcopy, fix_links, get_attribute, get_basic_attribute, get_detail_child_names, get_detail_child_nodes, get_global_child_nodes, get_global_display, get_hash, get_links, get_refs, get_size, get_strings, get_template_attribute, read, replace_global_node, set_attribute, set_basic_attribute, set_template_attribute, tree, write

Inherited from utils.graph.GlobalNode: get_global_child_edge_types, get_global_iterator

Inherited from utils.graph.DetailNode: get_detail_child_edge_types, get_detail_display, get_detail_iterator

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from object_models.xml.struct_.StructBase: get_games, get_versions

Class Variables [hide private]
  _attribute_list = [<pyffi.object_models.xml.StructAttribute ob...

Inherited from _MorphRecord (private): _attrs, _names

Inherited from object_models.xml.struct_.StructBase: arg

Properties [hide private]

Inherited from _MorphRecord: name, scale, vertices

Inherited from object: __class__

Class Variable Details [hide private]

_attribute_list

Value:
[<pyffi.object_models.xml.StructAttribute object at 0x4ae24d0>,
 <pyffi.object_models.xml.StructAttribute object at 0x4ae2510>,
 <pyffi.object_models.xml.StructAttribute object at 0x4ae2590>,
 <pyffi.object_models.xml.StructAttribute object at 0x4ae24d0>,
 <pyffi.object_models.xml.StructAttribute object at 0x4ae2510>,
 <pyffi.object_models.xml.StructAttribute object at 0x4ae2590>]