Skip to content

Commit 3f36888

Browse files
committed
SQLite DB Output now includes MTRL name for materials.
1 parent b75e398 commit 3f36888

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

xivModdingFramework/Models/DataContainers/TTModel.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,16 @@ public void SaveToFile(string filePath, Action<bool, string> loggingFunction = n
923923
{
924924
var mtrl_prefix = directory + "\\" + Path.GetFileNameWithoutExtension(material.Substring(1)) + "_";
925925
var mtrl_suffix = ".png";
926+
var name = material;
927+
try
928+
{
929+
name = Path.GetFileName(material);
930+
} catch
931+
{
932+
933+
}
926934
cmd.Parameters.AddWithValue("material_id", matIdx);
935+
cmd.Parameters.AddWithValue("name", name);
927936
cmd.Parameters.AddWithValue("diffuse", mtrl_prefix + "d" + mtrl_suffix);
928937
cmd.Parameters.AddWithValue("normal", mtrl_prefix + "n" + mtrl_suffix);
929938
cmd.Parameters.AddWithValue("specular", mtrl_prefix + "s" + mtrl_suffix);

xivModdingFramework/Resources/SQL/CreateImportDB.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ CREATE TABLE "skeleton" (
120120
-- Materials
121121
CREATE TABLE "materials" (
122122
"material_id" INTEGER NOT NULL,
123+
"name" TEXT,
123124
"diffuse" TEXT,
124125
"normal" TEXT,
125126
"specular" TEXT,

0 commit comments

Comments
 (0)