Exemplo n.º 1
0
def n_create_blocks(n_data):
    n_ninode_1 = NifFormat.NiNode()
    n_ninode_2 = NifFormat.NiNode()
    n_data.roots = [n_ninode_1]

    with ref(n_ninode_1) as n_ninode:
        n_ninode.name = b'Scene Root'
        n_ninode.num_children = 1
        n_ninode.children.update_size()
        n_ninode.children[0] = n_ninode_2
    with ref(n_ninode_2) as n_ninode:
        n_ninode.name = b'NifObject'
        n_ninode.flags = 14
        with ref(n_ninode.translation) as n_vector3:
            n_vector3.x = 20
            n_vector3.y = 20
            n_vector3.z = 20
        with ref(n_ninode.rotation) as n_matrix33:
            n_matrix33.m_11 = -1.43774e-14
            n_matrix33.m_21 = -0.866025
            n_matrix33.m_31 = 0.5
            n_matrix33.m_12 = 0.5
            n_matrix33.m_22 = 0.433013
            n_matrix33.m_32 = 0.75
            n_matrix33.m_13 = -0.866025
            n_matrix33.m_23 = 0.25
            n_matrix33.m_33 = 0.433013
            assert (n_matrix33.is_rotation()
                    )  # make sure in case we change values:
        n_ninode.scale = 0.75
    return n_data
Exemplo n.º 2
0
    def n_attach_material_prop(self, n_block):
        '''Attach a NiMaterialProperty to a blocks properties array at pos[0]'''

        n_nimaterialprop = NifFormat.NiMaterialProperty()

        # add property to top of list
        n_block.properties.reverse()

        n_block.num_properties += 1
        n_block.properties.update_size()
        n_block.properties[-1] = n_nimaterialprop

        n_block.properties.reverse()

        n_nimaterialprop.name = b'Material'
        with ref(n_nimaterialprop.ambient_color) as ambient_color:
            ambient_color.r = 1.0
            ambient_color.g = 1.0
            ambient_color.b = 1.0
        with ref(n_nimaterialprop.diffuse_color) as diffuse_color:
            diffuse_color.r = 1.0
            diffuse_color.g = 1.0
            diffuse_color.b = 1.0
        with ref(n_nimaterialprop.emissive_color) as emissive_color:
            emissive_color.r = 0.5
        n_nimaterialprop.glossiness = 25.0
        n_nimaterialprop.alpha = 1.0

        return n_block
Exemplo n.º 3
0
    def n_attach_material_prop(self, n_block):
        '''Attach a NiMaterialProperty to a blocks properties array at pos[0]'''

        n_nimaterialprop = NifFormat.NiMaterialProperty()

        # add property to top of list
        n_block.properties.reverse()

        n_block.num_properties += 1
        n_block.properties.update_size()
        n_block.properties[-1] = n_nimaterialprop

        n_block.properties.reverse()

        n_nimaterialprop.name = b'Material'
        with ref(n_nimaterialprop.ambient_color) as ambient_color:
            ambient_color.r = 1.0
            ambient_color.g = 1.0
            ambient_color.b = 1.0
        with ref(n_nimaterialprop.diffuse_color) as diffuse_color:
            diffuse_color.r = 1.0
            diffuse_color.g = 1.0
            diffuse_color.b = 1.0
        with ref(n_nimaterialprop.emissive_color) as emissive_color:
            emissive_color.r = 0.5
        n_nimaterialprop.glossiness = 25.0
        n_nimaterialprop.alpha = 1.0

        return n_block
def n_attach_bhkconvextransform(n_bhkshape):
    '''Attaches a bhkTransform shape to store transform information'''

    n_bhkconvextransformshape = NifFormat.bhkConvexTransformShape()
    n_bhkshape.shape = n_bhkconvextransformshape

    with ref(n_bhkconvextransformshape) as n_bhktransform:
        n_bhktransform.material = NifFormat.HavokMaterial.HAV_MAT_WOOD  # 9
        n_bhktransform.unknown_float_1 = 0.1
        n_bhktransform.unknown_8_bytes.update_size()
        n_bhktransform.unknown_8_bytes[0] = 96
        n_bhktransform.unknown_8_bytes[1] = 120
        n_bhktransform.unknown_8_bytes[2] = 53
        n_bhktransform.unknown_8_bytes[3] = 19
        n_bhktransform.unknown_8_bytes[4] = 24
        n_bhktransform.unknown_8_bytes[5] = 9
        n_bhktransform.unknown_8_bytes[6] = 253
        n_bhktransform.unknown_8_bytes[7] = 4

        with ref(n_bhktransform.transform) as n_matrix44:
            n_matrix44.m_11 = -2.23517e-08
            n_matrix44.m_21 = 0.649519
            n_matrix44.m_31 = 0.375
            n_matrix44.m_12 = -0.375
            n_matrix44.m_22 = -0.32476
            n_matrix44.m_32 = 0.5625
            n_matrix44.m_13 = 0.649519
            n_matrix44.m_23 = -0.1875
            n_matrix44.m_33 = 0.324759
            n_matrix44.m_14 = 2.85714
            n_matrix44.m_24 = 2.85714
            n_matrix44.m_34 = 2.85714

    return n_bhktransform
