elitepvpers

elitepvpers (https://www.elitepvpers.com/forum/)
-   Dekaron Private Server (https://www.elitepvpers.com/forum/dekaron-private-server/)
-   -   Look what i found (https://www.elitepvpers.com/forum/dekaron-private-server/430851-look-what-i-found.html)

janvier123 01/18/2010 03:13

Look what i found
 
[Only registered and activated users can see links. Click Here To Register...]
(NPC: Holde)

tutorial below

nobleman80 01/18/2010 03:21

NICE. JUST POST THE LINK FOR DOWNLOADING THIS PROGRAM. WE WILL FIGURE OUT. DUN NEED TUT.

janvier123 01/18/2010 03:52

Installation:
  1. Download and install Blender 2.5 Alpha 0 from [Only registered and activated users can see links. Click Here To Register...]
  2. Download and install Python 3.1.x from [Only registered and activated users can see links. Click Here To Register...] (Windows Users)
  3. Copy and paste source code to Blender scripts directory (<Blender_Directory>/.blender/scripts/io) as import_scene_dekaron_mesh.py

Usage:
  1. Click File > Import > Dekaron (.mesh)
  2. Select *.mesh file
  3. Click Import Dekaron Mesh

License:
[Only registered and activated users can see links. Click Here To Register...]
Source:
Copy and save as: import_scene_dekaron_mesh.py
Code:

# Copyright (c) 2009 Peter S. Stevens
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Version 0.0.1
#    * Initial release

__author__ = 'Peter S. Stevens'
__email__ = 'pstevens:cryptomail*org'
__url__ = ('blender', 'elysiun', 'Project homepage, http://www.********.com/')
__version__ = '0.0.1'
__bpydoc__ = ''' \
Import Dekaron mesh files
'''


import bpy
import dynamic_menu
import io
import os
import struct


def create_dekaron_mesh(dekaron_mesh_name, dekaron_mesh_vertices_co, dekaron_mesh_vertices_uv, dekaron_mesh_indices):
    dekaron_mesh = bpy.data.add_mesh(dekaron_mesh_name)
   
    dekaron_mesh.add_geometry(int(len(dekaron_mesh_vertices_co) / 3), 0, int(len(dekaron_mesh_indices) / 4))
   
    dekaron_mesh.verts.foreach_set("co", dekaron_mesh_vertices_co)
   
    dekaron_mesh.faces.foreach_set("verts_raw", dekaron_mesh_indices)
   
    if dekaron_mesh.faces is not None and \
      dekaron_mesh_vertices_uv is not None and \
      len(dekaron_mesh_vertices_uv) > 0:
        dekaron_mesh.add_uv_texture()
       
        for i, dekaron_mesh_face in enumerate(dekaron_mesh.faces):
            dekaron_mesh_texture_face = dekaron_mesh.uv_textures[0].data[i]
           
            dekaron_mesh_texture_face_uvs = [dekaron_mesh_vertices_uv[j] for j in dekaron_mesh_face.verts]
           
            dekaron_mesh_texture_face.uv1 = dekaron_mesh_texture_face_uvs[0]
            dekaron_mesh_texture_face.uv2 = dekaron_mesh_texture_face_uvs[1]
            dekaron_mesh_texture_face.uv3 = dekaron_mesh_texture_face_uvs[2]
   
    dekaron_mesh.update()
   
    dekaron_mesh_object = bpy.data.add_object("MESH", dekaron_mesh_name)
   
    dekaron_mesh_object.data = dekaron_mesh
   
    return dekaron_mesh_object


def parse_dekaron_mesh_file_mesh0(dekaron_mesh_file):
    dekaron_mesh_file_mesh_name_length = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
   
    dekaron_mesh_file_mesh_name = dekaron_mesh_file.read(dekaron_mesh_file_mesh_name_length)
   
    dekaron_mesh_file_mesh_aabb = struct.unpack('<6f', dekaron_mesh_file.read(24))[0]
   
    dekaron_mesh_file_mesh_vertex_count = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
   
    dekaron_mesh_file_mesh_vertices_co = []
   
    for i in range(dekaron_mesh_file_mesh_vertex_count):
        dekaron_mesh_file_mesh_vertices_co.extend(list(struct.unpack('3f', dekaron_mesh_file.read(12))))
       
        dekaron_mesh_file.seek(28, os.SEEK_CUR)
   
    dekaron_mesh_file_mesh_index_count = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
   
    dekaron_mesh_file_mesh_indices = []
   
    for i in range(int(dekaron_mesh_file_mesh_index_count / 3)):
        dekaron_mesh_file_mesh_indices.extend(list(struct.unpack('<3H', dekaron_mesh_file.read(6))))
        dekaron_mesh_file_mesh_indices.append(0)
   
    if len(dekaron_mesh_file_mesh_name) <= 0:
        dekaron_mesh_file_mesh_name = os.path.splitext(os.path.basename(dekaron_mesh_file.name))[0]
   
    dekaron_mesh_file_mesh_bone_count = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
   
    for i in range(dekaron_mesh_file_mesh_bone_count):
        dekaron_mesh_file_mesh_bone_name_length = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
       
        dekaron_mesh_file_mesh_bone_name = dekaron_mesh_file.read(dekaron_mesh_file_mesh_bone_name_length)
   
    return create_dekaron_mesh(dekaron_mesh_file_mesh_name, \
                              dekaron_mesh_file_mesh_vertices_co, \
                              None, \
                              dekaron_mesh_file_mesh_indices)


def parse_dekaron_mesh_file_mesh3(dekaron_mesh_file):
    def is_face_degenerate(face_indices):
        if face_indices[0] == face_indices[1]:
            return True
        elif face_indices[0] == face_indices[2]:
            return True
        elif face_indices[1] == face_indices[2]:
            return True
       
        return False
   
    dekaron_mesh_file_mesh_aabb = struct.unpack('<6f', dekaron_mesh_file.read(24))[0]
   
    dekaron_mesh_file_mesh_unknown_count0 = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
   
    dekaron_mesh_file_mesh_indices = []
   
    for i in range(dekaron_mesh_file_mesh_unknown_count0):
        dekaron_mesh_file_mesh_unknown0, \
        dekaron_mesh_file_mesh_unknown1, \
        dekaron_mesh_file_mesh_unknown2, \
        dekaron_mesh_file_mesh_unknown3, \
        dekaron_mesh_file_mesh_index_count = struct.unpack('<IIIII', dekaron_mesh_file.read(20))
       
        if dekaron_mesh_file_mesh_index_count > 0:
            face_indices = list(struct.unpack('<2H', dekaron_mesh_file.read(4)))
           
            for j in range(2, dekaron_mesh_file_mesh_index_count):
                face_indices.append(struct.unpack('<H', dekaron_mesh_file.read(2))[0])
               
                face_indices_copy = face_indices[:]
               
                if not j % 2:
                    face_indices_copy.reverse()
               
                if is_face_degenerate(face_indices_copy) is False:
                    dekaron_mesh_file_mesh_indices.extend(face_indices_copy)
                    dekaron_mesh_file_mesh_indices.append(0)
               
                face_indices.pop(0)
   
    dekaron_mesh_file_mesh_vertex_count = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
   
    dekaron_mesh_file_mesh_vertices_co = []
    dekaron_mesh_file_mesh_vertices_no = []
    dekaron_mesh_file_mesh_vertices_uv1 = []
   
    for i in range(dekaron_mesh_file_mesh_vertex_count):
        dekaron_mesh_file_mesh_vertices_co.extend(list(struct.unpack('3f', dekaron_mesh_file.read(12))))
        dekaron_mesh_file_mesh_vertices_no.extend(list(struct.unpack('3f', dekaron_mesh_file.read(12))))
        dekaron_mesh_file_mesh_vertex_uv1 = list(struct.unpack('2f', dekaron_mesh_file.read(8)))
       
        dekaron_mesh_file_mesh_vertex_uv1[1] = (1.0 - dekaron_mesh_file_mesh_vertex_uv1[1]) - 1.0
       
        dekaron_mesh_file_mesh_vertices_uv1.append(dekaron_mesh_file_mesh_vertex_uv1)
       
        dekaron_mesh_file.seek(24, os.SEEK_CUR)
   
    dekaron_mesh_file_mesh_bone_count = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
   
    for i in range(dekaron_mesh_file_mesh_bone_count):
        dekaron_mesh_file_mesh_bone_name_length = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
       
        dekaron_mesh_file_mesh_bone_name = dekaron_mesh_file.read(dekaron_mesh_file_mesh_bone_name_length)
   
    dekaron_mesh_file.seek(4, os.SEEK_CUR)
   
    return create_dekaron_mesh(os.path.splitext(os.path.basename(dekaron_mesh_file.name))[0], \
                              dekaron_mesh_file_mesh_vertices_co, \
                              dekaron_mesh_file_mesh_vertices_uv1, \
                              dekaron_mesh_file_mesh_indices)


def parse_dekaron_mesh_file_meshes(dekaron_mesh_file, dekaron_mesh_type):
    dekaron_mesh_file_mesh_count = struct.unpack('<I', dekaron_mesh_file.read(4))[0]
   
    dekaron_mesh_objects = []
   
    for i in range(dekaron_mesh_file_mesh_count):
        if dekaron_mesh_type == 0:
            dekaron_mesh_objects.append(parse_dekaron_mesh_file_mesh0(dekaron_mesh_file))
        elif dekaron_mesh_type == 3:
            dekaron_mesh_objects.append(parse_dekaron_mesh_file_mesh3(dekaron_mesh_file))
   
    return dekaron_mesh_objects


def parse_dekaron_mesh_file(dekaron_mesh_file):
    dekaron_mesh_file_header_magic, \
    dekaron_mesh_file_header_unknown0, \
    dekaron_mesh_file_header_unknown1, \
    dekaron_mesh_file_header_unknown2, \
    dekaron_mesh_file_header_mesh_data_address0, \
    dekaron_mesh_file_header_mesh_data_size0, \
    dekaron_mesh_file_header_mesh_data_address1, \
    dekaron_mesh_file_header_mesh_data_size1, \
    dekaron_mesh_file_header_mesh_data_address2, \
    dekaron_mesh_file_header_mesh_data_size2, \
    dekaron_mesh_file_header_mesh_data_address3, \
    dekaron_mesh_file_header_mesh_data_size3 = struct.unpack('<IIIIIIIIIIII', dekaron_mesh_file.read(48))
   
    dekaron_mesh_file_header_work_path = dekaron_mesh_file.read(64)
   
    if dekaron_mesh_file_header_magic != 0x20031117:
        return
   
    dekaron_mesh_objects = []
   
    # Parse collision meshes
    if dekaron_mesh_file_header_mesh_data_size0 >= 4:
        dekaron_mesh_file.seek(dekaron_mesh_file_header_mesh_data_address0)
       
        dekaron_mesh_objects.extend(parse_dekaron_mesh_file_meshes(dekaron_mesh_file, 0))
   
    # Parse meshes
    if dekaron_mesh_file_header_mesh_data_size3 >= 4:
        dekaron_mesh_file.seek(dekaron_mesh_file_header_mesh_data_address3)
       
        dekaron_mesh_objects.extend(parse_dekaron_mesh_file_meshes(dekaron_mesh_file, 3))
   
    return dekaron_mesh_objects


def import_dekaron_mesh_file_from_path(dekaron_mesh_file_path, context): 
#    dekaron_mesh_scene = bpy.data.scenes.new()
#   
#    dekaron_mesh_scene.make_current()
#   
    with io.open(dekaron_mesh_file_path, mode='r+b') as dekaron_mesh_file:
        dekaron_mesh_objects = parse_dekaron_mesh_file(dekaron_mesh_file)
       
        for dekaron_mesh_object in dekaron_mesh_objects:
            context.scene.objects.link(dekaron_mesh_object)


class ImportDekaronMeshFile(bpy.types.Operator):
    '''Import Dekaron mesh'''
   
    bl_idname = "import_scene.dekaron_mesh"
    bl_label = 'Import Dekaron Mesh'
   
    path = bpy.props.StringProperty(name="File Path", description="Dekaron mesh file path", maxlen= 1024, default= "")
   
    def execute(self, context):
        import_dekaron_mesh_file_from_path(self.properties.path, context)
       
        return ('FINISHED',)
   
    def invoke(self, context, event):
        window_manager = context.manager
       
        window_manager.add_fileselect(self)
       
        return ('RUNNING_MODAL',)


bpy.ops.add(ImportDekaronMeshFile)

menu_function = lambda self, context: self.layout.operator(ImportDekaronMeshFile.bl_idname, text="Dekaron (.mesh)...")
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_import, menu_function)


Data Unpacker:

Usage:
  1. Open Command Prompt/Console/Terminal
  2. Type: C:\Python31\python.exe dekaron_unpacker.py --directory="<Dekaron_Directory>\data\"

License:
[Only registered and activated users can see links. Click Here To Register...]
Source:
Copy and save as: dekaron_unpacker.py
Code:

# Copyright (c) 2009 Peter S. Stevens
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.


import getopt
import mmap
import os
import struct
import sys


def dekaron_unpack_parse_header_file(pack_header_file, pack_directory_name):
    pack_header_file.seek(400, os.SEEK_CUR)
   
    pack_chunk_file_count = struct.unpack('<I', pack_header_file.read(4))[0]
   
    for i in range(pack_chunk_file_count):
        pack_chunk_file_name_length = struct.unpack('<I', pack_header_file.read(4))[0]
       
        pack_chunk_file_name = pack_header_file.read(pack_chunk_file_name_length)
       
        pack_chunk_file_name = os.path.join(pack_directory_name, pack_chunk_file_name)
       
        with open(pack_chunk_file_name, 'r+b') as pack_chunk_file:
            pack_chunk_file_memory_map = mmap.mmap(pack_chunk_file.fileno(), 0)
           
            pack_chunk_file_directory_count = struct.unpack('<I', pack_header_file.read(4))[0]
           
            for b in xrange(pack_chunk_file_directory_count):
                pack_chunk_file_directroy_name_length = struct.unpack('<I', pack_header_file.read(4))[0]
               
                pack_chunk_file_directroy_name = pack_header_file.read(pack_chunk_file_directroy_name_length)
               
                pack_chunk_file_directroy_name = os.path.join(pack_directory_name, pack_chunk_file_directroy_name)
           
            pack_chunk_file_size, \
            pack_chunk_file_unknown0, \
            pack_chunk_file_file_count, \
            pack_chunk_file_unknown1 = struct.unpack('<4I', pack_header_file.read(16))
           
            print("pack file: {0} ({1:X} bytes)".format(pack_chunk_file_name, pack_chunk_file_size))
           
            for j in range(pack_chunk_file_file_count):
                pack_chunk_file_file_name_length = struct.unpack('<I', pack_header_file.read(4))[0]
               
                pack_chunk_file_file_name = pack_header_file.read(pack_chunk_file_file_name_length)
               
                pack_chunk_file_file_name = pack_chunk_file_file_name.replace('/', os.sep)
               
                pack_chunk_file_file_name = os.path.join(pack_directory_name, pack_chunk_file_file_name[6:])
               
                pack_chunk_file_file_pointer, \
                pack_chunk_file_file_unknown0, \
                pack_chunk_file_file_size, \
                pack_chunk_file_file_unknown2, \
                pack_chunk_file_file_unknown3 = struct.unpack('<5I', pack_header_file.read(20))
               
                pack_chunk_file_memory_map.seek(pack_chunk_file_file_pointer)
               
                pack_chunk_file_file_directory = os.path.dirname(pack_chunk_file_file_name)
               
                if os.path.exists(pack_chunk_file_file_directory) is False:
                    os.makedirs(pack_chunk_file_file_directory)
                   
                    print("created directory structure: {0}".format(pack_chunk_file_file_directory))
               
                with open(pack_chunk_file_file_name, 'w+b') as pack_chunk_file_file:
                    pack_chunk_file_file.write(memory_map.read(pack_chunk_file_file_size))
               
                print("unpacked file: {0} ({1:X} bytes)".format(pack_chunk_file_file_name, pack_chunk_file_file_size))
           
            pack_chunk_file_memory_map.close()


def dekaron_unpack(pack_directory_name):
    pack_header_file_name = os.path.join(pack_directory_name, 'pack.hdr')
   
    if os.path.exists(pack_directory_name) is False:
        return
   
    with open(pack_header_file_name, 'r+b') as pack_header_file:
        dekaron_unpack_parse_header_file(pack_header_file, pack_directory_name)


def main(argv):
    pack_directory_name = None
   
    if len(argv) == 0:
        pack_directory_name = os.getcwd()
    elif len(argv) == 1:
        try:
            options, arguments = getopt.getopt(argv, 'd', ['directory='])
        except getopt.GetoptError:
            sys.exit(2)
       
        for option, argument in options:
            if option in ('d', '--directory'):
                pack_directory_name = argument
   
    if pack_directory_name is None or \
      os.path.exists(pack_directory_name) is False or \
      os.path.isdir(pack_directory_name) is False:
            sys.exit(2)
    else:
        dekaron_unpack(pack_directory_name)


if __name__ == "__main__":
    main(sys.argv[1:])

and export as *.ply and view with [Only registered and activated users can see links. Click Here To Register...]

By Phantom*

Deadman88 01/18/2010 07:28

that in ******** right?im aready see it..

Lanayru 01/18/2010 08:02

still need to find out how to export as mesh to be able to use with dekaron and yes i already found that on another site i just can't find an export thing for it so it's still useless until then:/

cro90 01/18/2010 09:49

lol you could make your own in 3ds max... Ive made stuff like this before...

nobleman80 01/18/2010 12:27

yeah i found this in other thread. samething

Lanayru 01/18/2010 13:39

Quote:

Originally Posted by cro90 (Post 3958699)
lol you could make your own in 3ds max... Ive made stuff like this before...

like i said before need to be able to save/export the files as .mesh too one that doesn't dc i've also tried 3ds max too and still no luck:\

janvier123 01/18/2010 14:20

i was looking for a way to export a mesh file that can be loaded from into a java script
that will show the exported mesh, i came to this but i still didnt find it

and someone else posted a tut about how to do it with gimp

҉ THT ҉ 01/18/2010 19:28

I cant get it working >.<

BlindGuard77 01/18/2010 19:32

Fail much? Too 1337 to follow simple instructions? Can't even post something more detailed than "I cant get it working >.<" so someone could actually attempt to help you?


Epic fail sir...Epic. Fail.

҉ THT ҉ 01/18/2010 19:35

Quote:

Originally Posted by BlindGuard77 (Post 3962589)
Fail much? Too 1337 to follow simple instructions? Can't even post something more detailed than "I cant get it working >.<" so someone could actually attempt to help you?


Epic fail sir...Epic. Fail.

You Failing everyone with out any release or anything that helped
Only how you making post is "Epic fail".
Find another way to make posts


I did everything what janvier wrote but
when I push import/dekaron mesh/ and choose a mesh file from data
I cant get that mesh in the screen to edit

BlindGuard77 01/18/2010 19:47

I don't need to re-post the same old vac+wall+no-aggro winhex BS to be helpful. I rather give answers to questions, questions that most of this forum users are barely able to comprehend, let alone, answer. It's just that I really hate arrogance. Do yuo even know what a real hacker is? Yet you're name/user title/signature implies that you are "h4xor". Hackers make real things, instead of making some pathetic scripts for an online game.

Try a different mesh. That editor isn't working completely for all mesh files (Unfortunately), so everyone will have to wait until someone releases a better version.

҉ THT ҉ 01/18/2010 19:54

Quote:

Originally Posted by BlindGuard77 (Post 3962729)
I don't need to re-post the same old vac+wall+no-aggro winhex BS to be helpful. I rather give answers to questions, questions that most of this forum users are barely able to comprehend, let alone, answer. It's just that I really hate arrogance. Do yuo even know what a real hacker is? Yet you're name/user title/signature implies that you are "h4xor". Hackers make real things, instead of making some pathetic scripts for an online game.

Try a different mesh. That editor isn't working completely for all mesh files (Unfortunately), so everyone will have to wait until someone releases a better version.

I know this will be adv but i dont care

[Only registered and activated users can see links. Click Here To Register...]
If you can make a site like this (me)
Then come tell me what hacking is
go check it out

+INFO
scroll down
Üyeler: 508.161
uyeler=members

fiore14 04/19/2010 21:51

I know this hasn't been updated in a while.

if you can't get this working download this

[Only registered and activated users can see links. Click Here To Register...]

I had to go back to this version to get it finally working.

Minor example

[Only registered and activated users can see links. Click Here To Register...]

conquer93 06/28/2010 20:30

Hey how do i get this >
1. Open Command Prompt/Console/Terminal
2. Type: C:\Python31\python.exe dekaron_unpacker.py --directory="<Dekaron_Directory>\data\"

i open CMD and then ?:S

Indrek888 06/29/2010 06:44

to bad we cant export as dekaron .mesh so its pointless

♠Vegeta♠ 06/30/2010 17:35

I found a script on the web to export meshes from blender, im not sure if it works or anything as im not good at any of this stuff.

If your interested just let me know and ill post a link here.

Lanayru 07/01/2010 13:39

i am very interested in that export ^_^
i have worked with this program ALOT and have made some nice stuff
but sadly i haven't been able to export as .mesh T_T

pieter 07/01/2010 14:39

it that would work it would mean a complete new start in the modding part for dekaron!

♠Vegeta♠ 07/02/2010 04:29

Here guys heres the script, i dont know who to give credits to BUT I DID NOT MAKE THE CODE. Also im not sure if its a full or unfinished script.

Spoiler:
import Blender210 as Blender

import math

import string

import sys



exportAnimations = 1





def printModuleInfo(module, example):

exec("import %s" % module)

print

print "#" * 79

exec("print %s.__doc__" % module)

print "#" * 79

exec("names = dir(%s)" % module)

for name in names:

exec('ifClause = "if type(%s.%s) == type(%s.%s): "' %

(module, name, module, example))

exec('statement = "print %s.%s.__doc__"' % (module, name))

exec(ifClause + statement)





class AllegroExport:



def __init__(self, filename):

self.filename = filename

self.file = None

self.scene = None

self.display = None

self.meshname = None



def export(self, meshname):

self.meshname = meshname



print "exporting ..."

self.file = open(self.filename, "w")

self.writeHeader()

self.writeVertexes(meshname)

self.writeTris(meshname)

self.writeEnd()



self.file.close()





def writeVertexes(self, name):

#if Blender.isMesh(name):

self.writeIdentifier(name)

object = Blender.getObject(name)

mesh = Blender.getMesh(object.data)

cname = name

cname = string.replace(cname, ".", "_")

cname = string.replace(cname, " ", "_")

cname = string.lower(cname)

self.file.write("V3D %s_v3d[]= {\n" % (cname))



index = 0

for vertex in mesh.vertices:

self.file.write(" {%2.6f, %2.6f, %2.6f},\n" %

(vertex[0],

vertex[1],

vertex[2]))

index = index + 1

self.file.write(" };\n")





def writeTris(self, name):



if Blender.isMesh(name):

meshobj = Blender.getObject(name)

mesh = Blender.getMesh(meshobj.data)



self.writeIdentifier(name)

cname = name

cname = string.replace(cname, ".", "_")

cname = string.replace(cname, " ", "_")

cname = string.lower(cname)



self.file.write("TRIS %s_tris[]= {\n" % (cname))

index = 0

for face in mesh.faces:

self.file.write(" {%s, %s, %s},\n" %

(face[0],

face[1],

face[2]))



self.file.write(" }\n")

index = index + 1

self.file.write("}\n")



else:

print "Sorry can export meshes only ..."



def writeEnd(self):

print "... finished"



def writeHeader(self):

self.file.write("/* file exported by blender mesh_exp.py\n")

self.file.write(" script by Matt Smith 2003 */\n")



def writeIdentifier(self, name):

self.file.write("// %s\n" % name)





#if __name__ == "__main__":

# printModuleInfo("Blender", "getCurrentScene")



v3d_export = AllegroExport("\\Devprojects\\speedhack\\test.c")

scene = Blender.getCurrentScene()

v3d_export.export("Plane.021")

Good luck and i hope this will solve everyones problems.

Regards
♠Vegeta♠

FattyB 09/07/2010 03:43

It was taken from here [Only registered and activated users can see links. Click Here To Register...] and it is only the very basic frame work for exporting the vertices and indices. It WILL NOT instantly export to .mesh format.

Rasty04 03/19/2014 21:31

my blender cant open .mesh :(

Farius~ 03/19/2014 23:46

Quote:

Originally Posted by Rasty04 (Post 27564010)
my blender cant open .mesh :(

This post was about 4 years ago

Rasty04 03/20/2014 00:02

i need to resolve this please :/ add me at skype: julian.gomez910 please need solution to open .mesh

Decima 03/20/2014 00:45

[Only registered and activated users can see links. Click Here To Register...]

he posted how to do it ffs. . .

and if u continue reading u will see [Only registered and activated users can see links. Click Here To Register...]

where he tells you it cant be exported to use with the game.

i find it hard to believe that you are going to get this done seeing as how u cant even read the first page of a thread about how to import it

"Dark_Evolution" 02/12/2015 16:31

QQ

Decima 02/13/2015 06:35

CONGRATZ!!!

u just revived a year old post for nothing but to prove ur a moron *claps*


All times are GMT +1. The time now is 18:49.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.