Home | Trees | Indices | Help |
|
---|
|
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._NiNode --+ | NifFormat.NiNode
>>> from pyffi.formats.nif import NifFormat >>> x = NifFormat.NiNode() >>> y = NifFormat.NiNode() >>> z = NifFormat.NiNode() >>> x.num_children =1 >>> x.children.update_size() >>> y in x.children False >>> x.children[0] = y >>> y in x.children True >>> x.add_child(z, front = True) >>> x.add_child(y) >>> x.num_children 2 >>> x.children[0] is z True >>> x.remove_child(y) >>> y in x.children False >>> x.num_children 1 >>> e = NifFormat.NiSpotLight() >>> x.add_effect(e) >>> x.num_effects 1 >>> e in x.effects True
>>> from pyffi.formats.nif import NifFormat >>> node = NifFormat.NiNode() >>> child1 = NifFormat.NiNode() >>> child1.name = "hello" >>> child_2 = NifFormat.NiNode() >>> child_2.name = "world" >>> node.get_children() [] >>> node.set_children([child1, child_2]) >>> [child.name for child in node.get_children()] ['hello', 'world'] >>> [child.name for child in node.children] ['hello', 'world'] >>> node.set_children([]) >>> node.get_children() [] >>> # now set them the other way around >>> node.set_children([child_2, child1]) >>> [child.name for child in node.get_children()] ['world', 'hello'] >>> [child.name for child in node.children] ['world', 'hello'] >>> node.remove_child(child_2) >>> [child.name for child in node.children] ['hello'] >>> node.add_child(child_2) >>> [child.name for child in node.children] ['hello', 'world']
>>> from pyffi.formats.nif import NifFormat >>> node = NifFormat.NiNode() >>> effect1 = NifFormat.NiSpotLight() >>> effect1.name = "hello" >>> effect2 = NifFormat.NiSpotLight() >>> effect2.name = "world" >>> node.get_effects() [] >>> node.set_effects([effect1, effect2]) >>> [effect.name for effect in node.get_effects()] ['hello', 'world'] >>> [effect.name for effect in node.effects] ['hello', 'world'] >>> node.set_effects([]) >>> node.get_effects() [] >>> # now set them the other way around >>> node.set_effects([effect2, effect1]) >>> [effect.name for effect in node.get_effects()] ['world', 'hello'] >>> [effect.name for effect in node.effects] ['world', 'hello'] >>> node.remove_effect(effect2) >>> [effect.name for effect in node.effects] ['hello'] >>> node.add_effect(effect2) >>> [effect.name for effect in node.effects] ['hello', 'world']
|
|||
Inherited from |
|
|||
|
|||
|
|||
list of L{NifFormat.NiAVObject} |
|
||
|
|||
|
|||
|
|||
list of L{NifFormat.NiDynamicEffect} |
|
||
|
|||
|
|||
|
|||
|
|||
float |
|
||
|
|||
float |
|
||
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from |
|
|||
_attribute_list =
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from Inherited from Inherited from Inherited from |
|
|
|
|
|
|
|
|
|
|
This function will look for other geometries whose skeleton root is a (possibly indirect) child of this node. It will then reparent those geometries to this node. For example, it will unify the skeleton roots in Morrowind's cliffracer.nif file, or of the (official) body skins. This makes it much easier to import skeletons in for instance Blender: there will be only one skeleton root for each bone, over all geometries. The merge fails for those geometries whose global skin data transform does not match the inverse geometry transform relative to the skeleton root (the maths does not work out in this case!) Returns list of all new blocks that have been reparented (and added to the skeleton root children list), and a list of blocks for which the merge failed. |
|
Some nifs (in particular in Morrowind) have geometries that are skinned but that do not share bones. In such cases, send_geometries_to_bind_position cannot reposition them. This function will send such geometries to the position of their root node. Examples of such nifs are the official Morrowind skins (after merging skeleton roots). Returns list of detached geometries that have been moved. |
|
|
_attribute_list
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 10 19:03:42 2011 | http://epydoc.sourceforge.net |