Important information: this site is currently scheduled to go offline indefinitely by end of the year.

2022 - Tom Clancy's Rainbow Six: Siege Asset Extraction Tools

Post questions about game models here, or help out others!
Tushkan
veteran
Posts: 106
Joined: Mon Dec 18, 2017 1:47 pm
Has thanked: 2 times
Been thanked: 39 times

Re: Rainbow Six: Siege Models Thread

Post by Tushkan »

IF you use my uid then it should work fine. When you first ran dump_asset, it should have created a 'cache' folder next to it. DO you have it? My only guess is cache didn't initialize properly so it can't find links.

Also I have updated tool to be a little bit more verbose and fixed a couple issues other people found out plus added textures from example. Update is available by the same link.
Rainbow 6 Siege forge unpacking tool:
https://www.dropbox.com/sh/b2cuse4hp90y ... qTfja?dl=0
Custard
advanced
Posts: 65
Joined: Fri Oct 25, 2019 12:33 am
Has thanked: 11 times
Been thanked: 14 times

Re: Rainbow Six: Siege Models Thread

Post by Custard »

Yes I had the same error, two lines near the start of dump_asset.py seemed like the solution:

Code: Select all

import r6s
import os
import sys
import pathlib as pth
import r6s.collector
import json


DUMP_PATH = (pth.Path.cwd() / './assets').resolve()
idir = pth.Path(r6s.settings.IMPORT)
data = r6s.collector.SiegeLinksData()
# data = r6s.collector.SiegeLinksData(load=False); data.generate()

#UID = 220652921502  # caveira head FaZe diffuse texture uid
UID = 220652921502
I made it like this instead (swapped which one was commented out):

Code: Select all

# data = r6s.collector.SiegeLinksData()
data = r6s.collector.SiegeLinksData(load=False); data.generate()
It's been scanning for a while now, which seems closer to expectation.

I have the texture4.forges on account of having downloaded the ultra texture pack, I'll see about sharing the magic number for those when I can.

Btw is the binutils.py a dependancy? I threw it in there to begin with, thinking you might have meant that instead of binstream.py, however the script wasn't happy when I then removed it after the correction, so I'm still using it, as is Jake. However it's gone off the Dropbox.
Tushkan
veteran
Posts: 106
Joined: Mon Dec 18, 2017 1:47 pm
Has thanked: 2 times
Been thanked: 39 times

Re: Rainbow Six: Siege Models Thread

Post by Tushkan »

You need to generate cache once. Then revert code back so you don't have to wait so long each time you fire a script. binutils is a redundant dependency. I've updated the tool again, you can redownload it. Of just go to r6s/forge.py and comment out the `from binutils import phex` line. It's never used, just a leftover garbage.
Rainbow 6 Siege forge unpacking tool:
https://www.dropbox.com/sh/b2cuse4hp90y ... qTfja?dl=0
Custard
advanced
Posts: 65
Joined: Fri Oct 25, 2019 12:33 am
Has thanked: 11 times
Been thanked: 14 times

Re: Rainbow Six: Siege Models Thread

Post by Custard »

Would you say it's normal if this cache generation were to take, say, days to complete?

Mine seems to be running through alphabetically, same order I see the forges in the game directory, it ran through datapc64 in seconds, the next ones a bit longer, then it's doing the first meshshape.forge for nearly 4 hours now, getting slower and slower.

Edit: A restart seems to have affected it, it's gone past that file within a few minutes now.
Tushkan
veteran
Posts: 106
Joined: Mon Dec 18, 2017 1:47 pm
Has thanked: 2 times
Been thanked: 39 times

Re: Rainbow Six: Siege Models Thread

Post by Tushkan »

On my machine cache is generated within 1-2 minutes. If it goes longer - something went wrong. But I need statistics to find what exactly went wrong. If restart solved your problem then fine. I had links compile exponentially longer over tine but I since modified code to make it faster. So if it goes for an hour or longer - let me know, I might include my prebaked cache in next release.
Rainbow 6 Siege forge unpacking tool:
https://www.dropbox.com/sh/b2cuse4hp90y ... qTfja?dl=0
JakeMiles
advanced
Posts: 53
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 27 times
Been thanked: 5 times

Re: Rainbow Six: Siege Models Thread

Post by JakeMiles »

Thanks Custard! Swap code start generating cache, now when i execute dump asset it create folder asset :)
@Custard how about 4K textures do you get result?
JakeMiles
advanced
Posts: 53
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 27 times
Been thanked: 5 times

