Add more options to work with Scene Hierarchy (#23)

- Added option to group exported assets by node path in scene hierarchy
- Added field with node path to exported xml asset list
This commit is contained in:
VaDiM
2024-02-13 04:51:35 +03:00
parent c68eaa5e3c
commit 5c24183d18
9 changed files with 61 additions and 22 deletions

View File

@ -1948,7 +1948,7 @@ namespace AssetStudioGUI
private void clearSelectionToolStripMenuItem_Click(object sender, EventArgs e)
{
treeRecursionEnabled = false;
for(var i = 0; i < treeNodeSelectedList.Count; i++)
for (var i = 0; i < treeNodeSelectedList.Count; i++)
{
treeNodeSelectedList[i].Checked = false;
}

View File

@ -191,6 +191,7 @@
"container path",
"container path full (with name)",
"source file name",
"scene hierarchy",
"do not group"});
this.assetGroupOptions.Location = new System.Drawing.Point(6, 35);
this.assetGroupOptions.Name = "assetGroupOptions";

View File

@ -47,7 +47,8 @@ namespace AssetStudioGUI
TypeName,
ContainerPath,
ContainerPathFull,
SourceFileName
SourceFileName,
SceneHierarchy,
}
internal enum ListSearchFilterMode
@ -384,7 +385,6 @@ namespace AssetStudioGUI
}
}
}
parentNode.Nodes.Add(currentNode);
}
}
@ -481,6 +481,16 @@ namespace AssetStudioGUI
exportPath = Path.Combine(savePath, Path.GetFileName(asset.SourceFile.originalPath) + "_export", asset.SourceFile.fileName);
}
break;
case AssetGroupOption.SceneHierarchy:
if (asset.TreeNode != null)
{
exportPath = Path.Combine(savePath, asset.TreeNode.FullPath);
}
else
{
exportPath = Path.Combine(savePath, "_sceneRoot", asset.TypeString);
}
break;
default:
exportPath = savePath;
break;
@ -559,6 +569,7 @@ namespace AssetStudioGUI
new XElement("Type", new XAttribute("id", (int)asset.Type), asset.TypeString),
new XElement("PathID", asset.m_PathID),
new XElement("Source", asset.SourceFile.fullName),
new XElement("TreeNode", asset.TreeNode != null ? asset.TreeNode.FullPath : ""),
new XElement("Size", asset.FullSize)
)
)