Package pyffi :: Package formats :: Package nif :: Class NifFormat :: Class NiTriBasedGeom
[hide private]
[frames] | no frames]

Class NiTriBasedGeom

source code

                  object --+                                                
                           |                                                
      utils.graph.DetailNode --+                                            
                               |                                            
          utils.graph.GlobalNode --+                                        
                                   |                                        
object_models.xml.struct_.StructBase --+                                    
                                       |                                    
                     NifFormat._NiObject --+                                
                                           |                                
                          NifFormat.NiObject --+                            
                                               |                            
                          NifFormat._NiObjectNET --+                        
                                                   |                        
                               NifFormat.NiObjectNET --+                    
                                                       |                    
                                   NifFormat._NiAVObject --+                
                                                           |                
                                        NifFormat.NiAVObject --+            
                                                               |            
                                           NifFormat._NiGeometry --+        
                                                                   |        
                                                NifFormat.NiGeometry --+    
                                                                       |    
                                               NifFormat._NiTriBasedGeom --+
                                                                           |
                                                                          NifFormat.NiTriBasedGeom
Known Subclasses:

Nested Classes [hide private]

Inherited from object_models.xml.struct_.StructBase: __metaclass__

Instance Methods [hide private]
 
get_tangent_space(self)
Return iterator over normal, tangent, bitangent vectors.
source code
 
update_tangent_space(self, as_extra=None, vertexprecision=3, normalprecision=3)
Recalculate tangent space data.
source code
 
update_skin_partition(self, maxbonesperpartition=4, maxbonespervertex=4, verbose=0, stripify=True, stitchstrips=False, padbones=False, triangles=None, trianglepartmap=None, maximize_bone_sharing=False)
Recalculate skin partition data.
source code
 
update_skin_center_radius(self)
Update centers and radii of all skin data fields.
source code
 
get_interchangeable_tri_shape(self, triangles=None)
Returns a NiTriShape block that is geometrically interchangeable.
source code
 
get_interchangeable_tri_strips(self, strips=None)
Returns a NiTriStrips block that is geometrically interchangeable.
source code

Inherited from NiGeometry: add_bone, flatten_skin, get_skin_deformation, get_skin_partition, get_vertex_weights, is_skin, send_bones_to_bind_position, set_skin_partition, update_bind_position

Inherited from NiGeometry (private): _validate_skin

Inherited from NiAVObject: add_property, apply_scale, get_properties, get_transform, remove_property, set_properties, set_transform

Inherited from NiObjectNET: add_controller, add_extra_data, add_integer_extra_data, get_controllers, get_extra_datas, remove_extra_data, set_extra_datas

Inherited from NiObject: find, find_chain, is_interchangeable, tree

Inherited from NiObject (private): _validateTree

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, 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]

Inherited from _NiTriBasedGeom (private): _attrs, _games, _is_template

Inherited from NiGeometry (private): _attribute_list

Inherited from _NiGeometry (private): _names

Inherited from _NiObjectNET (private): _has_links, _has_refs, _has_strings

Inherited from object_models.xml.struct_.StructBase: arg

Properties [hide private]

Inherited from _NiGeometry: active_material, data, dirty_flag, has_shader, material_extra_data, material_name, num_materials, shader_name, skin_instance, unknown_byte, unknown_integer, unknown_integer_2

Inherited from _NiAVObject: bounding_box, collision_object, flags, has_bounding_box, num_properties, properties, rotation, scale, translation, unknown_1, unknown_2, unknown_short_1, velocity

Inherited from _NiObjectNET: controller, extra_data, extra_data_list, has_old_extra_data, name, num_extra_data_list, old_extra_internal_id, old_extra_prop_name, old_extra_string

Inherited from object: __class__

Method Details [hide private]

get_tangent_space(self)

source code 
Return iterator over normal, tangent, bitangent vectors. If the block has no tangent space, then returns None.

update_tangent_space(self, as_extra=None, vertexprecision=3, normalprecision=3)

source code 
Recalculate tangent space data.
Parameters:
  • as_extra - Whether to store the tangent space data as extra data (as in Oblivion) or not (as in Fallout 3). If not set, switches to Oblivion if an extra data block is found, otherwise does default. Set it to override this detection (for example when using this function to create tangent space data) and force behaviour.

update_skin_partition(self, maxbonesperpartition=4, maxbonespervertex=4, verbose=0, stripify=True, stitchstrips=False, padbones=False, triangles=None, trianglepartmap=None, maximize_bone_sharing=False)

source code 
Recalculate skin partition data.
Parameters:
  • maxbonesperpartition - Maximum number of bones in each partition. The num_bones field will not exceed this number.
  • maxbonespervertex - Maximum number of bones per vertex. The num_weights_per_vertex field will be exactly equal to this number.
  • verbose - Ignored, and deprecated. Set pyffi's log level instead.
  • stripify - If true, stripify the partitions, otherwise use triangles.
  • stitchstrips - If stripify is true, then set this to true to stitch the strips.
  • padbones - Enforces the numbones field to be equal to maxbonesperpartition. Also ensures that the bone indices are unique and sorted, per vertex. Raises an exception if maxbonespervertex is not equal to maxbonesperpartition (in that case bone indices cannot be unique and sorted). This options is required for Freedom Force vs. the 3rd Reich skin partitions.
  • triangles - The triangles of the partition (if not specified, then this defaults to C{self.data.get_triangles()}.
  • trianglepartmap - Maps each triangle to a partition index. Faces with different indices will never appear in the same partition. If the skin instance is a BSDismemberSkinInstance, then these indices are used as body part types, and the partitions in the BSDismemberSkinInstance are updated accordingly. Note that the faces are counted relative to L{triangles}.
  • maximize_bone_sharing - Maximize bone sharing between partitions. This option is useful for Fallout 3.

Deprecated: Do not use the verbose argument.

get_interchangeable_tri_shape(self, triangles=None)

source code 
Returns a NiTriShape block that is geometrically interchangeable. If you do not want to set the triangles from the original shape, use the triangles argument.

get_interchangeable_tri_strips(self, strips=None)

source code 
Returns a NiTriStrips block that is geometrically interchangeable. If you do not want to set the strips from the original shape, use the strips argument.