Exemplo n.º 5
0
def n_attach_material_prop(n_trishape):
    '''Attaches a NiMaterialProperty to a NiTrishape block property's array at pos[0]'''

    n_nimaterialprop = NifFormat.NiMaterialProperty()
    n_nimaterialprop.name = b'Material'

    with ref(n_nimaterialprop.ambient_color) as n_color3:
        n_color3.r = 1.0
        n_color3.g = 1.0
        n_color3.b = 1.0

    with ref(n_nimaterialprop.diffuse_color) as n_color3:
        n_color3.r = 1.0
        n_color3.g = 1.0
        n_color3.b = 1.0

    with ref(n_nimaterialprop.emissive_color) as n_color3:
        n_color3.r = 0.0
        n_color3.g = 0.0
        n_color3.b = 0.0

    with ref(n_nimaterialprop.specular_color) as n_color3:
        n_color3.r = 0.0
        n_color3.g = 0.0
        n_color3.b = 0.0

    n_nimaterialprop.glossiness = 12.5  # default nif.xml - 0.0, blender - 12.5
    n_nimaterialprop.alpha = 1.0  # default nif.xml - 0.0

    # add property to top of list
    n_trishape.properties.reverse()
    n_trishape.num_properties += 1
    n_trishape.properties.update_size()
    n_trishape.properties[-1] = n_nimaterialprop
    n_trishape.properties.reverse()
Exemplo n.º 6
0
def n_add_vertex_colors(n_nitrishapedata):

    n_nitrishapedata.has_vertex_colors = True
    n_nitrishapedata.vertex_colors.update_size()
    with ref(n_nitrishapedata.vertex_colors[0]) as n_color4:
        n_color4.r = 1
        n_color4.a = 1
    with ref(n_nitrishapedata.vertex_colors[1]) as n_color4:
        n_color4.b = 1
        n_color4.a = 1
    with ref(n_nitrishapedata.vertex_colors[2]) as n_color4:
        n_color4.g = 1
        n_color4.a = 1
    with ref(n_nitrishapedata.vertex_colors[3]) as n_color4:
        n_color4.a = 1
    with ref(n_nitrishapedata.vertex_colors[4]) as n_color4:
        n_color4.r = 1
        n_color4.a = 1
    with ref(n_nitrishapedata.vertex_colors[5]) as n_color4:
        n_color4.a = 1
    with ref(n_nitrishapedata.vertex_colors[6]) as n_color4:
        n_color4.g = 1
        n_color4.a = 1
    with ref(n_nitrishapedata.vertex_colors[7]) as n_color4:
        n_color4.b = 1
        n_color4.a = 1
    return n_nitrishapedata
Exemplo n.º 7
0
def n_create_normal_map(n_nitexturingproperty, file_path):
    """Adds a diffuse texture to a NiTexturingProperty"""

    n_nitexturingproperty.has_normal_texture = True
    n_nisourcetexture = n_gen_texture.n_create_base_nisourcetexture(file_path)
    with ref(n_nitexturingproperty.normal_texture) as n_texdesc:
        n_texdesc.source = n_nisourcetexture
Exemplo n.º 8
0
def n_create_gloss_map(n_nitexturingproperty, file_path):
    """Adds a gloss texture to a NiTexturingProperty"""
    
    n_nitexturingproperty.has_gloss_texture = True
    n_nisourcetexture = n_gen_texture.n_create_base_nisourcetexture(file_path)
    
    with ref(n_nitexturingproperty.gloss_texture) as n_texdesc:
        n_texdesc.source = n_nisourcetexture
Exemplo n.º 9
0
def n_update_bhkrigidbody(n_bhkrigidbody):

    n_bhkrigidbody.layer = NifFormat.OblivionLayer.OL_CLUTTER  # 4
    n_bhkrigidbody.layer_copy = n_bhkrigidbody.layer
    n_bhkrigidbody.col_filter = 1
    n_bhkrigidbody.col_filter_copy = n_bhkrigidbody.col_filter
    n_bhkrigidbody.unknown_int_2 = 2084020722
    n_bhkrigidbody.unknown_3_ints.update_size()
    n_bhkrigidbody.unknown_byte = 0
    n_bhkrigidbody.unknown_2_shorts.update_size()
    n_bhkrigidbody.unknown_2_shorts[0] = 35899
    n_bhkrigidbody.unknown_2_shorts[1] = 16336
    n_bhkrigidbody.unknown_7_shorts.update_size()
    n_bhkrigidbody.unknown_7_shorts[1] = 21280
    n_bhkrigidbody.unknown_7_shorts[2] = 4581
    n_bhkrigidbody.unknown_7_shorts[3] = 62977
    n_bhkrigidbody.unknown_7_shorts[4] = 65535
    n_bhkrigidbody.unknown_7_shorts[5] = 44

    with ref(n_bhkrigidbody.inertia) as n_inertiamatrix:
        n_inertiamatrix.m_11 = 0.304209
        n_inertiamatrix.m_12 = 0.0631379
        n_inertiamatrix.m_13 = 0.0364526
        n_inertiamatrix.m_21 = 0.0631379
        n_inertiamatrix.m_22 = 0.356824
        n_inertiamatrix.m_23 = 0.0546789
        n_inertiamatrix.m_31 = 0.0364526
        n_inertiamatrix.m_32 = 0.0546789
        n_inertiamatrix.m_33 = 0.293686

    with ref(n_bhkrigidbody.center) as n_vector4:
        n_vector4.x = 2.85714
        n_vector4.y = 2.85714
        n_vector4.z = 2.85714

    n_bhkrigidbody.linear_damping = 0.1
    n_bhkrigidbody.angular_damping = 0.05
    n_bhkrigidbody.friction = 0.3
    n_bhkrigidbody.restitution = 0.3
    n_bhkrigidbody.max_angular_velocity = 31.4159
    n_bhkrigidbody.penetration_depth = 0.15
    n_bhkrigidbody.motion_system = NifFormat.MotionSystem.MO_SYS_BOX  # 4
    n_bhkrigidbody.quality_type = NifFormat.MotionQuality.MO_QUAL_MOVING  # 4
