ArtStation files

Post questions about game models here, or help out others!
Post Reply
Karric
beginner
Posts: 30
Joined: Fri Aug 28, 2015 12:20 am
Has thanked: 6 times

Re: ArtStation files

Post by Karric » Mon Mar 07, 2016 12:34 am

Any progress on compressed files? I see more and more of them...

User avatar
TaylorMouse
ultra-veteran
ultra-veteran
Posts: 367
Joined: Mon Sep 26, 2011 12:51 pm
Has thanked: 13 times
Been thanked: 125 times

Re: ArtStation files

Post by TaylorMouse » Wed Mar 23, 2016 9:41 pm

Sorry, no time atm, decoding Strife models viewtopic.php?f=16&t=14089&p=116985#p116985



T.

riotbreak
ultra-n00b
Posts: 1
Joined: Sun May 15, 2016 8:01 am
Has thanked: 1 time

Re: ArtStation files

Post by riotbreak » Sun May 15, 2016 9:33 am

TaylorMouse, thank you so much!!! you are a genius!

fadedglory
ultra-n00b
Posts: 9
Joined: Wed Nov 11, 2015 10:51 pm

Re: ArtStation files

Post by fadedglory » Fri May 20, 2016 4:47 pm

Can someone help me with this file? When I run the script I get a bunch of junk. I've had success with other files.

https://www.artstation.com/embed/2189600

decomon
ultra-n00b
Posts: 3
Joined: Sun May 22, 2016 2:50 pm

Re: ArtStation files

Post by decomon » Sun May 22, 2016 4:03 pm

Is there a way to get the exact same topology meant by the author? When I import in Modo, everything is triangulated, not the best thing if you want to study topology. Thanks for the amazing tool anyway.

Karric
beginner
Posts: 30
Joined: Fri Aug 28, 2015 12:20 am
Has thanked: 6 times

Re: ArtStation files

Post by Karric » Mon May 23, 2016 1:31 pm

decomon wrote:Is there a way to get the exact same topology meant by the author? When I import in Modo, everything is triangulated, not the best thing if you want to study topology. Thanks for the amazing tool anyway.
Some modellers break quads into tris at the end since it strengthens curves and there's some other benefits with render engines.

decomon
ultra-n00b
Posts: 3
Joined: Sun May 22, 2016 2:50 pm

Re: ArtStation files

Post by decomon » Tue May 24, 2016 3:16 pm

If I find a model visualized in tris, it's triangulated and there's nothing more to say. Sometimes it's possible to find models made with quads (and some triangles). I wanted to know if there's a way to get the model exactly the way it is visualized (thus, sometimes, meaning in quads).

slowerthanlight
ultra-n00b
Posts: 2
Joined: Thu Jun 09, 2016 12:02 pm
Been thanked: 9 times

Re: ArtStation files

Post by slowerthanlight » Thu Jun 09, 2016 12:10 pm

Hi,

since the thread was quite helpful I would like to give back a few pieces.

1. Decompression

Files in .mview are sometimes compressed using a custom scheme.

I don't know Maxscript so I left this as a Javascript (NodeJS) code.

Code: Select all

decompress = function(a, b) {
    var c = new Uint8Array(b)
      , d = 0
      , e = new Uint32Array(4096)
      , f = new Uint32Array(4096)
      , g = 256
      , h = a.length
      , k = 0
      , l = 1
      , m = 0
      , n = 1;
    c[d++] = a[0];
    for (var r = 1; ; r++) {
        n = r + (r >> 1);
        if (n + 1 >= h)
            break;
        var m = a[n + 1]
          , n = a[n]
          , p = r & 1 ? m << 4 | n >> 4 : (m & 15) << 8 | n;
        if (p < g)
            if (256 > p)
                m = d,
                n = 1,
                c[d++] = p;
            else
                for (var m = d, n = f[p], p = e[p], q = p + n; p < q; )
                    c[d++] = c[p++];
        else if (p == g) {
            m = d;
            n = l + 1;
            p = k;
            for (q = k + l; p < q; )
                c[d++] = c[p++];
            c[d++] = c[k]
        } else
            break;
        e[g] = k;
        f[g++] = l + 1;
        k = m;
        l = n;
        g = 4096 <= g ? 256 : g
    }
    return d == b ? c : null
}

var fs = require("fs");

var filesrc = process.argv[2];
var filedst = process.argv[3];
var n_cmp = process.argv[4] * 1;
var n_unc = process.argv[5] * 1;

fs.readFile(filesrc, function (err, data) {
    if (err) throw err;

    if (n_cmp != data.length)
      throw "Wrong input size";

    var deco = decompress(data, n_unc);

    if (n_unc != deco.length)
      throw "Wrong output size";

    fs.writeFile(filedst, new Buffer(deco), function(err) {
      if(err) {
          return console.log(err);
      }
  }); 
});
If you have mesh0.dat with two sizes: 10000 (compressed) and 20000 (uncompressed), run this like

Code: Select all

node decompress.js mesh0.dat mesh0_uncompressed.dat 10000 20000
It works for all compressed files (skies etc).

2. Vertex format

Parsing the file as 7x float + 4x byte is usually incorrect.

The default Marmoset format is:

position - 3x float
uv - 2x float
tangent - 2x short
bitangent - 2x short
normal - 2x short

Optionally there is also second UV (2x float) and/or vertex color (4x byte).

