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

Batch convert .pcs <-> .pac files with optional subfolder inclusion #92

Closed
Ebola16 opened this Issue Dec 2, 2016 · 15 comments

Comments

Projects
None yet
2 participants
@Ebola16
Contributor

Ebola16 commented Dec 2, 2016

  • Batch convert (pac to pcs)
  • Batch convert (pcs to pac)
  • Optional subfolder inclusion

It would be convenient if Brawlbox could batch convert .pcs <-> .pac files.

Fyi, gbalzss can batch convert .pcs -> .pac (https://elitesmashhackers.wordpress.com/2009/07/16/enough-with-lz77ex/). Using gbalzss to convert .pac -> .pcs will crash Brawlbox.
I haven't tested the source code but it is likely here https://github.com/comex/somestuff/tree/master/gbalzss_compressor_tool

@Ebola16 Ebola16 changed the title from Batch convert .pcs <-> .pac files using to Batch convert .pcs <-> .pac files using gbalzss Dec 2, 2016

@Ebola16 Ebola16 changed the title from Batch convert .pcs <-> .pac files using gbalzss to Batch convert .pcs <-> .pac files Dec 2, 2016

@libertyernie

This comment has been minimized.

Show comment
Hide comment
@libertyernie

libertyernie Dec 5, 2016

Owner

This sounds like something I could figure out how to do.

Owner

libertyernie commented Dec 5, 2016

This sounds like something I could figure out how to do.

@libertyernie

This comment has been minimized.

Show comment
Hide comment
@libertyernie

libertyernie Dec 5, 2016

Owner

I added a Python plugin (using the plugin system Sammi put together) that asks for a folder and then scans it and its subfolders for pac files, and makes pcs versions of all of them (in the same folder as the originals.) How's that sound?

Owner

libertyernie commented Dec 5, 2016

I added a Python plugin (using the plugin system Sammi put together) that asks for a folder and then scans it and its subfolders for pac files, and makes pcs versions of all of them (in the same folder as the originals.) How's that sound?

@Ebola16

This comment has been minimized.

Show comment
Hide comment
@Ebola16

Ebola16 Dec 7, 2016

Contributor

I tested your python plugin with a few dozen files and it seemed to properly mass convert .pac -> .pcs conversion.

Would you be able to make another plugin that supports mass .pcs -> .pac conversion?
After some more testing, gbalzss can't decode ExtendedLZ77 so this is another job for Brawlbox.

Contributor

Ebola16 commented Dec 7, 2016

I tested your python plugin with a few dozen files and it seemed to properly mass convert .pac -> .pcs conversion.

Would you be able to make another plugin that supports mass .pcs -> .pac conversion?
After some more testing, gbalzss can't decode ExtendedLZ77 so this is another job for Brawlbox.

@libertyernie

This comment has been minimized.

Show comment
Hide comment
@libertyernie

libertyernie Dec 7, 2016

Owner

Just make a copy of the python file, and switch the from_ext to .pcs and the to_ext to .pac.

Owner

libertyernie commented Dec 7, 2016

Just make a copy of the python file, and switch the from_ext to .pcs and the to_ext to .pac.

@Ebola16

This comment has been minimized.

Show comment
Hide comment
@Ebola16

Ebola16 Dec 7, 2016

Contributor

I tried that but Brawlbox just copies the file with a different extension when converting .pcs -> .pac
It does not change the root ARC entry compression type to "None"

(The proper root ARC entry compression change occurs in your .pac -> .pcs plugin)

Contributor

Ebola16 commented Dec 7, 2016

I tried that but Brawlbox just copies the file with a different extension when converting .pcs -> .pac
It does not change the root ARC entry compression type to "None"

(The proper root ARC entry compression change occurs in your .pac -> .pcs plugin)

@libertyernie

This comment has been minimized.

Show comment
Hide comment
@libertyernie

libertyernie Dec 7, 2016

Owner

Huh. I wonder why that is? I'll look for a way to fix it.

Owner

libertyernie commented Dec 7, 2016

Huh. I wonder why that is? I'll look for a way to fix it.

@libertyernie

This comment has been minimized.

Show comment
Hide comment
@libertyernie

libertyernie Dec 7, 2016

Owner

OK, I updated the plugin. Now it converts from .pcs -> .pac (just swap the extensions to go the other way), and when converting from .pac, it sets the compression type to None first.

Owner

libertyernie commented Dec 7, 2016

OK, I updated the plugin. Now it converts from .pcs -> .pac (just swap the extensions to go the other way), and when converting from .pac, it sets the compression type to None first.

@Ebola16

This comment has been minimized.

Show comment
Hide comment
@Ebola16

Ebola16 Dec 7, 2016

Contributor

Would you be opposed to keeping both plugins? They would be:
Batch convert (pac to pcs)
Batch convert (pcs to pac)

Both plugins seem to work properly now. I exported your original Batch convert (pac to pcs) plugin.
Batch convert (pac to pcs).zip

Contributor

Ebola16 commented Dec 7, 2016

Would you be opposed to keeping both plugins? They would be:
Batch convert (pac to pcs)
Batch convert (pcs to pac)

Both plugins seem to work properly now. I exported your original Batch convert (pac to pcs) plugin.
Batch convert (pac to pcs).zip

@libertyernie

This comment has been minimized.

Show comment
Hide comment
@libertyernie

libertyernie Dec 7, 2016

Owner

Yeah, I guess having just one and not the other makes it kind of arbitrary. I'll put them both in.

Owner

libertyernie commented Dec 7, 2016

Yeah, I guess having just one and not the other makes it kind of arbitrary. I'll put them both in.

@Ebola16

This comment has been minimized.

Show comment
Hide comment
@Ebola16

Ebola16 Dec 7, 2016

Contributor

Also, an "include subfolders" option would be convenient for both plugins. I can file a follow-up issue if this is time-consuming or difficult to implement.

Contributor

Ebola16 commented Dec 7, 2016

Also, an "include subfolders" option would be convenient for both plugins. I can file a follow-up issue if this is time-consuming or difficult to implement.

@libertyernie

This comment has been minimized.

Show comment
Hide comment
@libertyernie

libertyernie Dec 7, 2016

Owner

The BrawlBox API doesn't have an elegant way to ask for options like this (yet) - maybe at some point I'll add one.
Until then, you can change the plugin to not include subfolders, if that's what you do more often, by adding a "break" at the same level as "for file in files:"

for root, dirs, files in os.walk(dir):
	for file in files:
		...
	break

Or maybe I should change the plugin to have the break, and allow people to remove it?

Owner

libertyernie commented Dec 7, 2016

The BrawlBox API doesn't have an elegant way to ask for options like this (yet) - maybe at some point I'll add one.
Until then, you can change the plugin to not include subfolders, if that's what you do more often, by adding a "break" at the same level as "for file in files:"

for root, dirs, files in os.walk(dir):
	for file in files:
		...
	break

Or maybe I should change the plugin to have the break, and allow people to remove it?

@Ebola16

This comment has been minimized.

Show comment
Hide comment
@Ebola16

Ebola16 Dec 7, 2016

Contributor

I think most users would want subfolders included by default, as they can make batch conversions of Brawl's entire .../fighter folder. Perhaps renaming the plugins to "Batch convert pac to pcs (includes subfolders)" and "Batch convert pcs to pac (includes subfolders)" would help?

Optional subfolder inclusion would be nice but isn't an immediate necessity. I'll keep this issue open and rename it since you may add this functionality in the future.

Thank you for your help!

Contributor

Ebola16 commented Dec 7, 2016

I think most users would want subfolders included by default, as they can make batch conversions of Brawl's entire .../fighter folder. Perhaps renaming the plugins to "Batch convert pac to pcs (includes subfolders)" and "Batch convert pcs to pac (includes subfolders)" would help?

Optional subfolder inclusion would be nice but isn't an immediate necessity. I'll keep this issue open and rename it since you may add this functionality in the future.

Thank you for your help!

@Ebola16 Ebola16 changed the title from Batch convert .pcs <-> .pac files to Batch convert .pcs <-> .pac files with optional subfolder inclusion Dec 7, 2016

@Ebola16

This comment has been minimized.

Show comment
Hide comment
@Ebola16

Ebola16 Dec 7, 2016

Contributor

BrawlBox.csproj didn't properly update after renaming those files.
Fixed in commit c2f5dd0

Contributor

Ebola16 commented Dec 7, 2016

BrawlBox.csproj didn't properly update after renaming those files.
Fixed in commit c2f5dd0

@libertyernie

This comment has been minimized.

Show comment
Hide comment
@libertyernie

libertyernie Dec 7, 2016

Owner

Oops! I'll get that taken care of in a bit.

Owner

libertyernie commented Dec 7, 2016

Oops! I'll get that taken care of in a bit.

@Ebola16

This comment has been minimized.

Show comment
Hide comment
@Ebola16

Ebola16 Jan 13, 2017

Contributor

a88c454 addresses optional subfolder inclusion.
Function wise, LGTM!

Contributor

Ebola16 commented Jan 13, 2017

a88c454 addresses optional subfolder inclusion.
Function wise, LGTM!

@Ebola16 Ebola16 closed this Jan 13, 2017

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