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

Class NiAVObject

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
Known Subclasses:

>>> from pyffi.formats.nif import NifFormat
>>> node = NifFormat.NiNode()
>>> prop1 = NifFormat.NiProperty()
>>> prop1.name = "hello"
>>> prop2 = NifFormat.NiProperty()
>>> prop2.name = "world"
>>> node.get_properties()
[]
>>> node.set_properties([prop1, prop2])
>>> [prop.name for prop in node.get_properties()]
['hello', 'world']
>>> [prop.name for prop in node.properties]
['hello', 'world']
>>> node.set_properties([])
>>> node.get_properties()
[]
>>> # now set them the other way around
>>> node.set_properties([prop2, prop1])
>>> [prop.name for prop in node.get_properties()]
['world', 'hello']
>>> [prop.name for prop in node.properties]
['world', 'hello']
>>> node.remove_property(prop2)
>>> [prop.name for prop in node.properties]
['hello']
>>> node.add_property(prop2)
>>> [prop.name for prop in node.properties]
['hello', 'world']
Nested Classes [hide private]

Inherited from object_models.xml.struct_.StructBase: __metaclass__

Instance Methods [hide private]
 
add_property(self, prop)
Add the given property to the property list.
source code
 
remove_property(self, prop)
Remove the given property to the property list.
source code
list of L{NifFormat.NiProperty}
get_properties(self)
Return a list of the properties of the block.
source code
 
set_properties(self, proplist)
Set the list of properties from the given list (destroys existing list).
source code
 
get_transform(self, relative_to=None)
Return scale, rotation, and translation into a single 4x4 matrix, relative to the C{relative_to} block (which should be another NiAVObject connecting to this block).
source code
 
set_transform(self, m)
Set rotation, translation, and scale, from a 4x4 matrix.
source code
 
apply_scale(self, scale)
Apply scale factor on data.
source code

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]
  _attribute_list = [<pyffi.object_models.xml.StructAttribute ob...

Inherited from _NiAVObject (private): _attrs, _games, _is_template, _names

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

Inherited from object_models.xml.struct_.StructBase: arg

Properties [hide private]

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

Inherited from object: __class__

Method Details [hide private]

add_property(self, prop)

source code 
Add the given property to the property list.
Parameters:
  • prop (L{NifFormat.NiProperty}) - The property block to add.

remove_property(self, prop)

source code 
Remove the given property to the property list.
Parameters:
  • prop (L{NifFormat.NiProperty}) - The property block to remove.

get_properties(self)

source code 
Return a list of the properties of the block.
Returns: list of L{NifFormat.NiProperty}
The list of properties.

set_properties(self, proplist)

source code 
Set the list of properties from the given list (destroys existing list).
Parameters:
  • proplist (list of L{NifFormat.NiProperty}) - The list of property blocks to set.

get_transform(self, relative_to=None)

source code 
Return scale, rotation, and translation into a single 4x4 matrix, relative to the C{relative_to} block (which should be another NiAVObject connecting to this block). If C{relative_to} is None, then returns the transform stored in C{self}, or equivalently, the target is assumed to be the parent.
Parameters:
  • relative_to - The block relative to which the transform must be calculated. If None, the local transform is returned.

set_transform(self, m)

source code 
Set rotation, translation, and scale, from a 4x4 matrix.
Parameters:
  • m - The matrix to which the transform should be set.

apply_scale(self, scale)

source code 
Apply scale factor on data.
Parameters:
  • scale - The scale factor.
Overrides: NiObject.apply_scale

Class Variable Details [hide private]

_attribute_list

Value:
[<pyffi.object_models.xml.StructAttribute object at 0x2db5cd0>,
 <pyffi.object_models.xml.StructAttribute object at 0x2db5d10>,
 <pyffi.object_models.xml.StructAttribute object at 0x2db5d90>,
 <pyffi.object_models.xml.StructAttribute object at 0x2db5e90>,
 <pyffi.object_models.xml.StructAttribute object at 0x2db5f90>,
 <pyffi.object_models.xml.StructAttribute object at 0x2dbb050>,
 <pyffi.object_models.xml.StructAttribute object at 0x2dbb090>,
 <pyffi.object_models.xml.StructAttribute object at 0x2dbb0d0>,
...