What's new

Smash Bros Melee Model Viewer Status

FireandIce

New member
Mouser X said:
As for whether your request is against the rules or not, I kind of sort of think it might be, since the models are copywrited material. .

Then the whole thread would be against the rules, don't you think?

this is not a friendly forum though, don't expect to see me here again.
 

SarahHarp

New member
koss said:
ohhhh i see. in dolphin theres an option to dump textures, is that wat u do? oh and the metroid project ur doing, will soem files extensions be similar to ssbm extensions? good luck on that by the way.

I don't use dolphin do dump textures, I have a tex dumper for .datt files, but there is an image type that I haven't coded.
And no, SSBM and MP have no similar files, like say MarioSunshine and Windwaker do. Slightly similar yes, but the same? no.
 

mechakoopa

a.k.a. the DtTvB
Well, I wrote another small program that converts .obj file to .pov file.
Yeah, seems to be messy as before, but I also wrote a tool that helps me deleting that messy face groups.

Here is the result. Still a bit messy anyway.
Rendered with POV-Ray
View attachment 33712

Here is the code that converts the .obj file to .pov file:
PHP:
<?php

// << the DtTvB >>

// Here is the source file we will use.
$sourcefile = 'link.obj';
echo '<html>
<head><title>Convertor :P</title></head>
<body style="background: #fff; color: #000;">
<b>Loading file...</b>'; flush();

// Get the file data and open a file for writing.
$fd = file($sourcefile);
$fp = fopen($sourcefile . '.pov', 'w');
echo ' <b><u style="color: #f00;"><i>Finished!</i></u></b><br /><b>Scanning file for vertices and faces...</b>'; flush();

// Vertice data array, face data array, group data array.
$vdata = array();
$fdata = array();
$gdata = array();
$cgroup = 'Ungrouped';

// We need this variable to make sure it counts ids correctly.
$j = 0;
$k = array();
// Loop through each line of file.
foreach ($fd as $fl) {
	// Outdent each line, and split parameters with space.
	$fl_d = explode(' ', $fl_l = trim($fl));
	// Vertice?
	if ($fl_d[0] == 'v') {
		$vdata[$j++] = '        <' . $fl_d[1] . ', ' . $fl_d[2] . ', ' . $fl_d[3] . '>, // ' . $j;
	// Group?
	} elseif ($fl_d[0] == 'g') {
		$cgroup = $fl_d[1];
	// Face?
	} elseif ($fl_d[0] == 'f') {
		// Split it out, we need only vertice id.
		preg_match ('~^f (.+?)/(.+?)/(.+?) (.+?)/(.+?)/(.+?) (.+?)/(.+?)/(.+?)$~', $fl_l, $mats);
		// Wavefront vertice id starts with 1, POV-Ray starts with 0.
		$mats[1]--;
		$mats[4]--;
		$mats[7]--;
		// Search for group and add vertice
		if (!isset($gdata[$cgroup]))
			$gdata[$cgroup] = array();
		if (!isset($k[$cgroup]))
			$k[$cgroup] = 0;
		if (!isset($fdata[$cgroup]))
			$fdata[$cgroup] = array();
		$gdata[$cgroup][$k1 = $k[$cgroup]++] = $vdata[$mats[1]];
		$gdata[$cgroup][$k2 = $k[$cgroup]++] = $vdata[$mats[4]];
		$gdata[$cgroup][$k3 = $k[$cgroup]++] = $vdata[$mats[7]];
		$fdata[$cgroup][] = '        <' . $k1 . ', ' . $k2 . ', ' . $k3 . '>,';
	}
}

// Prepare the file.
$wdata = '// File: ' . $sourcefile . '
#version 3.6;
#include "colors.inc"

global_settings {
    assumed_gamma 1.0
}

camera {
    location <0.0, 25, -100.0>
    direction 1.5 * z
    right x * image_width / image_height
    look_at <0.0, 25,  0.0>
}

