Skip to content

Commit

Permalink
Export type setting, Put tmb stuff on hold
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmheg committed Apr 19, 2022
1 parent 52df1d9 commit d0c99db
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
35 changes: 25 additions & 10 deletions MultiAssist.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,8 @@ def read_timeline(tmb_data):
return

class GUI:
EXPORT_TYPES = ['.fbx (Requires Noesis conversion)', '.hkx packfile (HavokMax compatible)', '.hkx tagfile', '.xml']
EXPORT_EXT = ['.fbx', '.hkx', '.hkx', '.xml']
def __init__(self) -> None:
self.config = configparser.ConfigParser()
self._config()
Expand Down Expand Up @@ -632,7 +634,7 @@ def show_info(self, title, message):

def _config(self):
if not os.path.exists('config.ini'):
self.config['SETTINGS'] = {'export_iteration': 'false', 'export_location': os.path.abspath(os.curdir)}
self.config['SETTINGS'] = {'export_iteration': 'false', 'export_location': os.path.abspath(os.curdir), 'export_type': '0'}

self.config.write(open('config.ini', 'w'))

Expand All @@ -649,6 +651,7 @@ def _get_config(self, section, key, bool=False):
def _save_settings(self):
self.config.set('SETTINGS','export_iteration', str(not dpg.get_value("settings_export_iteration")))
self.config.set('SETTINGS','export_location', str(dpg.get_value("settings_export_location")))
self.config.set('SETTINGS','export_type', str(self.EXPORT_TYPES.index(dpg.get_value("settings_export_type"))))
self.config.write(open('config.ini', 'w'))

def _file_handler(self, sender, app_data, user_data):
Expand Down Expand Up @@ -697,13 +700,13 @@ def _clear_anims(self, sender, app_data, user_data):
def _get_ft(self):
# kinda dislike this
x = dpg.get_value("extension_selector")
if (x == ".fbx (Requires Noesis conversion)"):
if (x == self.EXPORT_TYPES[0]):
return "fbx"
if (x == ".hkx packfile (HavokMax compatible)"):
if (x == self.EXPORT_TYPES[1]):
return "hkxp"
if (x == ".hkx tagfile"):
if (x == self.EXPORT_TYPES[2]):
return "hkxt"
if (x == ".xml"):
if (x == self.EXPORT_TYPES[3]):
return "xml"

def _copy_tab(self, tab):
Expand Down Expand Up @@ -738,12 +741,16 @@ def _export_window(self):
with dpg.child_window(autosize_y=True, autosize_x=True, tag="export_window"):
dpg.add_text("Export Options")
dpg.add_text("Export as: ")
if self._get_config('SETTINGS','export_type') == "":
e = self.EXPORT_TYPES[0]
else:
e = self.EXPORT_TYPES[int(self._get_config('SETTINGS','export_type'))]
with dpg.group(horizontal=True):
dpg.add_combo(items=[".fbx (Requires Noesis conversion)", ".hkx packfile (HavokMax compatible)", ".hkx tagfile", ".xml"], default_value=".fbx (Requires Noesis conversion)", tag="extension_selector", callback=lambda: dpg.set_value("extension", dpg.get_value("extension_selector")[0:4]))
dpg.add_combo(items=self.EXPORT_TYPES, default_value=e, tag="extension_selector", callback=lambda: dpg.set_value("extension", dpg.get_value("extension_selector")[0:4]))
dpg.add_text("Name: ")
with dpg.group(horizontal=True):
dpg.add_input_text(tag="name")
dpg.add_text(".fbx", tag="extension")
dpg.add_text(self.EXPORT_EXT[int(self.EXPORT_TYPES.index(e))], tag="extension")
dpg.add_text("Export directory: ")
with dpg.group(horizontal=True):
dpg.add_input_text(label="", tag="export_directory", default_value=self._get_config('SETTINGS', 'export_location'))
Expand Down Expand Up @@ -808,6 +815,7 @@ def _repack_callback(self, sender, app_data):