Also, tangents/bitangents/normals are encoded. To decode them you need to convert short to normalized float first (so 0...65535 is mapped to 0...1) and then implement a following function:

Code: Select all

vec3 hm(vec2 hn)
{
    bool ho = (hn.y > (32767.1 / 65535.0));
    hn.y = ho ? (hn.y - (32768.0 / 65535.0)) : hn.y;
    vec3 r;
    r.xy = (2.0 * 65535.0 / 32767.0) * hn - vec2(1.0);
    r.z = sqrt(clamp(1.0 - dot(r.xy, r.xy), 0.0, 1.0));
    r.z = ho ? -r.z : r.z;
    return r;
}
This is GLSL code so you need to rewrite that to Maxscript as well.

3. Triangles/quads

Models on Artstation use triangles exclusively. All polys/quads are broken into tris because that is how GPUs work.

What you see on Artstation website as quads is coming from separate wireframe rendering data. It seems that some exporters use original mesh layout to produce wireframes before breaking all polys into tris. The wire buffer is the chunk of index data between the proper index buffer and vertex buffer.

In theory it could be used to rebuild the original mesh layout, but it's quite complicated and your 3D app (Max, Blender etc) should be able to do it on its own.

Hopefully this will help you with remaining features.

Karric
beginner
Posts: 30
Joined: Fri Aug 28, 2015 12:20 am
Has thanked: 6 times

Re: ArtStation files

Post by Karric » Sat Jun 11, 2016 11:29 pm

@Slowerthanlight — That's really cool that you've figured this out, but how do we know the uncompressed size?

slowerthanlight
ultra-n00b
Posts: 2
Joined: Thu Jun 09, 2016 12:02 pm
Been thanked: 9 times

Re: ArtStation files

Post by slowerthanlight » Mon Jun 13, 2016 10:10 am

So for the extraction phase you posted this code:

Code: Select all

                    var str1 = br.ReadStringZeroEnded();
                    var str2 = br.ReadStringZeroEnded();
                    var zero = br.ReadUInt32();
                    var len = br.ReadUInt32();
                    var len2 = br.ReadUInt32(); // len and len2 are always the same length :/
Actually, the "zero" is not always zero. It's a flag bitset where 1 means the file is compressed and 2 means that it is the last file (however the Marmoset viewer only uses the "1" flag).
So you can add test like

Code: Select all

bool isCompressed = zero & 1;
Also, "len" and "len2" won't be equal for compressed files. "len" is the compressed size, and "len2" is the uncompressed size.

ravenov
beginner
Posts: 27
Joined: Wed Mar 23, 2016 8:59 pm
Has thanked: 32 times
Been thanked: 4 times

Re: ArtStation files

Post by ravenov » Thu Jun 23, 2016 4:40 pm

hi guys, no tool posted for the compressed ones ?, bcs TaylorMouse is not responding !, hope someone can help to unpack this one, i unpacked it but no .OBJ files on result !!!
https://www.artstation.com/artwork/042eV :scaredy:

borisquezadaa
beginner
Posts: 23
Joined: Fri Aug 07, 2015 3:54 am
Has thanked: 4 times
Been thanked: 7 times

Re: ArtStation files

Post by borisquezadaa » Tue Jun 28, 2016 3:02 pm

Grabb
ravenov wrote:hi guys, no tool posted for the compressed ones ?, bcs TaylorMouse is not responding !, hope someone can help to unpack this one, i unpacked it but no .OBJ files on result !!!
https://www.artstation.com/artwork/042eV :scaredy:
Grab it from here:
http://www.mediafire.com/download/i3mon ... 6/sa80.zip

ravenov
beginner
Posts: 27
Joined: Wed Mar 23, 2016 8:59 pm
Has thanked: 32 times
Been thanked: 4 times

Re: ArtStation files

Post by ravenov » Tue Jun 28, 2016 9:19 pm

borisquezadaa wrote:Grabb
ravenov wrote:hi guys, no tool posted for the compressed ones ?, bcs TaylorMouse is not responding !, hope someone can help to unpack this one, i unpacked it but no .OBJ files on result !!!
https://www.artstation.com/artwork/042eV :scaredy:
Grab it from here:
http://www.mediafire.com/download/i3mon ... 6/sa80.zip
thanks dude, can you sand me the tool pls...

soulbrother73
n00b
Posts: 11
Joined: Sun Jan 24, 2016 12:47 pm
Been thanked: 2 times

Re: ArtStation files

Post by soulbrother73 » Wed Jun 29, 2016 2:38 pm

Hello , ninja ripper works fine for me for most models , except for some sketchfab models.
The uv's are hard to figure out , so if anyone could lend me an experienced hand and test these out and let me know what settings you use on ninja ripper imorter i. I would be very greatful . Thanks in advance .

http://www.mediafire.com/download/dtprp ... rmlord.rar

http://www.mediafire.com/download/5kwrm ... inel+2.rar

joeyq
beginner
Posts: 21
Joined: Tue Jan 19, 2010 11:14 am
Has thanked: 1 time
Been thanked: 3 times

Re: ArtStation files

Post by joeyq » Sun Jul 03, 2016 6:35 pm

I'm trying to use ninja ripper on this model https://www.artstation.com/artwork/8bEXO but getting 1kb files.
Can anybody help or give a few pointers to what settings to use?

Post Reply