light_source {
    0
    color rgb 1
    translate <-30, 50, -150>
}
';
foreach ($gdata as $i => $cgroup) {
	$wdata .= '
// **************************
// ** Character Model Begin
// ** Group: ' . $i . '
// **************************
mesh2 {
    vertex_vectors {
        // ** Vertices **
        ' . count($cgroup) . '
' . implode("\r\n", $cgroup) . '
    }
    face_indices {
        // ** Faces **
        ' . count($fdata[$i]) . '
' . implode("\r\n", $fdata[$i]) . '
    }
    texture {
        pigment {
            color rgb 1
            // White Color by Default
        }
        finish {
            diffuse 0.8
            specular 1.0
            // This makes the model looks more glossy.
        }
    }                     
    rotate <-90, 0, 0>
}
';
}
echo ' <b><u style="color: #f00;"><i>Finished!</i></u></b><br /><b>Writing file...</b>'; flush();

// Write it, and close the filestream.
fwrite ($fp, $wdata);
fclose ($fp);

echo ' <b><u style="color: #f00;"><i>Finished!</i></u></b><br /><br /><i style="color: #999;">the DtTvB</i>
</body>
</html>'; flush();

// << the DtTvB >>

?>


SarahHarp said:
I don't use dolphin do dump textures, I have a tex dumper for .datt files, but there is an image type that I haven't coded.
Can you give me that program or give me some guide of dumping it?
 

koss

New member
mechakoopa that model looks alot better then wat i had ripped can u post a link to ur tools that deletes messy face groups. thanks

~Koss
 

SarahHarp

New member
It's interweaved with my viewer, so I'd have to work on pulling it out. There is documentation though on YAGCD about tpl files, and basicly smash bros uses these formats.
 

mechakoopa

a.k.a. the DtTvB
SarahHarp said:
There is documentation though on YAGCD about tpl files, and basicly smash bros uses these formats.
Thanks. Does the tpl data includes 00 20 AF 30 at the beginning of it also?



koss said:
mechakoopa that model looks alot better then wat i had ripped can u post a link to ur tools that deletes messy face groups. thanks

~Koss

OK, by the way, I said it just helps me delete it.
It makes a 3d wireframe and tell me the vertex number.
After that, I deleted some of face groups that have that vertex number.

It needs PHP and GD in order to run. (Ahh, PHP again! :p)

Here is the preview of it, click on it to enhuge. Right, the image itself was very huge.



Source Code:
PHP:
<?php

// << the DtTvB >>

// Here is the source file we use.
$sourcefile = 'link.obj';

// Get the file data and open a file for writing.
$fd = file($sourcefile);

// Prepare the array.
$vdata = array();
$fdata = array();

// We need this variable to make sure it counts vertice id correctly.
$j = 0;
// Loop through each line of file.
foreach ($fd as $i => $fl) {
	$fl_d = explode(' ', $fl_l = trim($fl));
	// Vertice?
	if ($fl_d[0] == 'v') {
		$vdata[$j++] = array('x' => $fl_d[1], 'y' => $fl_d[2], 'z' => $fl_d[3]);
	// Face?
	} elseif ($fl_d[0] == 'f') {
		// Split it out, we need only vertice id.
		preg_match ('~^f (.+?)/(.+?)/(.+?) (.+?)/(.+?)/(.+?) (.+?)/(.+?)/(.+?)$~', $fl_l, $mats);
		// Wavefront vertice id starts with 1, POV-Ray starts with 0.
		$mats[1]--;
		$mats[4]--;
		$mats[7]--;
		$fdata[] = array('f1' => $mats[1], 'f2' => $mats[4], 'f3' => $mats[7]);
	}
}

// Define sizes and other parameters.
$size = 3000;
$scale = 160;
$xoffset = $size / 2;
$yoffset = $size * 0.9;

// Create an image stream!
$im = imagecreatetruecolor($size, $size);
imagefill ($im, 0, 0, imagecolorexact($im, 240, 240, 240));
$linecolor = imagecolorexact($im, 0, 113, 188);
$textcolor = imagecolorexact($im, 0, 0, 0);

