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

Class NiSkinData

source code

                  object --+                        
                           |                        
      utils.graph.DetailNode --+                    
                               |                    
          utils.graph.GlobalNode --+                
                                   |                
object_models.xml.struct_.StructBase --+            
                                       |            
                     NifFormat._NiObject --+        
                                           |        
                          NifFormat.NiObject --+    
                                               |    
                           NifFormat._NiSkinData --+
                                                   |
                                                  NifFormat.NiSkinData

Nested Classes [hide private]

Inherited from object_models.xml.struct_.StructBase: __metaclass__

Instance Methods [hide private]
 
get_transform(self)
Return scale, rotation, and translation into a single 4x4 matrix.
source code
 
set_transform(self, mat)
Set rotation, transform, and velocity.
source code
 
apply_scale(self, scale)
Apply scale factor on data.
source code

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 object_models.xml.struct_.StructBase: arg

Properties [hide private]

Inherited from _NiSkinData: bone_list, has_vertex_weights, num_bones, rotation, scale, skin_partition, translation

Inherited from object: __class__

Method Details [hide private]

apply_scale(self, scale)

source code 

Apply scale factor on data.

>>> from pyffi.formats.nif import NifFormat
>>> id44 = NifFormat.Matrix44()
>>> id44.set_identity()
>>> skelroot = NifFormat.NiNode()
>>> skelroot.name = 'Scene Root'
>>> skelroot.set_transform(id44)
>>> bone1 = NifFormat.NiNode()
>>> bone1.name = 'bone1'
>>> bone1.set_transform(id44)
>>> bone1.translation.x = 10
>>> skelroot.add_child(bone1)
>>> geom = NifFormat.NiTriShape()
>>> geom.set_transform(id44)
>>> skelroot.add_child(geom)
>>> skininst = NifFormat.NiSkinInstance()
>>> geom.skin_instance = skininst
>>> skininst.skeleton_root = skelroot
>>> skindata = NifFormat.NiSkinData()
>>> skininst.data = skindata
>>> skindata.set_transform(id44)
>>> geom.add_bone(bone1, {})
>>> geom.update_bind_position()
>>> bone1.translation.x
10.0
>>> skindata.bone_list[0].translation.x
-10.0
>>> import pyffi.spells.nif.fix
>>> import pyffi.spells.nif
>>> data = NifFormat.Data()
>>> data.roots = [skelroot]
>>> toaster = pyffi.spells.nif.NifToaster()
>>> toaster.scale = 0.1
>>> pyffi.spells.nif.fix.SpellScale(data=data, toaster=toaster).recurse()
pyffi.toaster:INFO:--- fix_scale ---
pyffi.toaster:INFO:  scaling by factor 0.100000
pyffi.toaster:INFO:  ~~~ NiNode [Scene Root] ~~~
pyffi.toaster:INFO:    ~~~ NiNode [bone1] ~~~
pyffi.toaster:INFO:    ~~~ NiTriShape [] ~~~
pyffi.toaster:INFO:      ~~~ NiSkinInstance [] ~~~
pyffi.toaster:INFO:        ~~~ NiSkinData [] ~~~
>>> bone1.translation.x
1.0
>>> skindata.bone_list[0].translation.x
-1.0
Overrides: NiObject.apply_scale

Class Variable Details [hide private]

_attribute_list

Value:
[<pyffi.object_models.xml.StructAttribute object at 0x2f99e50>,
 <pyffi.object_models.xml.StructAttribute object at 0x2f9fd50>,
 <pyffi.object_models.xml.StructAttribute object at 0x2f9fdd0>,
 <pyffi.object_models.xml.StructAttribute object at 0x2f9fe10>,
 <pyffi.object_models.xml.StructAttribute object at 0x2f9ff50>,
 <pyffi.object_models.xml.StructAttribute object at 0x2f9ff90>,
 <pyffi.object_models.xml.StructAttribute object at 0x2fa6050>,
 <pyffi.object_models.xml.StructAttribute object at 0x2f99e50>,
...