Exemplo n.º 10
0
def n_create_store_normal_data(n_nitrishape):
    """Store normal data as BinaryExtraData"""
    n_nibinaryextradata_1 = NifFormat.NiBinaryExtraData()
    
    n_nitrishape.num_extra_data_list = 1
    n_nitrishape.extra_data_list.update_size()
    n_nitrishape.extra_data_list[0] = n_nibinaryextradata_1
    
    with ref(n_nibinaryextradata_1) as n_nibinaryextradata:
        n_nibinaryextradata.name = b'Tangent space (binormal & tangent vectors)'
        n_nibinaryextradata.binary_data = b'\xfb\x05\xd1>\xdc\x05\xd1>\xec\x05Q?\xaf\xd2H?\xf6\x9d\x16?\xe2\xd2H>\xb7\xa4O?\x15,\xf9\xbeY\x1d\xa6\xbe\xec\x05Q?\xda\x05\xd1>\xfd\x05\xd1\xbe\x89\xfe\xa6>\xc6f\xf8>\xa8\xb2O\xbf\xf2YC?\x00"\x05>q\x11"?\xb3\xb3O?\x90\x0f\xa7\xbe\xd5W\xf8>\x98L\x0f?\xfcnK?\x90\x89p>\x89\xfe\xa6>\xc6f\xf8>\xa8\xb2O\xbf\x98L\x0f?\xfcnK?\x90\x89p>\xaf\xd2H?\xf6\x9d\x16?\xe2\xd2H>\xaf\xd2H?\xf6\x9d\x16?\xe2\xd2H>\x98L\x0f?\xfcnK?\x90\x89p>\xb7\xa4O?\x15,\xf9\xbeY\x1d\xa6\xbe\xb7\xa4O?\x15,\xf9\xbeY\x1d\xa6\xbe\xb3\xb3O?\x90\x0f\xa7\xbe\xd5W\xf8>\xf2YC?\x00"\x05>q\x11"?\xfb\x05\xd1>\xdc\x05\xd1>\xec\x05Q?\xec\x05Q?\xda\x05\xd1>\xfd\x05\xd1\xbe\xf2YC?\x00"\x05>q\x11"?\xef\x045?\xf8\x045\xbf\xeec\x11\xb5\xb7\xe3g>~\xee\x10\xbfl\xe7J?.\xd0\xbf\xbd\x0e\xd6\'\xbf\x13\xd0??\xbc+\x1d\xb5\xf8\x045\xbf\xee\x045\xbf+\x9f?\xbf\x1c\x1f(?x\x00\xbc=B\xb5\x94\xbe2[N\xbf\x91\x00\x04?\xa4\xb6\xbb\xbdu\x9b??\xa0$(?\xc5+\x18\xbf\x9e\x0f@>\xad/H?+\x9f?\xbf\x1c\x1f(?x\x00\xbc=\xc5+\x18\xbf\x9e\x0f@>\xad/H?\xb7\xe3g>~\xee\x10\xbfl\xe7J?\xb7\xe3g>~\xee\x10\xbfl\xe7J?\xc5+\x18\xbf\x9e\x0f@>\xad/H?.\xd0\xbf\xbd\x0e\xd6\'\xbf\x13\xd0??.\xd0\xbf\xbd\x0e\xd6\'\xbf\x13\xd0??\xa4\xb6\xbb\xbdu\x9b??\xa0$(?B\xb5\x94\xbe2[N\xbf\x91\x00\x04?\xef\x045?\xf8\x045\xbf\xeec\x11\xb5\xbc+\x1d\xb5\xf8\x045\xbf\xee\x045\xbfB\xb5\x94\xbe2[N\xbf\x91\x00\x04?'
Exemplo n.º 11
0
def n_create_blocks(n_data):
    n_ninode_1 = NifFormat.NiNode()
    n_ninode_2 = NifFormat.NiNode()
    n_data.roots = [n_ninode_1]

    with ref(n_ninode_1) as n_ninode:
        n_ninode.name = b'BBoxTest'
        n_ninode.flags = 12
        n_ninode.num_children = 1
        n_ninode.children.update_size()
        n_ninode.children[0] = n_ninode_2
    with ref(n_ninode_2) as n_ninode:
        n_ninode.name = b'Bounding Box'
        n_ninode.flags = 4
        n_ninode.has_bounding_box = True
        with ref(n_ninode.bounding_box) as n_boundingbox:
            with ref(n_boundingbox.radius) as n_vector3:
                n_vector3.x = 10
                n_vector3.y = 10
                n_vector3.z = 10
    return n_data
