Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Dekaron > Dekaron Private Server
You last visited: Today at 03:19

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[SOLVED] .MESH DEKARON FILE

Discussion on [SOLVED] .MESH DEKARON FILE within the Dekaron Private Server forum part of the Dekaron category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2010
Posts: 24
Received Thanks: 1
yeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeee!!!!!!!!!!!!!!

I have link of programs and plugin for open .mesh file... who is interested?

now i try to modify!!!!
malatoforte is offline  
Old 08/31/2010, 01:49   #2



 
MMOPerfection©'s Avatar
 
elite*gold: 280
Join Date: Mar 2008
Posts: 1,548
Received Thanks: 310
yipee?

#reported for double posting.
MMOPerfection© is offline  
Old 08/31/2010, 01:57   #3
 
elite*gold: 0
Join Date: Jun 2010
Posts: 24
Received Thanks: 1
yes... now i find simple method... blender is very particular... just one version of blender is compatible with python script (plugin) that allow u to read .mesh file of dekaron ^^

now i go to smoke (wait 5 minutes) and write the guide with link 100% work....

p.s. i think can MODIFY dekaron items with blender !!!

ok...
this is a simple guide for open .mesh file of dekaron...sorry for my bad english i am italian boy ^^

NOTE

in the guide (on elitepvpers) tell BLENDER 2.5 ALPHA 0 ... some newbie as me download from ufficial website of blender BLENDER 2.5 ALPHA 1 or ALPHA 2... with this NOT WORK THE PLUGIN... and the plugin must work with PYTHON 3.1 ....!!!!!!!!!!

PROGRAMS LINK!
Blender 2.5 Alpha 0


Python 3.1.2 is perfect


HOW TO INSTALL
Blender
Extract the .zip archive (just this) with right click - extract here
Python
Install the 3.1.2 version

PLUGIN
Go on
blender-2.5-alpha0-win32\.blender\scripts\io
Create a .txt file
Open the .txt file
Write this code

Quote:
# 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, ')
__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_ver tices_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(str uct.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_fil e.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(str uct.unpack('3f', dekaron_mesh_file.read(12))))
dekaron_mesh_file_mesh_vertices_no.extend(list(str uct.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.basen ame(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_fil e_mesh0(dekaron_mesh_file))
elif dekaron_mesh_type == 3:
dekaron_mesh_objects.append(parse_dekaron_mesh_fil e_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_me sh_data_address0)

dekaron_mesh_objects.extend(parse_dekaron_mesh_fil e_meshes(dekaron_mesh_file, 0))

# Parse meshes
if dekaron_mesh_file_header_mesh_data_size3 >= 4:
dekaron_mesh_file.seek(dekaron_mesh_file_header_me sh_data_address3)

dekaron_mesh_objects.extend(parse_dekaron_mesh_fil e_meshes(dekaron_mesh_file, 3))

return dekaron_mesh_objects


def import_dekaron_mesh_file_from_path(dekaron_mesh_fi le_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_idna me, text="Dekaron (.mesh)...")
menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_import, menu_function)
File-Save as
import_scene_dekaron_mesh.py
Type: All
Open Blender.exe
File
Import
Dekaron (.mesh)

-------------------
Now i try to modify the mesh file...

ok... we can open, modify .mesh files .....
but.......
i cant save on .mesh format... i must save in other mesh format... .3ds ......
1. blender exporter .mesh
2. converto TO .mesh program...
reply?
malatoforte is offline  
Thanks
1 User
Old 08/31/2010, 06:23   #4
 
elite*gold: 0
Join Date: Jan 2009
Posts: 226
Received Thanks: 80
thank you for telling us what we already knew. . . .
this has been said a few times now
but all have same problem
Can't Export As .MESH!!!
when you find out how to export as .mesh
then you have [SOLVED] .mesh dekaron file
Lanayru is offline  
Old 08/31/2010, 09:42   #5

 
elite*gold: 35
Join Date: Aug 2009
Posts: 5,822
Received Thanks: 1,958
Quote:
Originally Posted by Xplicit™ View Post
yipee?

#reported for double posting.
#merged
~Kakkarot~ is offline  
Thanks
1 User
Old 08/31/2010, 12:18   #6
 
elite*gold: 0
Join Date: Jun 2010
Posts: 24
Received Thanks: 1
i have founded another professional programm... in the video this program modify file in .mesh format!
i download and try ^^

ok...
i need help! The program open really .mesh file......and i think save .mesh file!
the principal problem is that when i open one mesh file... he not display... display remain blank... but i dont see error screen!
malatoforte is offline  
Old 08/31/2010, 13:04   #7
 
elite*gold: 0
Join Date: Jul 2009
Posts: 29
Received Thanks: 8
If I had the time I could wip you up an exporter, but I would have to learn the Blender Python API (and I hate Python since some of the symantics and other things are just terrible).

I converted that importer you took off Rage over to c++ a while back so I know the ins and outs of the mesh files now. By the way, that Blender importer is missing a ton of things, it is real basic, and only handles 1 type of mesh. There are 2 types, one with tangents and one without. Magic number 0x20031117 = no tangent and 0x20060303 = with tangent. Plus there are other meshes in the sub mesh 2 and 3 that are not even addressed with that converter. I will eventually create it once I get far enough into my Dekaron Client emulator that I can warrant creating those types of tools.
FattyB is offline  
Old 08/31/2010, 13:06   #8
 
elite*gold: 0
Join Date: Jun 2010
Posts: 24
Received Thanks: 1
lol.... i think i have solved!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

o my *** fuking!!!!!!!!!!!

OPERATION
use blender for import .mesh format
export on .3ds format
this program display .3ds format
this program can save .mesh format
the program read .3ds and .mesh format

now i try to insert in dekaron mesh the new .mesh file ^^

****!
i try the wings...
when i insert new .MESH wing (just equ not inv) i open the game client... but when at login i select the pg with wing in inventory the game crash =(((((

N.B.
old mesh file - 17kb
new mesh file - 33kb (but i not change the wing)

ah...
use blender for import .mesh format
export on .3ds format
this program display .3ds format
this program can save .mesh format
the program read .3ds and .mesh format

BLENDER NOT READ NEW .MESH FORMAT....!!!

help?
this problem can be solved... with patiente and try, try, and try!
malatoforte is offline  
Old 08/31/2010, 14:38   #9
 
elite*gold: 0
Join Date: Jul 2009
Posts: 29
Received Thanks: 8
The .mesh file in Dekaron is a propritary format. Unless you write the exporter, you will not get any program to magically export it correctly.

If you can find out how Blender stores its vertices and indices in its file, I can write an external c++ program to convert it over to .mesh, but like I said in my prior post, I do not have the time to write one specifically to plugin to blender. I will just use the raw Blender file.


EDIT
Never mind. Here is the file format. I will take a look at it and see if I can find the time to write a quick exporter. I am going to be gone on a 3 week vacation. I will see what I can do if I have internet.
FattyB is offline  
Old 08/31/2010, 20:40   #10
 
elite*gold: 0
Join Date: Aug 2010
Posts: 16
Received Thanks: 2
thx , this Tutorial is usefull xD
finally i edited .mesh , converted to .3d max ,
moved to Dekaron Mesh Conv and added to game ,
and WOOT
IT WORKS ,
i will make some .mesh weps and share them here .
[DEV]Seias is offline  
Thanks
1 User
Old 08/31/2010, 23:15   #11
 
elite*gold: 0
Join Date: Jun 2010
Posts: 24
Received Thanks: 1
wait... u tell me that u can insert .3d in dekaron mesh? how u can added in .3d?

just make file .txt in property?
malatoforte is offline  
Old 09/03/2010, 22:43   #12
 
-8gX's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 614
Received Thanks: 151
I love how no one here knows what they are doing except Fatty apparently.

@malatoforte - What you are trying to do has been attempted hundreds of times before by some of the best pserver devs out there. They couldn't do it and by you just opening and saving files that dont work; your lowering the entire IQ of this forum. Not trying to be rude, but reading this; it appears you dont have a clue what your attempting to do.

@Fatty - I attempted the exact project your working on with the .mesh exporter. The issue I was having is the encoding that dekaron.exe uses to read the .mesh file. Its easy enough to get all the vertices and stuff in the right order; but there is some sort of header file or encryption key which is used by dekaron.exe to ensure that the .mesh files cant be used elsewhere.

Good luck to all.
-8gX is offline  
Old 09/07/2010, 02:10   #13
 
elite*gold: 0
Join Date: Jul 2009
Posts: 29
Received Thanks: 8
Sorry guys I am in the middle of the Rocky Mountains with limited internet. The link below has some pictures of the Dekaron client emulator that I have been working on (about half way down the page).

As you can see I have the map, all object meshes, NPCs, and monsters on the map.

8gX
I am a little confused when you say "there is some sort of header file or encryption key." In the .mesh file depending what magic number the file starts with (its the first 4 bytes in the file), it will describe the vertices, indices, tangent (depending on magic number), vertex diffused color, texture coordinates, bone index, and bone blend weight with the last 2 used to place it on a skeleton for instance a wepaon in the players hand. Also it has what texture number to look up inside the texture pack. With those 2 files you can display any mesh in the game (if you program it of course). There is a little more to it, but those 2 file will display the mesh.

Explain what you are trying to accomplish and I will do my best to point you in the right direction. Did you change the vertices, put the file back in the game, and it didn't load it?
FattyB is offline  
Old 09/07/2010, 23:40   #14
 
-8gX's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 614
Received Thanks: 151
@FattyB-As far as I know the .mesh files are encrypted correct? Thats what the whole point of the python script is; to extract the vertices and index's from the .mesh file. Correct me if im wrong of course. Im saying that from my experience; in order to CREATE a .mesh file; you have to mimic the original encryption so that the dekaron.exe can read from it. I dont know how that operation is performed; whether its just a 'magic number' or something more advanced.
-8gX is offline  
Old 09/08/2010, 01:15   #15
 
elite*gold: 0
Join Date: Jul 2009
Posts: 29
Received Thanks: 8
Quote:
Originally Posted by -8gX View Post
@FattyB-As far as I know the .mesh files are encrypted correct? Thats what the whole point of the python script is; to extract the vertices and index's from the .mesh file. Correct me if im wrong of course. Im saying that from my experience; in order to CREATE a .mesh file; you have to mimic the original encryption so that the dekaron.exe can read from it. I dont know how that operation is performed; whether its just a 'magic number' or something more advanced.
Encryted, naw. Rearranged in a funky format yes. Well I guess you could call it encryption, but all they have done is rearrange the vertices by swaping every third vertex. Everything else it plain as day. When I get back from vacation I will wip up a tutorial and give a sample in c++ so that everyone can look at it more closely.
FattyB is offline  
Closed Thread


Similar Threads Similar Threads
How to open mesh file and anim file(dekaron).PLZ~
02/15/2010 - Dekaron Private Server - 11 Replies
How to open mesh file and anim file(dekaron).PLZ~
macking new mesh file
10/13/2009 - Dekaron Private Server - 22 Replies
wotking on some new weapons just cant figure out how to edit mesh and skel files or make new from scratch any help would be appreciated



All times are GMT +2. The time now is 03:19.


Powered by vBulletin®
Copyright ©2000 - 2024, 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.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.