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._NiGeometry --+ | NifFormat.NiGeometry
>>> from pyffi.formats.nif import NifFormat >>> id44 = NifFormat.Matrix44() >>> id44.set_identity() >>> skelroot = NifFormat.NiNode() >>> skelroot.name = 'skelroot' >>> skelroot.set_transform(id44) >>> bone1 = NifFormat.NiNode() >>> bone1.name = 'bone1' >>> bone1.set_transform(id44) >>> bone2 = NifFormat.NiNode() >>> bone2.name = 'bone2' >>> bone2.set_transform(id44) >>> bone21 = NifFormat.NiNode() >>> bone21.name = 'bone21' >>> bone21.set_transform(id44) >>> bone22 = NifFormat.NiNode() >>> bone22.name = 'bone22' >>> bone22.set_transform(id44) >>> bone211 = NifFormat.NiNode() >>> bone211.name = 'bone211' >>> bone211.set_transform(id44) >>> skelroot.add_child(bone1) >>> bone1.add_child(bone2) >>> bone2.add_child(bone21) >>> bone2.add_child(bone22) >>> bone21.add_child(bone211) >>> geom = NifFormat.NiTriShape() >>> geom.name = 'geom' >>> geom.set_transform(id44) >>> geomdata = NifFormat.NiTriShapeData() >>> skininst = NifFormat.NiSkinInstance() >>> skindata = NifFormat.NiSkinData() >>> skelroot.add_child(geom) >>> geom.data = geomdata >>> geom.skin_instance = skininst >>> skininst.skeleton_root = skelroot >>> skininst.data = skindata >>> skininst.num_bones = 4 >>> skininst.bones.update_size() >>> skininst.bones[0] = bone1 >>> skininst.bones[1] = bone2 >>> skininst.bones[2] = bone22 >>> skininst.bones[3] = bone211 >>> skindata.num_bones = 4 >>> skindata.bone_list.update_size() >>> [child.name for child in skelroot.children] ['bone1', 'geom'] >>> skindata.set_transform(id44) >>> for bonedata in skindata.bone_list: ... bonedata.set_transform(id44) >>> affectedbones = geom.flatten_skin() >>> [bone.name for bone in affectedbones] ['bone1', 'bone2', 'bone22', 'bone211'] >>> [child.name for child in skelroot.children] ['geom', 'bone1', 'bone21', 'bone2', 'bone22', 'bone211']
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
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 |
|
|
|
Reposition all bone blocks and geometry block in the tree to be direct children of the skeleton root. Returns list of all used bones by the skin. |
Send all bones to their bind position.
|
Make current position of the bones the bind position for this geometry. Sets the NiSkinData overall transform to the inverse of the geometry transform relative to the skeleton root, and sets the NiSkinData of each bone to the geometry transform relative to the skeleton root times the inverse of the bone transform relative to the skeleton root. |
|
_attribute_list
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Mon Oct 10 19:03:40 2011 | http://epydoc.sourceforge.net |