elitepvpers
elitepvpers
Search


Forum New Posts Register Login

Look what i found

Discussion on Look what i found within the Dekaron Private Server forum part of the Dekaron category.

« Dekaron Private Server Forum


Reply
  #1  
Old 01/18/2010, 03:13

(NPC: Holde)

tutorial below

Last edited by janvier123; 02/03/2010 at 06:32.
  #2  
Old 01/18/2010, 03:21
NICE. JUST POST THE LINK FOR DOWNLOADING THIS PROGRAM. WE WILL FIGURE OUT. DUN NEED TUT.
  #3  
Old 01/18/2010, 03:52
Installation:
  1. Download and install Blender 2.5 Alpha 0 from
  2. Download and install Python 3.1.x from (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:
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:
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

By Phantom*

Last edited by janvier123; 02/03/2010 at 06:33.
Thanks
1 User
  #4  
Old 01/18/2010, 07:28
that in ******** right?im aready see it..
  #5  
Old 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:/
  #6  
Old 01/18/2010, 09:49
lol you could make your own in 3ds max... Ive made stuff like this before...
  #7  
Old 01/18/2010, 12:27
yeah i found this in other thread. samething
  #8  
Old 01/18/2010, 13:39
Quote:
Originally Posted by cro90 View Post
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:\
  #9  
Old 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
  #10  
Old 01/18/2010, 19:28
I cant get it working >.<
  #11  
Old 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.
  #12  
Old 01/18/2010, 19:35
Quote:
Originally Posted by BlindGuard77 View Post
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
  #13  
Old 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.
  #14  
Old 01/18/2010, 19:54
Quote:
Originally Posted by BlindGuard77 View Post
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


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
  #15  
Old 04/19/2010, 21:51
I know this hasn't been updated in a while.

if you can't get this working download this



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

Minor example


Last edited by fiore14; 04/19/2010 at 22:01.
Reply



Similar Threads Similar Threads
NEW MLE FOUND
07/02/2009 - Grand Chase - 193 Replies
new MLE version 1337 and 1342 was already been used by others... just cant find where they get it.. sana wala nang leechers ngaun...
Found a AL Bot -_-
12/20/2007 - Archlord - 11 Replies
hey all , i found a al bot but gotta pay for it , it looks good ... but didn't test it , says has alot of functions if any1 want it pm me , dont want post it here , cause of CM etc. (if i dont answer to your pm pls wait)
Trojan found in server.exe found in 0919 + Crack by Mandark (Projecthax) post
12/15/2007 - SRO Hacks, Bots, Cheats & Exploits - 26 Replies
WARNING Alright look at what AVG thought of the server.exe that originated form this post: 0919 + Crack by Mandark (Projecthax) glad i didnt bot on my main account :D http://i32.photobucket.com/albums/d34/nellyrev/un titled2.jpg
come and look what i found
10/28/2006 - Conquer Online 2 - 3 Replies
here is the image


All times are GMT +2. The time now is 23:16.


Desktop Version

Powered by vBulletin®
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.