imageantialias ($im, false);
foreach ($fdata as $cf) {
	imageline ($im, $xoffset + ($vdata[$cf['f1']]['x'] * $scale), $yoffset - ($vdata[$cf['f1']]['z'] * $scale), $xoffset + ($vdata[$cf['f2']]['x'] * $scale), $yoffset - ($vdata[$cf['f2']]['z'] * $scale), $linecolor);
	imageline ($im, $xoffset + ($vdata[$cf['f2']]['x'] * $scale), $yoffset - ($vdata[$cf['f2']]['z'] * $scale), $xoffset + ($vdata[$cf['f3']]['x'] * $scale), $yoffset - ($vdata[$cf['f3']]['z'] * $scale), $linecolor);
	imageline ($im, $xoffset + ($vdata[$cf['f3']]['x'] * $scale), $yoffset - ($vdata[$cf['f3']]['z'] * $scale), $xoffset + ($vdata[$cf['f1']]['x'] * $scale), $yoffset - ($vdata[$cf['f1']]['z'] * $scale), $linecolor);
}
foreach ($vdata as $i => $cv) {
	imagestring ($im, 2, $xoffset + ($cv['x'] * $scale), $yoffset - (($cv['z'] * $scale)), $i, $textcolor);
}


header ('Content-Type: image/png');
imagepng ($im);

// << the DtTvB >>

?>
 

SarahHarp

New member
I don't think it starts with that..
In any case, it uses the same Image types described in there with the same Identifiers
 

mechakoopa

a.k.a. the DtTvB
SarahHarp said:
I don't think it starts with that..
In any case, it uses the same Image types described in there with the same Identifiers
Well, I think it is too hard for me. I don't even understand what is I4, I8, RGB565, what ever.

OT: In Dance Dance Revolution: Mario Mix, I see there are many .bin files in it. I can't open/decode/decompress/dump it with any tools. That file starts with | 00 00 00 01 | 00 00 00 08 | 00 08 08 AC | 00 00 00 07 |
Do you have any ideas on this?

ShizZy said:
PHP for this?! Weirdo
Yeah, it's strange, I use PHP to do most of tasks, as it have many, many features.
 

mechakoopa

a.k.a. the DtTvB
Well, abput the double post, I think you can click the edit button and click the delete button in the edit window.
Yeah, last time I entered the search term in the quick reply box instead of search box and pressed the "post quick reply" button. I was a bit blur.


Please be sure that GD library is allowed and libpng is installed.
This program needs it to display.

Here is an updated version with groupings enabled.
New features:
- Colors for each group.
- You can pass a parameter like ?start=0&end=10 to search in a group.
- Not well-documented.
PHP:
<?php

// << the DtTvB >>

// Here is the source file we use.
$sourcefile = 'link.obj';

// Get the file data and open a file for writing.
$fd = file($sourcefile);

// Prepare the array.
$vdata = array();
$fdata = array();
$gdata = array();
$cgroup = 'Ungrouped';

// We need this variable to make sure it counts vertice id correctly.
$j = 0;
// Loop through each line of file.
foreach ($fd as $i => $fl) {
	$fl_d = explode(' ', $fl_l = trim($fl));
	// Vertice?
	if ($fl_d[0] == 'v') {
		$vdata[++$j] = array('x' => $fl_d[1], 'y' => $fl_d[2], 'z' => $fl_d[3]);
	// Group
	} elseif ($fl_d[0] == 'g') {
		$cgroup = $fl_d[1];
	// Face?
	} elseif ($fl_d[0] == 'f') {
		// Split it out, we need only vertice id.
		preg_match ('~^f (.+?)/(.+?)/(.+?) (.+?)/(.+?)/(.+?) (.+?)/(.+?)/(.+?)$~', $fl_l, $mats);
		// Search for group and add vertice
		if (!isset($gdata[$cgroup]))
			$gdata[$cgroup] = array();
		if (!isset($k[$cgroup]))
			$k[$cgroup] = 0;
		if (!isset($fdata[$cgroup]))
			$fdata[$cgroup] = array();
		$gdata[$cgroup][$k1 = $k[$cgroup]++] = $mats[1];
		$gdata[$cgroup][$k2 = $k[$cgroup]++] = $mats[4];
		$gdata[$cgroup][$k3 = $k[$cgroup]++] = $mats[7];
		$fdata[$cgroup][] = array('f1' => $k1, 'f2' => $k2, 'f3' => $k3);
	}
}

// Define sizes and other parameters.
$size = 3000;
$scale = 160;
$xoffset = $size / 2;
$yoffset = $size * 0.9;

