• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

UABE - Asset Bundle Extractor

Hey DerPopo, nice utility here, thanks. I have some questions regarding a situation I have where I regularly acquire new assets and need to convert them to PNG when I do.

  1. The assets seem to mostly be dxt5, but I'm unsure. I assume the utility can determine this from the asset itself and doesn't rely on filename extension?
  2. Apparently batch extraction can be done through the command line, with a list of file names (or a file, with a list of filenames). Similarly, can batch conversion to PNG be done?
  3. Ideally I'd like to be able to do the conversion straight from asset file to PNG directly in my program. Do you have any shareable code for this? I'd be doing it in Java, but I know C/C++ as well, so I can easily translate if necessary.
Texture assets have a field that specifies which compression type/pixel format is used.

Currently, the command line is only able to export/import .assets files from/to bundles. Enhanced command line support is planned, but it won't be in UABE 2.2.

You can take a look at the API (Visual C++ 2010 Release mode only). You need to open a FILE* using fopen or similar functions, create an AssetsFile instance with AssetsReaderFromFile and (LPARAM)pFile, create an AssetsFileTable, locate the asset you want with curFileType==28 (you'll need absolutePos and curFileSize members of AssetFileInfoEx), create an AssetTypeInstance and then call ReadTextureFile and GetTextureData.

For the AssetTypeInstance, you'll either need a class database (for most separate .assets files) or just the type tree inside (for most bundled .assets files).

You can use the menu entry Options->Edit Type Package in UABE and export the type database you need from the classdata.tpk file. Then use the ClassDatabaseFile class to read it, locate the class you need using the classId, and then create an AssetTypeTemplateField and call FromClassDatabase with fieldIndex 0. Create an array of AssetTypeTemplateField* (or just pass a pointer to a AssetTypeTemplateField* and set baseFieldCount to 1) and use that on the AssetTypeInstance constructor.

If the .assets file has a proper TypeTree (hasTypeTree == true), you can enumerate through AssetsFile::typeTree.pTypes_Unity5 or 4 (header.format >= 0x0D for 5) with fieldCount entries. If an entry exists for classId==28, you can create an AssetTypeTemplateField with From0D (pass the type pointer and fieldIndex 0) or From07 (pass a pointer to the Type_07::base field), and use it the same way as explained above to create an AssetTypeInstance.

If you're reading bundles, create an Asset(s)BundleFile instance with the FILE*, locate the entry or entries you're looking for and call MakeAssetsFileReader, which you can then use to create an AssetsFile. To find out whether you have to look in assetsLists3 or bundleInf6 (different type pointers stored in the same union), just check if bundleHeader3.fileVersion is 3 or 6.

Note that if TextureFile::m_StreamData.size is not 0, you probably have a reference to a streamed asset. If it's in a bundle file, the m_StreamData.path string should start with "archive:/". The first part of the archive path is a bundle file name, derived from one of the bundle entry names. The second part (separated with a "/") is the actual bundle entry name you're looking for. You can open a reader through Asset(s)BundleFile::MakeAssetsFileReader as above.

Otherwise, the m_StreamData.path string is just a file name relative to the .assets file.

The texture data starts at m_StreamData.offset and has m_StreamData.size bytes. Read it into a memory buffer, set TextureFile::pPictureData and _pictureDataSize accordingly and call GetTextureData.

GetTextureData converts any supported texture format to RGBA32, so make sure your output buffer has m_Width*m_Height*4 bytes. Also make sure you have TexToolWrap.dll and PVRTexLib.dll next to the AssetsTools.dll if you want to decompress EAC, ETC, ETC2, PVRTC and/or ASTC textures.

I'm using lodepng (lodepng_encode32 function) to create a PNG out of the uncompressed data.

If you want to use Java for your main programm, I recommend creating a wrapper library in C++ that can only export textures using this procedure since it'd be quite a lot work to make a full wrapper of AssetsTools.dll.

In 2.2, the file callback/LPARAM parameter pairs will be replaced by proper virtual classes.

 
i have a problem with Import Mesh file.

if i use "Export Raw", then "Import Raw" that .dat, asset file still can view with other tool (Unity Studio).

but if i use "Export Dump", then "Import Dump" that .txt, asset file still can view in UABE but can't preview model in Unity Studio.

did i do anything wrong? pls help! :'(

(sorry for my bad English)

 
2.2

I would love to test the alpha too if possible :) I am working on a few full-game re-textures and a few remodels. So it would really help me and stresstest the tool too.

 
Tutorial: Change original sounds using UABE and Unity.

A quick guide on how to change and overwrite the original sounds with UABE and Unity

 
I know this will sound like I did not do a search and or did not look at the asset browser before my eye were going bad.

But I cannot find the scrap log spike 2D texture or the upgrade to steel which is what I want, or at least the texture that will upgrade a block to steel on a reinforced concrete 1x1x1x1 block

Does anyone know the actual name of the scrap log spike 2D texture or even the main block steel upgrade.

Please!!!

Please With a Cherry on top!!!

Pretty Please with a cherry on top!!!

here is what I working on, and why I need the spike textures:

https://lookimg.com/image/gEWFU

Exporting .OBJ is amazing, your program is amazing and I am jealous I because I have no programming or scripting (LUA, Python) skills what so ever.

