magnum wrote:The EMO script (which btw is in Perl, not Python) spits out a *_data.txt file that shows almost the entire data dump for the file. There's 7 numbers that I can't figure out what are for, and is holding back model importing (from what I remember, when I tried modifying them, it crashed the game). It's the 3 unknown floats and the 4 chars (3 of which seems to always have the same value, and the 4th which is always 255).
An interesting thing to note is that the first 3 floats all change in increments of 1/255 (and range from -1 to 1), so I wonder if they're some how related to the chars.
I'll have to double check the crashing part, because I tried that in my early days of trying to modify the files, and maybe the crash was actually due to something else...
I think there is a little missinterpretation in your script, when 64 byts long a vertex is not
x, y, z, nx, ny, nz, u, v, ...
Code: Select all
my @node_weights;
for( 0..$vertexblockcount-1 ) {
my @floats;
if( $vertexblocksize == 64 ) {
@floats = readu( $INPUT, "f11", 44 );
my @v_uc = ($floats[6],-$floats[7]);
my @v_xyz = (-$floats[0],$floats[2],$floats[1]);
my @v_normal = (-$floats[3],$floats[5],$floats[4]);
push( @uv, \@v_uc );
push( @xyz, \@v_xyz );
push( @normal, \@v_normal );
} elsif( $vertexblocksize == 32 ) { # used in skeleton EMO files
Instead you have : x, y, z, tx, ty, tz, u, v, nx, ny, nz, a, w1, w2, w3, w4
where (tx, ty, tz) is the vertex tangent for normal mapping (see viewer release v0.31) and a is a precomputed static ambiant occlusion factor (to be interpreted as a diffuse color):
Code: Select all
my @node_weights;
for( 0..$vertexblockcount-1 ) {
my @floats;
if( $vertexblocksize == 64 ) {
@floats = readu( $INPUT, "f11", 44 );
my @v_uc = ($floats[6],-$floats[7]);
my @v_xyz = (-$floats[0],$floats[2],$floats[1]);
my @v_tangent = ($floats[3],$floats[4],$floats[5]);
my @v_normal = ($floats[8],$floats[9],$floats[10]);
push( @uv, \@v_uc );
push( @xyz, \@v_xyz );
push( @normal, \@v_normal );
} elsif( $vertexblocksize == 32 ) { # used in skeleton EMO files