// Create an image stream!
$im = imagecreatetruecolor($size, $size);
imagefill ($im, 0, 0, imagecolorexact($im, 240, 240, 240));
$linecolor = imagecolorexact($im, 0, 113, 188);
$textcolor = imagecolorexact($im, 0, 0, 0);

imageantialias ($im, false);
$l = 0;
$m = 0;
$start = isset($_GET['start']) ? $_GET['start'] : 0;
$end = isset($_GET['end']) ? $_GET['end'] : count($gdata);
foreach ($gdata as $i => $cgroup) {
	if ($m++ < $start)
		continue;
	if ($m > $end)
		break;
	$ccolor = imagecolorexact($im, rand(50, 200), rand(50, 200), rand(50, 200));
	imagestring ($im, 3, 2, 2 + ($l++ * 15), $i, $ccolor);
	foreach ($fdata[$i] as $cf) {
		imageline ($im, $xoffset + ($vdata[$cgroup[$cf['f1']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f1']]]['z'] * $scale), $xoffset + ($vdata[$cgroup[$cf['f2']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f2']]]['z'] * $scale), $ccolor);
		imageline ($im, $xoffset + ($vdata[$cgroup[$cf['f2']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f2']]]['z'] * $scale), $xoffset + ($vdata[$cgroup[$cf['f3']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f3']]]['z'] * $scale), $ccolor);
		imageline ($im, $xoffset + ($vdata[$cgroup[$cf['f3']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f3']]]['z'] * $scale), $xoffset + ($vdata[$cgroup[$cf['f1']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f1']]]['z'] * $scale), $ccolor);
		imagestring ($im, 2, $xoffset + ($vdata[$cgroup[$cf['f1']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f1']]]['z'] * $scale), $cgroup[$cf['f1']], $textcolor);
		imagestring ($im, 2, $xoffset + ($vdata[$cgroup[$cf['f2']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f2']]]['z'] * $scale), $cgroup[$cf['f2']], $textcolor);
		imagestring ($im, 2, $xoffset + ($vdata[$cgroup[$cf['f3']]]['x'] * $scale), $yoffset - ($vdata[$cgroup[$cf['f3']]]['z'] * $scale), $cgroup[$cf['f3']], $textcolor);
	}
}
//foreach ($vdata as $i => $cv) {
	//imagestring ($im, 2, $xoffset + ($cv['x'] * $scale), $yoffset - (($cv['z'] * $scale)), $i, $textcolor);
//}


header ('Content-Type: image/png');
imagepng ($im);

// << the DtTvB >>

?>
 
Last edited:

mechakoopa

a.k.a. the DtTvB
I don't know, we still must wait for it to be released :).

Anyway, all the features I want is just to rip models and textures from it.
I can smooth or shade it later in 3ds max.
 

SarahHarp

New member
I havn't worked on my ssbm for quite a while. I don't think I really ever need to finish it either, seeing as the new "Directx Dumper" seems to do what mine already does.
 

Someone!

Hullo!
Well, Sarah, it would be better to have a Metroid Prime style viewer: Animations, bones and that kind of stuff...
I am not trying to push you, I am just telling what you could do to keep having one of the best projects ever on.
EDIT: I suck on english "philoshophy" like stuff...
 

mechakoopa

a.k.a. the DtTvB
I don't think so, as I have to waste many times ripping models with about 2 fps. And it's hard to find the model what I want as it takes me about 7 seconds to go through 1 throphy and 4 minutes to dump the model.

And also, your ripper is more proportional (for sure, I think).
 

psychodan

New member
Seems like alots happened around here, it's rather hard to keep up with using my mom's computer. What's this "Direct X Dumper" thing?

advmode1ms8.jpg


I've finished my MaxScript. It imports the Players, Trophies, Levels, and a few other things. If you look at the screenies, there are still a few glitches...

Has anyone made an extractor that works 100% yet? I haven't tested Jahra1n's so I don't know. When someone does, I'll release this so people can stick them in Max easier. I have partial bone support too on the player files but they don't seem to be attaching to the groups correctly.

advmodebc9.jpg

On another note, I'm currently working more on Super Mario Strikers. I've got some basic mesh data, but it mostly just explodes.
 
Last edited:

Top