Still searching

 
Last edited by a moderator:
I have a file with name "data.unity3d" and i used UABE to unpack and replace some image inside. Then I save it with another name. Unfortunately, this file not compressed. Please show me, how can do with UABE to unpack and repack this Unity Bundles file. Thank you so much!

 
I know this will sound like I did not do a search and or did not look at the asset browser before my eye were going bad.
But I cannot find the scrap log spike 2D texture or the upgrade to steel which is what I want, or at least the texture that will upgrade a block to steel on a reinforced concrete 1x1x1x1 block

Does anyone know the actual name of the scrap log spike 2D texture or even the main block steel upgrade.

Please!!!

Please With a Cherry on top!!!

Pretty Please with a cherry on top!!!

here is what I working on, and why I need the spike textures:

https://lookimg.com/image/gEWFU

Exporting .OBJ is amazing, your program is amazing and I am jealous I because I have no programming or scripting (LUA, Python) skills what so ever.

Still searching
if I understand you correctly - then you need to look at:

\7 Days To Die\Data\Bundles\BlockTextureAtlases

there textures of block.

PS: but keep in mind that these textures are common(mutual) to many blocks. After edit - it affect to all. In addition, now is no support MIP-map, means that after you edit the textures will not look so good.

 
Last edited by a moderator:
This tool was exactly what I needed! Amazing that you made this, and thank you very much!

I wanted to ask, if anyone else has problems extracting multiple Texture2D assets and converting them to .PNG via Plugin? I have no problems loading up a couple files and then extracting the Texture2D assets from them, I've done it once and only once where it converted up to 100 files in .PNG, but that was the last time it worked.

The problem is I'll load up the files I want to extract, highlight them all, click the plugin conversion to .png and set the destination folder but nothing shows up inside the folder. Could it be that I am trying to extract and convert too many files at once?

edit: I also tried doing the same with .tga plugin and no result with mass converting

 
Last edited by a moderator:
Thank you.

They are only for textures for UV and or UVW mapped in my new base (I hope) competently autocad-ed! yeah I take the game that seriously.

Thank you again, I mean no harm.

 
2.2 is mostly finished and only needs a final bit of polishing and testing. I'll probably release it as beta first and remove that tag once it has proved stable and major-bug-free for long enough.

It'll be by far the biggest update with 34467 changed lines of code in 40 commits (vs. 19 for UABE 2.0) so far. I don't want to imagine how long it will take to write the changelog :p

 
2.2 is mostly finished and only needs a final bit of polishing and testing. I'll probably release it as beta first and remove that tag once it has proved stable and major-bug-free for long enough.
It'll be by far the biggest update with 34467 changed lines of code in 40 commits (vs. 19 for UABE 2.0) so far. I don't want to imagine how long it will take to write the changelog :p
DERPOPO FOR PRESIDENT!!! Thank you for your hardwork :star: :first:

 
if I understand you correctly - then you need to look at:\7 Days To Die\Data\Bundles\BlockTextureAtlases

there textures of block.

PS: but keep in mind that these textures are common(mutual) to many blocks. After edit - it affect to all. In addition, now is no support MIP-map, means that after you edit the textures will not look so good.
I have found it and I will use a UVW modifier to adjust the texture at a resolution I will need. The base I am working in is just a 3D simulation of the game with textures on or off but as applied will provide me with a flyby or info that will make a more realistic representation of my next plans.

Yeah I take this a bit too far, but that's just the way I do things in almost every RPG or similar complicated games.

Thank you again.

 
I can't export .assets files to image file.(both of .png and .tga)

Only image files(audio type file or others are good)

I think it's because no type database matches my version.

How can I extract image file from .assets?

Whenever I open the .assets file, I have to select a type database.

It reads "No type database matches the player version 2017.2.0f3. Select one out of this list and press OK."

Thank you very much!

 
I can't export .assets file to image file(both of .png and .tga). Others can but only image files can't.

I think it's because its version is 2017.x.

Whenever I open .assets file, I have to select a type database.

It reads "No type database matches the player virsion 2017.2.0f3. Select one out of the list and press OK."

How can I export .assets file to image?

Thank you very much !!!

 
UABE 2.2 beta1 is out with support for 2017.1/2, batch import, MonoBehaviour dumps for non-bundled assets, massive performance improvements and almost 101% of the changelog.

Sadly, I had to cancel lootboxes due to the Battlefront II disaster.

I'm no expert, but...Your QR-code seems non-standard, it makes sense ? :)
It's actually just there to hide a space invader on the 7dtd forums.

 
UABE 2.2 beta1 is out with support for 2017.1/2, batch import, MonoBehaviour dumps for non-bundled assets, massive performance improvements and almost 101% of the changelog. Sadly, I had to cancel lootboxes due to the Battlefront II disaster.

It's actually just there to hide a space invader on the 7dtd forums.
Thank you very much for your hard work DerPopo!

I hope you will continue with this project for a long time. I might as well donate some money to support the project!

 
Hello! Thanks for that great tool, but I've got a couple of questions here.

It was easy to figure out how export Texture2D as png as well as replace this with my own graphics.

But is there any way how I can easily export all images in a batch? e.g. if I dont know the name of resource and just trying to find him among all the rest of assets. Also, is there any chance to decompile/change monobehaviour script inside asset?

Thanks in advance!

 
Back
Top