def _repack_window(self):
with dpg.child_window(autosize_x=True, height=200):
dpg.add_button(small=True, label="Blender user? Check out 0ceal0t's BlenderAssist for an easier time repacking.", callback=lambda:webbrowser.open('https://github.com/0ceal0t/BlenderAssist'))
dpg.add_text("Select .pap:")
with dpg.group(horizontal=True):
dpg.add_input_text(tag="selected_repap", callback=self._clear_anims, user_data={"output":"reanim_list"})
Expand Down Expand Up @@ -920,7 +928,15 @@ def _run(self):
with dpg.window(tag="Primary Window"):
with dpg.menu_bar():
with dpg.menu(label="Settings"):
if self._get_config('SETTINGS','export_type') == "":
export_type = self.EXPORT_TYPES[0]
else:
export_type = self.EXPORT_TYPES[int(self._get_config('SETTINGS','export_type'))]

dpg.add_checkbox(label="Overwrite export if file exists", default_value= not self._get_config('SETTINGS','export_iteration', True), tag="settings_export_iteration")
dpg.add_text("\nDefault extract type:")

dpg.add_combo(default_value=export_type , tag="settings_export_type", items=self.EXPORT_TYPES)
dpg.add_text("\nDefault export directory:")
dpg.add_input_text(default_value=self._get_config('SETTINGS','export_location'), tag="settings_export_location")

Expand All @@ -934,9 +950,8 @@ def _run(self):
self._export_window()
with dpg.tab(label='Repack'):
self._repack_window()
with dpg.tab(label='Timeline Editor'):
self._pap_editor_window()

# with dpg.tab(label='Timeline Editor'):
# self._pap_editor_window()

self._set_theme()

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ I started this fork so I had a quick way to extract some animation data from XIV

Essentially everything good in this project comes from Perchbird's work, everything bad in this project is probably by me.

Using **Blender**? Consider checking out [0ceal0t's BlenderAssist](https://github.com/0ceal0t/BlenderAssist)! Another tool that utilizes animassist and fbx2havok to achieve similar things to this project, in a Blender addon! You may want to use MultiAssist in conjunction with BlenderAssist if you are editing existing animations, otherwise BlenderAssist is simply better and cuts out a few steps.

# Table of Contents
- [Prerequisites](#prerequisites)
Expand Down Expand Up @@ -59,6 +60,8 @@ Essentially everything good in this project comes from Perchbird's work, everyth
* If you are using the .py, make sure to build or otherwise acquire the companion executables.
* [Godbert](https://github.com/xivapi/SaintCoinach#godbert)
* May be useful in assisting yourself in familiarizing yourself with the location of FFXIV animations, entirely optional.
* [VFXEditor](https://github.com/0ceal0t/Dalamud-VFXEditor)
* Way to edit the timeline section of animation files, among many other things.

# Installation and Usage
*(NOTE: UX, input validation and error reporting within the GUI is quite poor within the current release! Please follow these instructions carefully and with this in mind. For now, a command window should open alongside the MultiAssist executable which should provide insight into any errors you run into, as well as a way to track the progress of any operations you perform.)*
Expand Down
4 changes: 3 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ inline std::string convert_from_wstring(const std::wstring& wstr)
// animassist.exe (2) in_edited_hk_xml out_anim_hkx
// animassist.exe (3) in_skl_hkx in_anim_hkx anim_index out_merged_hkx
// animassist.exe (4) in_anim_hkx out_anim_xml
// animassist.exe (6) in_anim_packfile out_anmim_hkx
// animassist.exe (5) in_anim_hkx out_anim_xml
// animassist.exe (6) in_anim_packfile in_skl_hkx out_anim_hkx
int main(int argc, const char** argv) {

int nargc = 0;
Expand Down Expand Up @@ -76,6 +77,7 @@ int main(int argc, const char** argv) {
// 3 = skl + anim -> out hk*
// 4 = skl + anim -> xml packfile
// 5 = xml packfile of anim -> binary tagfile
// 6 = skl + anim - > binary tagfile
int mode = _wtoi(nargv[1]);

if (mode == 1 || mode == 2) {
Expand Down

0 comments on commit d0c99db

Please sign in to comment.