Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Support for packing BFFNT v4.1 #22

Open
apolope opened this issue Mar 30, 2019 · 25 comments
Open

No Support for packing BFFNT v4.1 #22

apolope opened this issue Mar 30, 2019 · 25 comments

Comments

@apolope
Copy link

apolope commented Mar 30, 2019

I can unpack and make changes, but I can not package. I'm new to this and I do not know if I'm doing it right.

I unpacked with these arguments
python 3DSkit.py -xf BFFNT -O reverse=true -O origin=NX "MessageFont38.bffnt"

And I try to pack with these arguments
python 3DSkit.py -pf BFFNT -O reverse=true -O meta="MessageFont38_meta.json" "MessageFont38_sheet0.png" "MessageFont38_sheet1.png"

Returns this message
UnsupportedFormatError: 3DSkit is currently unable to pack this format (101)

FontData.zip

These are files from the Super Mario Odyssey game of the Nintendo Switch

Forgive me for my lack of knowledge.

@apolope apolope changed the title No Support for packing BFFNT .v No Support for packing BFFNT v4.1 Mar 30, 2019
@Tyulis
Copy link
Owner

Tyulis commented Mar 30, 2019

That's because the BFFNT packer is not released yet ^^
Don't know why did i put this in the Readme so early...

@apolope
Copy link
Author

apolope commented Mar 30, 2019

Thanks for agile answer, congratulation for your commitment. I'm waiting for the launch of this feature, so I finish the translation of the game. I would like to be able to help you implement, but I do not know much about python. I'm available for whatever I can help. Thanks so very much.

@masagrator
Copy link

masagrator commented Apr 1, 2019

I see that this was for many months in readme. Is this feature progressing or not?
I would be happy for every to->BNTX or to->CMAP converter.

@Tyulis
Copy link
Owner

Tyulis commented Apr 2, 2019

I develop 3DSkit on my free time...

And the problem is that i don't have free time.
So i try to answer to issues as fast as i can, but i can't work on this as fast as i'd like. Making a module is quite complicated, as it is not always well documented, so i have to document, program, test, re-program, ... And BFFNT is one of the most complicated formats i worked on.

Anyway, don't know why this was in the Readme.
I'll try to do that, and as always any help is welcome for other formats ^^

@Tyulis
Copy link
Owner

Tyulis commented Apr 6, 2019

It would be very difficult to keep a quick made extractor in the BFFNT module. So this is what i'll do :

  • a BNTX extractor. The BFFNT extractor will just extract the BNTX section, and then call the BNTX extractor
  • Then a BNTX packer to rebuild them
  • And finally the full BFFNT packer that will call the BNTX packer

It may be a bit longer, but it's necessary to keep the consistency of 3DSkit, and just to rebuild correctly the files.

@apolope
Copy link
Author

apolope commented Apr 6, 2019

Thanks for your commitment!

Unfortunately I'm a newbie on this and not know very much. Would like to help...

@masagrator helped me a lot. Just as you have helped a lot of people too and me.

When finish let us know. And we can ends ours projects. Thanks!

@Tyulis
Copy link
Owner

Tyulis commented Apr 23, 2019

Just a few news : the BNTX packer is on the way, i'm just struggling with texture compression but it should be done today or tomorrow.

@Migushthe2nd
Copy link

Migushthe2nd commented Apr 23, 2019

Regarding the BNTX extractor:

3DSkit.py -xf BNTX __Combined.bntx -v

