What's new

Melee Arcive Viewer (MAV) in development project.

OP
Tcll

Tcll

Complexity == Fun >:3
KK...
maybe I'm wrong about that :/

int(off1+32) takes you to the bones...
this means it's a length value...

but it's the length of the verts, normals, and UV's combined

int(off2+32) takes you to the end of the first bone (from the start of the file)

so... yea... :p

to find the data length of off2:
off2 - off1 = length
 
Last edited:

GameWatching

New member
why char's vertexing not working for me @.@ ?

EDIT :
galp012.png


galp014.png


cube yoshi egg :bouncy:
 
Last edited:
OP
Tcll

Tcll

Complexity == Fun >:3
o_O

it may be the export script :/

I don't have it on hand...
gonna have to remake it :/

did you change the number at all??
should be 1000 if not
 
OP
Tcll

Tcll

Complexity == Fun >:3
Still a number of things to look into before it all works completely. Mainly dealing with joint/texture transforms and flags. Hope to have images with player and stage data visible after i fix some things. Will have to see how it goes.



how did you figure the uv's out D:>
I can't get them to work for crap

especially PL****.dat files
^the uv's seem to be compressed...

they import as a grid structure (shown below)...
and there's around a range of [500:600] less than what there should be :/
 

revel8n

New member
The UV data can be in a number of different formats from [un]signed bytes and short to full floats. There are also scale and offset values, the latter of which i have not found the flags for. The biggest problem will be the scale which is a power of 2 value to divide the the uv values by to get the actual range required. All of this information is found in the vertex attribute data mentioned before and listed in the template.
 
Last edited:
OP
Tcll

Tcll

Complexity == Fun >:3
ok...
a newer, near-flawless method for vertexing:
do the same as before basically...

the only flawless thing is the scripts:

anyways...
here's how to edit verts in blender:

copy the blue and the red data:
Qmf1GbavR81t56Paa2CByPvq6VMsjp8Uc1rjKivjDikEMw

the red is the extra bytes to fill the length between the offsets...
* and paste it in a new file...

now create a new document, and use hxd to paste your copied data.
(I like to crate txt files and rename them to dat files)

copy these scripts, and save them as 'import_vert.py' and 'export_vert.py'.
import:
Code:
#!BPY
""" 
Name: 'SSBM [v] (.dat)...'
Blender: 248
Group: 'Import'
Tooltip: 'Import a Melee model verts file (.dat)'
"""
__author__= ['Tcll']
__url__ = ("[URL]http://tcll5850.webfreehosting.net[/URL]")
__version__= '2.1b'
__bpydoc__= '''\
SSBM dat (vert) Importer
'''
# Importing modules
import struct as S , Blender
def import_dat(path):
    Blender.Window.WaitCursor(1)
    name = path.split('\\')[-1].split('/')[-1]
    mesh = Blender.NMesh.New( name )
 
    file = open(path, 'rb')
    def vec(): return S.unpack('>h', file.read(2) )[0]*0.0001
    a = 0
    while(a==0):
        x, y, z = vec(), vec(), vec()
        if (x == 0.0 and y == 0.0 and z == 0.0): a = 1
        mesh.verts.append(Blender.NMesh.Vert(x, y, z))
    ob = Blender.Object.New('Mesh', name)
    ob.link(mesh)
    scn = Blender.Scene.GetCurrent()
    for o in scn.getChildren(): o.sel = 0
    scn.link(ob)
    ob.sel= 1
    ob.Layers = scn.Layers
    Blender.Window.WaitCursor(0)
    Blender.Window.RedrawAll()
 
Blender.Window.FileSelector(import_dat, 'Import')

export:
Code:
#!BPY
""" 
Name: 'SSBM [v] (.dat)...'
Blender: 248
Group: 'Export'
Tooltip: 'Export a Melee model verts file (.dat)'
"""
__author__= ['Tcll']
__url__ = ("[URL]http://tcll5850.webfreehosting.net[/URL]")
__version__= '1.5a'
__bpydoc__= '''\
SSBM dat (vert) Exporter
'''
import Blender, bpy, struct as S
def vec(this): return S.pack(">h", this*10000.01)
def write_dat(path):
    dat = file(path, 'wb')
    sce = bpy.data.scenes.active
    ob = sce.objects.active
    mesh = ob.getData(mesh=1)
    for vert in mesh.verts:
        x,y,z = vert.co.x,vert.co.y,vert.co.z
        dat.write(vec(x)+vec(y)+vec(z))
    dat.close()
Blender.Window.FileSelector(write_dat, "Export")