Exemplo n.º 12
0
def n_create_blocks(n_data):
    n_ninode_1 = NifFormat.NiNode()
    n_ninode_2 = NifFormat.NiNode()
    n_data.roots = [n_ninode_1]

    with ref(n_ninode_1) as n_ninode:
        n_ninode.name = b'BBoxTest'
        n_ninode.flags = 12
        n_ninode.num_children = 1
        n_ninode.children.update_size()
        n_ninode.children[0] = n_ninode_2
    with ref(n_ninode_2) as n_ninode:
        n_ninode.name = b'Bounding Box'
        n_ninode.flags = 4
        n_ninode.has_bounding_box = True
        with ref(n_ninode.bounding_box) as n_boundingbox:
            with ref(n_boundingbox.radius) as n_vector3:
                n_vector3.x = 10
                n_vector3.y = 10
                n_vector3.z = 10
    return n_data
Exemplo n.º 13
0
def n_create_normal_map(n_nitexturingproperty):
    """Adds a diffuse texture to a NiTexturingProperty"""
    
    n_nitexturingproperty.has_normal_texture = True
    
    n_nisourcetexture = NifFormat.NiSourceTexture()  
    
    file_path = 'textures' + path.sep + 'normal' + path.sep + 'normal.dds'
    n_nisourcetexture.file_name = file_path.encode()
    n_nisourcetexture.pixel_layout = NifFormat.PixelLayout.PIX_LAY_DEFAULT # 6
    n_nisourcetexture.use_mipmaps = 1
    
    with ref(n_nitexturingproperty.normal_texture) as n_texdesc:
        n_texdesc.source = n_nisourcetexture
Exemplo n.º 14
0
def n_create_bump_map_property(n_nitexturingproperty, file_path):
    """Adds a bumpmap texture to a NiTexturingProperty"""

    n_nitexturingproperty.has_bump_map_texture = True
    n_nisourcetexture = n_gen_texture.n_create_base_nisourcetexture(file_path)

    n_nitexturingproperty.bump_map_luma_scale = 1.0
    n_nitexturingproperty.bump_map_luma_offset = 0.0
    n_nitexturingproperty.bump_map_matrix.m_11 = 1.0
    n_nitexturingproperty.bump_map_matrix.m_12 = 0.0
    n_nitexturingproperty.bump_map_matrix.m_21 = 0.0
    n_nitexturingproperty.bump_map_matrix.m_22 = 1.0

    with ref(n_nitexturingproperty.bump_map_texture) as n_texdesc:
        n_texdesc.source = n_nisourcetexture
Exemplo n.º 15
0
def n_create_bump_map_property(n_nitexturingproperty):
    """Adds a bumpmap texture to a NiTexturingProperty"""

    n_nitexturingproperty.has_bump_map_texture = True
    n_nitexturingproperty.bump_map_luma_scale = 1.0
    n_nitexturingproperty.bump_map_luma_offset = 0.0
    n_nitexturingproperty.bump_map_matrix.m_11 = 1.0
    n_nitexturingproperty.bump_map_matrix.m_12 = 0.0
    n_nitexturingproperty.bump_map_matrix.m_21 = 0.0
    n_nitexturingproperty.bump_map_matrix.m_22 = 1.0

    n_nisourcetexture = NifFormat.NiSourceTexture()

    file_path = 'textures' + path.sep + 'bump' + path.sep + 'bump.dds'
    n_nisourcetexture.file_name = file_path.encode()
    n_nisourcetexture.pixel_layout = NifFormat.PixelLayout.PIX_LAY_DEFAULT  # 6
    n_nisourcetexture.use_mipmaps = 1

    with ref(n_nitexturingproperty.bump_map_texture) as n_texdesc:
        n_texdesc.source = n_nisourcetexture
def n_attach_bhkboxshape(n_bhkshape):
    n_bhkboxshape = NifFormat.bhkBoxShape()
    n_bhkshape.shape = n_bhkboxshape

    n_bhkboxshape.material = NifFormat.HavokMaterial.HAV_MAT_WOOD  # 9
    n_bhkboxshape.radius = 0.1
    n_bhkboxshape.unknown_8_bytes.update_size()
    n_bhkboxshape.unknown_8_bytes[0] = 107
    n_bhkboxshape.unknown_8_bytes[1] = 238
    n_bhkboxshape.unknown_8_bytes[2] = 67
    n_bhkboxshape.unknown_8_bytes[3] = 64
    n_bhkboxshape.unknown_8_bytes[4] = 58
    n_bhkboxshape.unknown_8_bytes[5] = 239
    n_bhkboxshape.unknown_8_bytes[6] = 142
    n_bhkboxshape.unknown_8_bytes[7] = 62
    with ref(n_bhkboxshape.dimensions) as n_vector3:
        n_vector3.x = 1.07143
        n_vector3.y = 1.07143
        n_vector3.z = 0.5
    n_bhkboxshape.minimum_size = 0.5
Exemplo n.º 17
0
def test_withref_3():
    b = B()
    with ref(b.a) as z:
        nose.tools.assert_equal(z.x, 1)
        nose.tools.assert_is(b.a, z)