--------__Combined.bntx--------
No compression
BNTX file found
Extracting...
File version : 0.4.1.0
Extracting texture BalloonTipShdw^s, element 0
0
Extracting texture BalloonTip^s, element 0
0
Traceback (most recent call last):
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\3DSkit.py", line 249, in <module>
    result = main(args, opts)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\3DSkit.py", line 169, in main
    extract_files(filename, args.big, args.format, args.verbose, opts)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\3DSkit.py", line 112, in extract_files
    unpack.extract(filename, file, format, endian, verbose, opts)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\unpack\__init__.py", line 16, in extract
    unpacker = cls(*args)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\util\utils.py", line 18, in __new__
    return self.main(*args, **kwargs)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\unpack\BNTX.py", line 59, in main
    texmeta.append(self.read_texture(data, brtioffset))
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\unpack\BNTX.py", line 159, in read_texture
    libkit.extractTiledTexture(indata, out, width, height, format, swizzle_value if tilemode == 0 else -1, self.byteorder == '<')
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\py3DSkit\graphx.py", line 367, in extractTiledTexture
    _extractBC4Texture(input, output, width, height, format, swizzlesize, littleendian)
  File "K:\NSW\Themes\Very nice theme\tools\clean_3DSKit\py3DSkit\graphx.py", line 360, in _extractBC4Texture
    output[outpos] = output[outpos + 1] = output[outpos + 2] = lum
IndexError: index 572 is out of bounds for axis 0 with size 572

The file is from the ResidentMenu of the Nintendo Switch
https://drive.google.com/file/d/1aJUnRfWBK6dARm-vLyI0Y_XP3Iviv8rS/view?usp=sharing

Excuse me if I reported this too soon, or it might be

currently only extracts uncompressed 2…

@Tyulis
Copy link
Owner

Tyulis commented Apr 23, 2019

Congratulations : you found a new version ^^"
If you don't mind I'll first finish the BFFNT stuff and then i'll try to fix that. But thank you very much for your contribution !

@Tyulis
Copy link
Owner

Tyulis commented Apr 23, 2019

The BNTX packer is seemingly working, now i start the BFFNT packer ^^

@apolope
Copy link
Author

apolope commented Apr 28, 2019

Very good and congratulation for your work. I was job travel, and now go test.

@Tyulis
Copy link
Owner

Tyulis commented May 15, 2019

Pfff... Really sorry for the wait, no time at all this month...
Anyway, it works quite well, just a few things to fix and it should be done

@Tyulis
Copy link
Owner

Tyulis commented May 24, 2019

So....
Finally it's committed, you can try if it works ^^

@TROguz
Copy link

TROguz commented May 29, 2019

Good new. Can you share bffnt repack tools?

@Tyulis
Copy link
Owner

Tyulis commented May 29, 2019

They are already in the repo, just pull it ^^

@TROguz
Copy link

TROguz commented May 29, 2019

Oh, nice. Thank you. I want to edit zelda botw and wind waker hd fonts. This bffnt script its work on Wii U games?

@TROguz
Copy link

TROguz commented May 29, 2019

Why give me error script?
SyntaxError: unexpected character after line continuation character

@TROguz
Copy link

TROguz commented May 29, 2019

Can you build this tools?

@masagrator
Copy link

masagrator commented May 29, 2019

This is python script. What you want to build?
I will test it in couple of days on Super Mario Party fonts.

@TROguz
Copy link

TROguz commented May 29, 2019

I want bffnt unpack repack fonts. But script give me error for unpack.
Example Zelda wind waker hd fonts: https://www94.zippyshare.com/v/4JOtjm8y/file.html

@masagrator
Copy link

masagrator commented May 29, 2019

For me your WiiU bffnt is extracting normally, json is good, but textures are broken.
python 3dskit.py -x -O origin=CAFE CKingMain.bffnt

@TROguz
Copy link

TROguz commented May 29, 2019

Thanks but where is the problem?
https://prnt.sc/nv28fl

@masagrator
Copy link

Don't try to run it from python command line. Just put this whole line to cmd with python at the beginning

@Tyulis
Copy link
Owner

Tyulis commented May 29, 2019

Currently it only repacks Switch fonts, but i'm working on WiiU ones.
I'll take a look at your file ^^

@TROguz
Copy link

TROguz commented May 29, 2019

Thanks but i cant unpack. Can you make tutorial video for unpack and repack?
Thanks for everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants