XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Mon Aug 21, 2017 2:56 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 133 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9  Next
Author Message
 Post subject: Re: ArtStation files
PostPosted: Mon Mar 07, 2016 12:34 am 
Offline
beginner

Joined: Fri Aug 28, 2015 12:20 am
Posts: 30
Has thanked: 6 times
Have thanks: 0 time

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

You can make the ads go away by registering



Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Wed Mar 23, 2016 9:41 pm 
Offline
ultra-veteran
ultra-veteran
User avatar

Joined: Mon Sep 26, 2011 12:51 pm
Posts: 336
Has thanked: 12 times
Have thanks: 115 times
Sorry, no time atm, decoding Strife models http://forum.xentax.com/viewtopic.php?f=16&t=14089&p=116985#p116985



T.

_________________
My Game Dev Blog
My Starcraft II Mod files and scripts


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Sun May 15, 2016 9:33 am 
Offline
ultra-n00b

Joined: Sun May 15, 2016 8:01 am
Posts: 1
Has thanked: 1 time
Have thanks: 0 time
TaylorMouse, thank you so much!!! you are a genius!


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Fri May 20, 2016 4:47 pm 
Offline
ultra-n00b

Joined: Wed Nov 11, 2015 10:51 pm
Posts: 9
Has thanked: 0 time
Have thanks: 0 time
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


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Sun May 22, 2016 4:03 pm 
Offline
ultra-n00b

Joined: Sun May 22, 2016 2:50 pm
Posts: 3
Has thanked: 0 time
Have thanks: 0 time
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.


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Mon May 23, 2016 1:31 pm 
Offline
beginner

Joined: Fri Aug 28, 2015 12:20 am
Posts: 30
Has thanked: 6 times
Have thanks: 0 time
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.


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Tue May 24, 2016 3:16 pm 
Offline
ultra-n00b

Joined: Sun May 22, 2016 2:50 pm
Posts: 3
Has thanked: 0 time
Have thanks: 0 time
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).


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Thu Jun 09, 2016 12:10 pm 
Offline
ultra-n00b

Joined: Thu Jun 09, 2016 12:02 pm
Posts: 2
Has thanked: 0 time
Have thanks: 9 times
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:
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:
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:
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.


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Sat Jun 11, 2016 11:29 pm 
Offline
beginner

Joined: Fri Aug 28, 2015 12:20 am
Posts: 30
Has thanked: 6 times
Have thanks: 0 time
@Slowerthanlight — That's really cool that you've figured this out, but how do we know the uncompressed size?


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Mon Jun 13, 2016 10:10 am 
Offline
ultra-n00b

Joined: Thu Jun 09, 2016 12:02 pm
Posts: 2
Has thanked: 0 time
Have thanks: 9 times
So for the extraction phase you posted this code:

Code:
                    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:
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.


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Thu Jun 23, 2016 4:40 pm 
Offline
beginner

Joined: Wed Mar 23, 2016 8:59 pm
Posts: 25
Has thanked: 32 times
Have thanks: 4 times
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:


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Tue Jun 28, 2016 3:02 pm 
Offline
beginner

Joined: Fri Aug 07, 2015 3:54 am
Posts: 23
Has thanked: 4 times
Have thanks: 7 times
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


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Tue Jun 28, 2016 9:19 pm 
Offline
beginner

Joined: Wed Mar 23, 2016 8:59 pm
Posts: 25
Has thanked: 32 times
Have thanks: 4 times
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...


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Wed Jun 29, 2016 2:38 pm 
Offline
ultra-n00b

Joined: Sun Jan 24, 2016 12:47 pm
Posts: 6
Has thanked: 0 time
Have thanks: 2 times
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


Top
 Profile  
 
 Post subject: Re: ArtStation files
PostPosted: Sun Jul 03, 2016 6:35 pm 
Offline
n00b

Joined: Tue Jan 19, 2010 11:14 am
Posts: 18
Has thanked: 1 time
Have thanks: 1 time
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?



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 133 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group