Skip to content

Commit

Permalink
Merge pull request #336 from mgear-dev/330-shifter-fbx-exporter-minor…
Browse files Browse the repository at this point in the history
…-bugs

[Shifter FBX Exporter] Minor bugs
  • Loading branch information
miquelcampos authored Nov 15, 2023
2 parents 4f5ddac + 3c363d3 commit 7dd965f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion release/scripts/mgear/shifter/game_tools_fbx/fbx_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,9 @@ def create_connections(self):
self.file_set_btn.clicked.connect(self.set_folder_path)
self.file_name_lineedit.textChanged.connect(self.normalize_name)

self.file_path_lineedit.textChanged.connect(self.set_fbx_directory)
self.file_name_lineedit.textChanged.connect(self.set_fbx_file)

# ue file path connection
self.ue_file_set_btn.clicked.connect(self.set_ue_folder_path)

Expand Down Expand Up @@ -641,6 +644,16 @@ def set_ue_folder_path(self):
export_node = self._get_or_create_export_node()
export_node.save_root_data("ue_file_path", path)

def set_fbx_directory(self):
path = self.file_path_lineedit.text()
export_node = self._get_or_create_export_node()
export_node.save_root_data("file_path", path)

def set_fbx_file(self):
path = self.file_name_lineedit.text()
export_node = self._get_or_create_export_node()
export_node.save_root_data("file_name", path)

def set_fbx_sdk_path(self):
current_fbx_sdk_path = pfbx.get_fbx_sdk_path()
fbx_sdk_path = pm.fileDialog2(
Expand Down Expand Up @@ -791,11 +804,19 @@ def export_skeletal_mesh(self):
partitions.update(master_partition)
partitions.update(export_node.get_partitions())
print("\t>>> Partitions:")
for partition_name, partition_data in partitions.items():

# Loops over partitions, and removes any disabled partitions, from being exported.
keys = list(partitions.keys())
for partition_name in reversed(keys):
partition_data = partitions[partition_name]
enabled = partition_data.get("enabled", True)
skeletal_meshes = partition_data.get("skeletal_meshes", [])

if not (enabled and skeletal_meshes):
partitions.pop(partition_name)
print("\t\t[!Partition Disabled!] - {}: {}".format(partition_name, skeletal_meshes))
continue

print("\t\t{}: {}".format(partition_name, skeletal_meshes))
export_config["partitions"] = partitions

Expand Down

0 comments on commit 7dd965f

Please sign in to comment.