Exemplo n.º 18
0
def test_withref_2():
    b = B()
    with ref(b) as z:
        nose.tools.assert_equal(z.a.x, 1)
        nose.tools.assert_equal(z.a.y, 2)
        nose.tools.assert_is(b, z)
Exemplo n.º 19
0
def test_withref_1():
    a = A()
    with ref(a) as z:
        nose.tools.assert_equal(z.x, 1)
        nose.tools.assert_equal(z.y, 2)
        nose.tools.assert_is(a, z)
Exemplo n.º 20
0
def n_create_blocks(n_data):
    n_ninode_1 = NifFormat.NiNode()
    n_nitrishape_1 = NifFormat.NiTriShape()
    n_nitrishapedata_1 = NifFormat.NiTriShapeData()
    n_data.roots = [n_ninode_1]

    with ref(n_ninode_1) as n_ninode:
        n_ninode.name = b'Scene Root'
        n_ninode.flags = 14
        n_ninode.num_children = 1
        n_ninode.children.update_size()
        n_ninode.children[0] = n_nitrishape_1
        
    with ref(n_nitrishape_1) as n_nitrishape:
        n_nitrishape.name = b'Cube'
        n_nitrishape.flags = 14
        
        with ref(n_nitrishape.translation) as n_vector3:
            n_vector3.x = 20
            n_vector3.y = 20
            n_vector3.z = 20
            
        with ref(n_nitrishape.rotation) as n_matrix33:
            n_matrix33.m_11 = -2.98023e-08
            n_matrix33.m_21 = -0.5
            n_matrix33.m_31 = 0.866025
            n_matrix33.m_12 = 0.866025
            n_matrix33.m_22 = -0.433013
            n_matrix33.m_32 = -0.25
            n_matrix33.m_13 = 0.5
            n_matrix33.m_23 = 0.75
            n_matrix33.m_33 = 0.433012
            
        n_nitrishape.scale = 0.75
        n_nitrishape.data = n_nitrishapedata_1 
    
    with ref(n_nitrishapedata_1) as n_nitrishapedata:
        n_nitrishapedata.num_vertices = 20
        n_nitrishapedata.vertices.update_size()
        with ref(n_nitrishapedata.vertices[0]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[1]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[2]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[3]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[4]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = 1.75
        with ref(n_nitrishapedata.vertices[5]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[6]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[7]) as n_vector3:
            n_vector3.x = 7.49999
            n_vector3.y = -3.75
            n_vector3.z = 1.75
        with ref(n_nitrishapedata.vertices[8]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = 1.75
        with ref(n_nitrishapedata.vertices[9]) as n_vector3:
            n_vector3.x = 7.49999
            n_vector3.y = -3.75
            n_vector3.z = 1.75
        with ref(n_nitrishapedata.vertices[10]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[11]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[12]) as n_vector3:
            n_vector3.x = 7.49999
            n_vector3.y = -3.75
            n_vector3.z = 1.75
        with ref(n_nitrishapedata.vertices[13]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[14]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[15]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[16]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[17]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[18]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[19]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = 3.5
            
        n_nitrishapedata.num_uv_sets = 1
        n_nitrishapedata.has_normals = True
        n_nitrishapedata.normals.update_size()
        with ref(n_nitrishapedata.normals[0]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = 0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[1]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = -0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[2]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = -0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[3]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = 0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[4]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = 0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[5]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = 0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[6]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = -0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[7]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = -0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[8]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = 0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[9]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = -0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[10]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = -0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[11]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = -0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[12]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = -0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[13]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = -0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[14]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = -0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[15]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = -0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[16]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = 0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.normals[17]) as n_vector3:
            n_vector3.x = 0.57735
            n_vector3.y = 0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[18]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = 0.57735
            n_vector3.z = -0.57735
        with ref(n_nitrishapedata.normals[19]) as n_vector3:
            n_vector3.x = -0.57735
            n_vector3.y = 0.57735
            n_vector3.z = 0.57735
        with ref(n_nitrishapedata.center) as n_vector3:
            n_vector3.x = 4.76837e-07
            n_vector3.y = 2.14577e-06
        
        n_nitrishapedata.radius = 11.1692
        
        n_nitrishapedata.uv_sets.update_size()
        with ref(n_nitrishapedata.uv_sets[0][0]) as n_texcoord:
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][1]) as n_texcoord:
            n_texcoord.u = 1
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][2]) as n_texcoord:
            n_texcoord.u = 1
        with ref(n_nitrishapedata.uv_sets[0][4]) as n_texcoord:
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][5]) as n_texcoord:
            n_texcoord.u = 1
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][6]) as n_texcoord:
            n_texcoord.u = 1
        with ref(n_nitrishapedata.uv_sets[0][8]) as n_texcoord:
            n_texcoord.u = 1
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][9]) as n_texcoord:
            n_texcoord.u = 1
        with ref(n_nitrishapedata.uv_sets[0][11]) as n_texcoord:
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][12]) as n_texcoord:
            n_texcoord.u = 1
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][14]) as n_texcoord:
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][15]) as n_texcoord:
            n_texcoord.u = 1
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][16]) as n_texcoord:
            n_texcoord.u = 1
        with ref(n_nitrishapedata.uv_sets[0][17]) as n_texcoord:
            n_texcoord.u = 1
            n_texcoord.v = 1
        with ref(n_nitrishapedata.uv_sets[0][18]) as n_texcoord:
            n_texcoord.u = 1
            
        n_nitrishapedata.consistency_flags = NifFormat.ConsistencyType.CT_STATIC
        
        n_nitrishapedata.num_triangles = 12
        n_nitrishapedata.num_triangle_points = 36
        n_nitrishapedata.has_triangles = True
        n_nitrishapedata.triangles.update_size()
        with ref(n_nitrishapedata.triangles[0]) as n_triangle:
            n_triangle.v_2 = 1
            n_triangle.v_3 = 2
        with ref(n_nitrishapedata.triangles[1]) as n_triangle:
            n_triangle.v_2 = 2
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[2]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 5
            n_triangle.v_3 = 6
        with ref(n_nitrishapedata.triangles[3]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 6
            n_triangle.v_3 = 7
        with ref(n_nitrishapedata.triangles[4]) as n_triangle:
            n_triangle.v_2 = 8
            n_triangle.v_3 = 9
        with ref(n_nitrishapedata.triangles[5]) as n_triangle:
            n_triangle.v_2 = 9
            n_triangle.v_3 = 10
        with ref(n_nitrishapedata.triangles[6]) as n_triangle:
            n_triangle.v_1 = 11
            n_triangle.v_2 = 12
            n_triangle.v_3 = 6
        with ref(n_nitrishapedata.triangles[7]) as n_triangle:
            n_triangle.v_1 = 11
            n_triangle.v_2 = 6
            n_triangle.v_3 = 13
        with ref(n_nitrishapedata.triangles[8]) as n_triangle:
            n_triangle.v_1 = 14
            n_triangle.v_2 = 15
            n_triangle.v_3 = 16
        with ref(n_nitrishapedata.triangles[9]) as n_triangle:
            n_triangle.v_1 = 14
            n_triangle.v_2 = 16
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[10]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 17
            n_triangle.v_3 = 18
        with ref(n_nitrishapedata.triangles[11]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 18
            n_triangle.v_3 = 19
    return n_data
Exemplo n.º 21
0
def n_alter_material_specular(n_nimaterialprop):
    with ref(n_nimaterialprop.specular_color) as n_color3:
        n_color3.r = 0.5
        n_color3.g = 0.0
        n_color3.b = 0.0
Exemplo n.º 22
0
def n_create_blocks(n_data):
    n_ninode_1 = NifFormat.NiNode()
    n_nitrishape_1 = NifFormat.NiTriShape()
    n_nitrishapedata_1 = NifFormat.NiTriShapeData()
    n_data.roots = [n_ninode_1]

    with ref(n_ninode_1) as n_ninode:
        n_ninode.name = b'Scene Root'
        n_ninode.flags = 14
        with ref(n_ninode.rotation) as n_matrix33:
            n_matrix33.m_11 = 1
            n_matrix33.m_22 = 1
            n_matrix33.m_33 = 1
        n_ninode.scale = 1
        n_ninode.num_children = 1
        n_ninode.children.update_size()
        n_ninode.children[0] = n_nitrishape_1
    with ref(n_nitrishape_1) as n_nitrishape:
        n_nitrishape.name = b'Cube'
        n_nitrishape.flags = 14
        with ref(n_nitrishape.translation) as n_vector3:
            n_vector3.x = 20
            n_vector3.y = 20
            n_vector3.z = 20
        with ref(n_nitrishape.rotation) as n_matrix33:
            n_matrix33.m_11 = 0
            n_matrix33.m_21 = -0.5
            n_matrix33.m_31 = 0.866025
            n_matrix33.m_12 = 0.866025
            n_matrix33.m_22 = -0.433013
            n_matrix33.m_32 = -0.25
            n_matrix33.m_13 = 0.5
            n_matrix33.m_23 = 0.75
            n_matrix33.m_33 = 0.433012
            # just to make sure in case we change values:
            assert (n_matrix33.is_rotation())
        n_nitrishape.scale = 0.75
        n_nitrishape.data = n_nitrishapedata_1
    with ref(n_nitrishapedata_1) as n_nitrishapedata:
        n_nitrishapedata.num_vertices = 8
        n_nitrishapedata.has_vertices = True
        n_nitrishapedata.vertices.update_size()
        with ref(n_nitrishapedata.vertices[0]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[1]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[2]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[3]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[4]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = 1.75
        with ref(n_nitrishapedata.vertices[5]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[6]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[7]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = 1.75
        n_nitrishapedata.radius = 11.1692
        n_nitrishapedata.consistency_flags = 16384
        n_nitrishapedata.num_triangles = 12
        n_nitrishapedata.num_triangle_points = 36
        n_nitrishapedata.has_triangles = True
        n_nitrishapedata.triangles.update_size()
        with ref(n_nitrishapedata.triangles[0]) as n_triangle:
            n_triangle.v_2 = 1
            n_triangle.v_3 = 2
        with ref(n_nitrishapedata.triangles[1]) as n_triangle:
            n_triangle.v_2 = 2
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[2]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 5
            n_triangle.v_3 = 6
        with ref(n_nitrishapedata.triangles[3]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 6
            n_triangle.v_3 = 7
        with ref(n_nitrishapedata.triangles[4]) as n_triangle:
            n_triangle.v_2 = 4
            n_triangle.v_3 = 7
        with ref(n_nitrishapedata.triangles[5]) as n_triangle:
            n_triangle.v_2 = 7
            n_triangle.v_3 = 1
        with ref(n_nitrishapedata.triangles[6]) as n_triangle:
            n_triangle.v_1 = 1
            n_triangle.v_2 = 7
            n_triangle.v_3 = 6
        with ref(n_nitrishapedata.triangles[7]) as n_triangle:
            n_triangle.v_1 = 1
            n_triangle.v_2 = 6
            n_triangle.v_3 = 2
        with ref(n_nitrishapedata.triangles[8]) as n_triangle:
            n_triangle.v_1 = 2
            n_triangle.v_2 = 6
            n_triangle.v_3 = 5
        with ref(n_nitrishapedata.triangles[9]) as n_triangle:
            n_triangle.v_1 = 2
            n_triangle.v_2 = 5
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[10]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[11]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 3
            n_triangle.v_3 = 5
    return n_data
Exemplo n.º 23
0
def n_create_blocks(n_data):
    n_ninode_1 = NifFormat.NiNode()
    n_nitrishape_1 = NifFormat.NiTriShape()
    n_nitrishapedata_1 = NifFormat.NiTriShapeData()
    n_data.roots = [n_ninode_1]

    with ref(n_ninode_1) as n_ninode:
        n_ninode.name = b'Scene Root'
        n_ninode.flags = 14
        with ref(n_ninode.rotation) as n_matrix33:
            n_matrix33.m_11 = 1
            n_matrix33.m_22 = 1
            n_matrix33.m_33 = 1
        n_ninode.scale = 1
        n_ninode.num_children = 1
        n_ninode.children.update_size()
        n_ninode.children[0] = n_nitrishape_1

    with ref(n_nitrishape_1) as n_nitrishape:
        n_nitrishape.name = b'Cube'
        n_nitrishape.flags = 14
        n_nitrishape.data = n_nitrishapedata_1

    with ref(n_nitrishapedata_1) as n_nitrishapedata:
        n_nitrishapedata.has_vertices = True
        n_nitrishapedata.num_vertices = 8
        n_nitrishapedata.vertices.update_size()
        with ref(n_nitrishapedata.vertices[0]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[1]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[2]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[3]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[4]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = 1.75
        with ref(n_nitrishapedata.vertices[5]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[6]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[7]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = 1.75

        n_nitrishapedata.has_normals = True
        n_nitrishapedata.normals.update_size()
        with ref(n_nitrishapedata.normals[0]) as n_vector3:
            n_vector3.x = 0.669057
            n_vector3.y = 0.4991
            n_vector3.z = -0.550676
        with ref(n_nitrishapedata.normals[1]) as n_vector3:
            n_vector3.x = 0.669057
            n_vector3.y = -0.4991
            n_vector3.z = -0.550676
        with ref(n_nitrishapedata.normals[2]) as n_vector3:
            n_vector3.x = -0.481826
            n_vector3.y = -0.64098
            n_vector3.z = -0.59743
        with ref(n_nitrishapedata.normals[3]) as n_vector3:
            n_vector3.x = -0.481826
            n_vector3.y = 0.64098
            n_vector3.z = -0.59743
        with ref(n_nitrishapedata.normals[4]) as n_vector3:
            n_vector3.x = 0.669057
            n_vector3.y = 0.4991
            n_vector3.z = 0.550676
        with ref(n_nitrishapedata.normals[5]) as n_vector3:
            n_vector3.x = -0.481826
            n_vector3.y = 0.64098
            n_vector3.z = 0.59743
        with ref(n_nitrishapedata.normals[6]) as n_vector3:
            n_vector3.x = -0.481826
            n_vector3.y = -0.64098
            n_vector3.z = 0.59743
        with ref(n_nitrishapedata.normals[7]) as n_vector3:
            n_vector3.x = 0.669027
            n_vector3.y = -0.4991
            n_vector3.z = 0.550676

        with ref(n_nitrishapedata.center) as n_vector3:
            n_vector3.x = 4.76837e-07
            n_vector3.y = 2.14577e-06

        n_nitrishapedata.radius = 11.1692
        n_nitrishapedata.consistency_flags = NifFormat.ConsistencyType.CT_STATIC

        n_nitrishapedata.num_triangles = 12
        n_nitrishapedata.num_triangle_points = 36
        n_nitrishapedata.has_triangles = True
        n_nitrishapedata.triangles.update_size()
        with ref(n_nitrishapedata.triangles[0]) as n_triangle:
            n_triangle.v_2 = 1
            n_triangle.v_3 = 2
        with ref(n_nitrishapedata.triangles[1]) as n_triangle:
            n_triangle.v_2 = 2
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[2]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 5
            n_triangle.v_3 = 6
        with ref(n_nitrishapedata.triangles[3]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 6
            n_triangle.v_3 = 7
        with ref(n_nitrishapedata.triangles[4]) as n_triangle:
            n_triangle.v_2 = 4
            n_triangle.v_3 = 7
        with ref(n_nitrishapedata.triangles[5]) as n_triangle:
            n_triangle.v_2 = 7
            n_triangle.v_3 = 1
        with ref(n_nitrishapedata.triangles[6]) as n_triangle:
            n_triangle.v_1 = 1
            n_triangle.v_2 = 7
            n_triangle.v_3 = 6
        with ref(n_nitrishapedata.triangles[7]) as n_triangle:
            n_triangle.v_1 = 1
            n_triangle.v_2 = 6
            n_triangle.v_3 = 2
        with ref(n_nitrishapedata.triangles[8]) as n_triangle:
            n_triangle.v_1 = 2
            n_triangle.v_2 = 6
            n_triangle.v_3 = 5
        with ref(n_nitrishapedata.triangles[9]) as n_triangle:
            n_triangle.v_1 = 2
            n_triangle.v_2 = 5
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[10]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[11]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 3
            n_triangle.v_3 = 5
    return n_data
Exemplo n.º 24
0
def n_create_blocks(n_data):
    n_ninode_1 = NifFormat.NiNode()
    n_nitrishape_1 = NifFormat.NiTriShape()
    n_nitrishapedata_1 = NifFormat.NiTriShapeData()
    n_data.roots = [n_ninode_1]

    with ref(n_ninode_1) as n_ninode:
        n_ninode.name = b'Scene Root'
        n_ninode.flags = 14
        with ref(n_ninode.rotation) as n_matrix33:
            n_matrix33.m_11 = 1
            n_matrix33.m_22 = 1
            n_matrix33.m_33 = 1
        n_ninode.scale = 1
        n_ninode.num_children = 1
        n_ninode.children.update_size()
        n_ninode.children[0] = n_nitrishape_1
    with ref(n_nitrishape_1) as n_nitrishape:
        n_nitrishape.name = b'Cube'
        n_nitrishape.flags = 14
        with ref(n_nitrishape.translation) as n_vector3:
            n_vector3.x = 20
            n_vector3.y = 20
            n_vector3.z = 20
        with ref(n_nitrishape.rotation) as n_matrix33:
            n_matrix33.m_11 = 0
            n_matrix33.m_21 = -0.5
            n_matrix33.m_31 = 0.866025
            n_matrix33.m_12 = 0.866025
            n_matrix33.m_22 = -0.433013
            n_matrix33.m_32 = -0.25
            n_matrix33.m_13 = 0.5
            n_matrix33.m_23 = 0.75
            n_matrix33.m_33 = 0.433012
            # just to make sure in case we change values:
            assert(n_matrix33.is_rotation())
        n_nitrishape.scale = 0.75
        n_nitrishape.data = n_nitrishapedata_1
    with ref(n_nitrishapedata_1) as n_nitrishapedata:
        n_nitrishapedata.num_vertices = 8
        n_nitrishapedata.has_vertices = True
        n_nitrishapedata.vertices.update_size()
        with ref(n_nitrishapedata.vertices[0]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[1]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = -1.75
        with ref(n_nitrishapedata.vertices[2]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[3]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = -3.5
        with ref(n_nitrishapedata.vertices[4]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = 3.75
            n_vector3.z = 1.75
        with ref(n_nitrishapedata.vertices[5]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = 7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[6]) as n_vector3:
            n_vector3.x = -7.5
            n_vector3.y = -7.5
            n_vector3.z = 3.5
        with ref(n_nitrishapedata.vertices[7]) as n_vector3:
            n_vector3.x = 7.5
            n_vector3.y = -3.75
            n_vector3.z = 1.75
        n_nitrishapedata.radius = 11.1692
        n_nitrishapedata.consistency_flags = 16384
        n_nitrishapedata.num_triangles = 12
        n_nitrishapedata.num_triangle_points = 36
        n_nitrishapedata.has_triangles = True
        n_nitrishapedata.triangles.update_size()
        with ref(n_nitrishapedata.triangles[0]) as n_triangle:
            n_triangle.v_2 = 1
            n_triangle.v_3 = 2
        with ref(n_nitrishapedata.triangles[1]) as n_triangle:
            n_triangle.v_2 = 2
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[2]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 5
            n_triangle.v_3 = 6
        with ref(n_nitrishapedata.triangles[3]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 6
            n_triangle.v_3 = 7
        with ref(n_nitrishapedata.triangles[4]) as n_triangle:
            n_triangle.v_2 = 4
            n_triangle.v_3 = 7
        with ref(n_nitrishapedata.triangles[5]) as n_triangle:
            n_triangle.v_2 = 7
            n_triangle.v_3 = 1
        with ref(n_nitrishapedata.triangles[6]) as n_triangle:
            n_triangle.v_1 = 1
            n_triangle.v_2 = 7
            n_triangle.v_3 = 6
        with ref(n_nitrishapedata.triangles[7]) as n_triangle:
            n_triangle.v_1 = 1
            n_triangle.v_2 = 6
            n_triangle.v_3 = 2
        with ref(n_nitrishapedata.triangles[8]) as n_triangle:
            n_triangle.v_1 = 2
            n_triangle.v_2 = 6
            n_triangle.v_3 = 5
        with ref(n_nitrishapedata.triangles[9]) as n_triangle:
            n_triangle.v_1 = 2
            n_triangle.v_2 = 5
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[10]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_3 = 3
        with ref(n_nitrishapedata.triangles[11]) as n_triangle:
            n_triangle.v_1 = 4
            n_triangle.v_2 = 3
            n_triangle.v_3 = 5
    return n_data