Re: Rainbow Six: Siege Models Thread

Post by JakeMiles »

I've check r6s\mesh\__init__.py and in line 201

Code: Select all

self.x2C = ruint32(r)  # [0x2C] = 1(animated/interactive?),
        # 2(map props?), 8(some bosses, some hands), 9, 10(some weapons)
in roam_meshes.py i did this:

Code: Select all

                    mesh.x2C not in (9,10)  # see r6s.mesh.Mesh.x2C
                   # mesh.num_verts < 100
When i edit it like this:

Code: Select all

mesh.x2C not in (1)  # see r6s.mesh.Mesh.x2C
it gives me a error:

Code: Select all

 mesh.x2C not in (1)  # see r6s.mesh.Mesh.x2C
TypeError: argument of type 'int' is not iterable
If i unredstand, i can't point of type of mesh like that, this need do in different code.
P.S. That becouse i think if i set high poly count and serch mesh by poly (maybe 2000) I may skip some low poly meshes like eyes etc.
P.P.S. Or you may give a sample how to search characters right, please [roll].
P.P.P.S. One question: Do you plan map export or just get coord of meshes on map without brushes (ingame geometry created by engine editor, like floor, walls etc.)?
Tushkan
veteran
Posts: 106
Joined: Mon Dec 18, 2017 1:47 pm
Has thanked: 2 times
Been thanked: 39 times

Re: Rainbow Six: Siege Models Thread

Post by Tushkan »

In python brackets mean either tuple (an iterable non mutable list) or execution grouping. (1,2) is a tuple, while (1+5) or (a==b) or simply (1) is a group. To nake it a tuple, add a comma like this (1,). Or even better, simply do x2C == 1
Rainbow 6 Siege forge unpacking tool:
https://www.dropbox.com/sh/b2cuse4hp90y ... qTfja?dl=0
JakeMiles
advanced
Posts: 53
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 27 times
Been thanked: 5 times

Re: Rainbow Six: Siege Models Thread

Post by JakeMiles »

Thanks for tip i'll try it, not have knowbledge in python
Tushkan
veteran
Posts: 106
Joined: Mon Dec 18, 2017 1:47 pm
Has thanked: 2 times
Been thanked: 39 times

Re: Rainbow Six: Siege Models Thread

Post by Tushkan »

Well then you should definitely read some tuts about it ) It's not that hard though sometimes it has it's peculiarities that aren't immediately apparent.
On map export: I don't plan to invest much time in maps. My personal goal is to rip characters with skeletons and skinning. Everything else is of less priority. If anyone is willing to reverse it himself he can ping me for some guidance.
Rainbow 6 Siege forge unpacking tool:
https://www.dropbox.com/sh/b2cuse4hp90y ... qTfja?dl=0
JakeMiles
advanced
Posts: 53
Joined: Wed Aug 12, 2015 11:59 pm
Has thanked: 27 times
Been thanked: 5 times

Re: Rainbow Six: Siege Models Thread

Post by JakeMiles »

If i can call it bug report, what a get:

Code: Select all

    
    3812: 299062604030
    3817: 299062606425
    3824: 299062693146
    3839: 309301408753
    3844: 309301409215
    3852: 309301491241
    4016: 22439860332
Traceback (most recent call last):
  File "E:\SiegeUnpack\Tools\scripts\roam_meshes_chara.py", line 37, in <module>
    with r6s.mesh.Mesh(c.file.getstream(), readmesh=False) as mesh:
  File "E:\SiegeUnpack\Tools\r6s\mesh\__init__.py", line 238, in __init__
    IslandSkinMapping.parse(r) for _ in range(self.num_islands)
  File "E:\SiegeUnpack\Tools\r6s\mesh\__init__.py", line 238, in <listcomp>
    IslandSkinMapping.parse(r) for _ in range(self.num_islands)
  File "E:\SiegeUnpack\Tools\r6s\mesh\__init__.py", line 134, in parse
    self.x108 = ruint32(r)
  File "E:\SiegeUnpack\Tools\binstream.py", line 34, in ruint32
    return upk('I', r.read(4))[0]
struct.error: unpack requires a buffer of 4 bytes

E:\SiegeUnpack\Tools\scripts>
Edited Roam_Meshes.py:

Code: Select all

stop=10000
mesh.num_verts < 20000
Nothing more changes, just a bug report.

Can it be a error because nothing found or end of loop, forge file etc.?
Tushkan
veteran
Posts: 106
Joined: Mon Dec 18, 2017 1:47 pm
Has thanked: 2 times
Been thanked: 39 times