place these in C:/Pfogram Files/Blender Foundation/blender/.blender/scripts/*

^if that directory is not there,
re-install blender, but choose the 2nd option before clicking finish, or whatever... :p

you can use the drop down import and export menus to work with your file...

to replace, simply paste your exported data over the original data. :)
(be sure to keep length in mind though, or else you'll break your file)
 
Last edited:
OP
Tcll

Tcll

Complexity == Fun >:3
The UV data can be in a number of different formats from [un]signed bytes and short to full floats. There are also scale and offset values, the latter of which i have not found the flags for. The biggest problem will be the scale which is a power of 2 value to divide the the uv values by to get the actual range required. All of this information is found in the vertex attribute data mentioned before and listed in the template.

vertex attribute data...
wait...
what post was that now??

and I can't understand your script...
I fail that badly I guess :(

but you've told me quite a bit in that little amount of time :D
thanx :)
 
Last edited:
OP
Tcll

Tcll

Complexity == Fun >:3
KK...

I've looked again and actually managed to find something...

// vertex declaration and attribute information
// attr, type, cnt, data_type, flags?, file_offset
struct ATTR_DATA
{
// 0x00
uint32 vtxAttr; // attr
uint32 vtxAttrType; // index_type
uint32 compCnt; // cnt
uint32 compType; // data_type
// 0x10
uint16 unknown0x10;
uint16 vtxStride;
uint32 dataOffset <format = hex>; // data offset
};

so at what offset is that located??
just after the header?? or no??
 

Myuutsuu

forever.
Umm, just real quick, Tcll, what exactly do you edit the stuff in? What program to see the vertex models? :U

Also,

verts.jpg


the first half has offsets
00000000
00000010
00000020
etc.
which is fine, but the second half says
00012336
00012352
00012368
etc.
How did you do that ?
 
Last edited:
OP
Tcll

Tcll

Complexity == Fun >:3
uhh... oops :p

hang on... fixing that now :)

EDIT:
and what's up with those numbers now??

if they're not compairing like they should,
edit the number '10000.01' in the script
(play with the number of 0's) until it works right :/

didn't think it'd be doing that so soon :/

EDIT2:

oh... nvm... XDD

you ment the image :p

I just took 2 print-screens and edited them together...
then drew a red line :p

simple really :D
 
Last edited:

Myuutsuu

forever.
LOL, But I mean, I don't see that data at offset 00012656. I see something completely different. Was it adjusted differently or something? I see data like that at offset 0003xxx instead........ Confusing. D:
 
OP
Tcll

Tcll

Complexity == Fun >:3
unless you're using PlPkNr.dat,
it most likely won't be at the same offset...

you have to find where the data changes from verts to normals...
(that won't always end at that offset)

EDIT:

didn't realize I copied that 2nd part viewing in dec instead of hex...
offset: 00003170

oops :p
 
Last edited:

Myuutsuu

forever.
Okay.
So I installed Blender.
I installed Python 2.6.
Put the import_vert and export_vert into the Blender scripts folder.
Opened PlPkNr.dat in HxD.
Copied from offsets 0x20 to 0x3170.
Created a new .DAT file containing this info.
This is what I got:

pikachwhat.png


:?

EDIT: oh, NOW you tell me. XD
Nooo wait, still looks the same. )X

I'm supposed to "Import" the .DAT file, yes?
 
Last edited:
OP
Tcll

Tcll

Complexity == Fun >:3
nope :)
there's nothing wrong there.

that's what it's supposed to look like (vert wise)

and you did everything right ;)

tip:
hide the verts you don't want to edit (in edit mode) using 'H'
and use 'Alt+H' to unhide :D

EDIT:
once the relocation table is figured out entirely, I'll post my converter which will manipulate the verts by the groups connected to the bones...
alot of stuff to explain there :p

but yea...
I mean my 'dat to dae' converter

dae supports bones and such...
and it's in XML style coding :D
^very easy to work with :)

I'm gonna try to get materials as well :/

here's a list of stuff to be converted (in order):

verts
normals
uv's
bones
faces
groups (goes with faces)
materials
textures

and possibly shaders
^actually yes...
Pikachu has differant eye textures access by the same object through shaders.
 
Last edited:

GameWatching

New member
can't wait to try out this new method o_O

i know that most of the characters can be vertex'd thu

EDIT :
the problem is that i know nothing in blender ;_;

how can i export it to .dat ?
how can i edit verts DX ?

make a tutorial plz D:
 
Last edited:
OP
Tcll

Tcll

Complexity == Fun >:3
just export after editing
(use the 'Export' menu)

be sure to type the '.dat' part though...

I have a prob with getting blender to do that automatically :/
 

Myuutsuu

forever.
how can i edit verts DX ?

That's my only problem as well. I have no idea what I'm doing when I'm in blender; can't select any of the dots, can't erase any of the dots, nothin'. XD If there are instructions, I must've missed them....

Buuut anywho, in regards to the earlier post,

KK...

I've looked again and actually managed to find something...

// vertex declaration and attribute information
// attr, type, cnt, data_type, flags?, file_offset
struct ATTR_DATA
{
// 0x00
uint32 vtxAttr; // attr
uint32 vtxAttrType; // index_type
uint32 compCnt; // cnt
uint32 compType; // data_type
// 0x10
uint16 unknown0x10;
uint16 vtxStride;
uint32 dataOffset <format = hex>; // data offset
};

so at what offset is that located??
just after the header?? or no??

This stuff may be way over my head, but from what I see there, the first part is apparently at offset 00000000, and the second part at 00000010. Just an uneducated guess, though.
 

Top