Re: Rainbow Six: Siege Models Thread

Post by Tushkan »

Your script is perfectly fine. It's an issue with my code. Some meshes aren't deserialized properly and lead to an exception. Can be avoided by using try-catch block.
I've updated the script with such block. It will spit out the error message and continue running.
Rainbow 6 Siege forge unpacking tool:
https://www.dropbox.com/sh/b2cuse4hp90y ... qTfja?dl=0
gep55
veteran
Posts: 81
Joined: Fri Feb 01, 2019 2:33 pm
Has thanked: 16 times
Been thanked: 5 times

Re: Rainbow Six: Siege Models Thread

Post by gep55 »

Thanks for this, it's really cool :)

I've really been wanting to port some characters from this game for a while, so I have a few questions.

Firstly, what is the best place to buy the game?

Secondly, If I buy the game, where can I buy the operator skins (e.g. hibana's elite skin, iana..), or are they already included in the game files, and buying them just unlocks them for gameplay. Are any of the skins not available anymore since they were limited releases?

Cheers :D
Tushkan
veteran
Posts: 106
Joined: Mon Dec 18, 2017 1:47 pm
Has thanked: 2 times
Been thanked: 39 times

Re: Rainbow Six: Siege Models Thread

Post by Tushkan »

You can buy where ever suits you. I'd suggest to wait for sales, siege often goes for sale with up to 75% discount on some versions. I'd also suggest you to buy not the cheapest one so you don't have to grind to open all operators. And yes, operators are only locked in-game, yet all resources are available right away (otherwise how would you see an opponent playing an operator you don't own yet). In short, if you only want to rip characters then buy cheapest release or even ask someone to share archives with you. If you want to play it then buy at least a release with all basic operators unlocked.
Rainbow 6 Siege forge unpacking tool:
https://www.dropbox.com/sh/b2cuse4hp90y ... qTfja?dl=0
Custard
advanced
Posts: 65
Joined: Fri Oct 25, 2019 12:33 am
Has thanked: 11 times
Been thanked: 14 times

Re: Rainbow Six: Siege Models Thread

Post by Custard »

Failing to generate cache properly was caused by me running the script in IDLE Shell, running in elevated Command Prompt solved it.

Made some attempts to find what magic was for textures4, I printed out the contents of two things, that being "n" as mentioned here..

# e - Entry object, contains offset, size and uid of a file
# n - NameEntry object (old class name, not relevant anymore)
# contains compressed metadata (haven't cracked it yet),
# magic number and other less interesting stuff. Can be
# used for fast specific filetype search
# c - Container. 99% of time it's a compressed file (if
# n.file_type != 0). It has `meta` and `file` attributes.
# meta is deprecated since Y5 when it was compressed and
# moved inside each entry's blob, just ignore it.

And also all the contents of tex.header..

Code: Select all

Targeting 110th file in datapc64_merged_bnk_textures4.forge

NameEntry object dump: 

x00: 0, x04: 4, x08: 0, x10: 4, meta: b"\x1e'\xf7u\x92\xee\x94\xa1\xa9^\xed\xc2\xdal\x19]\xe4\xfb\xf2P5\xe3\xd8\n10\xe5\x1eD\x9dZ\xefx\x9d\xc3\xb8\xb9,\xc4\xd5\xb6\xfd\xc1%\xff\xa5c\xb3%s\xc3\x841~\xd2l\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", x113: 56, timestamp: 2020-10-31 06:59:21, x118: 0, prev_entry_idx: 109, next_entry_idx: 111, x124: 0, file_type: 947309791, x130: 0, x134: b'\x11\xce\xb6\xd5\xd6rc~x\xb7\x10\x00'

tex.header dump:

encoded_meta: b"\x1e'ns\x92\xee\x94\xa1\xc9D\xc6-\x8b4\x0f\x8c\xa4\xee]\x87\xd4S\x85\xecQQ N\xd1\x95\x11\xfa\xf8\xa7\xb2!\xfd\xcd\x8f\x19\x961^\xa4\xeb\x1c\x1f>e\xb1\xf7n\xd7o\xa0\n", var1: 2097269, magic: 947309791, uid: 4471484783, var2: 0, var3: 0
Both those seem to suggest a magic number of 947309791, which wasn't the form I expected that number to take. I don't know if that helps at all.

Anyway congrats Tushkan, you've gotten us to a point where there will be a wave of new assets from this game, pulled right out of the forges! I doubted to even see this day but you did it. :)
Post Reply