Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AssetStudioCLI/Exporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ private static void ExportFbx(IImported convert, string exportPath)
ScaleFactor = CLIOptions.o_fbxScaleFactor.Value,
ExportAllUvsAsDiffuseMaps = CLIOptions.f_fbxUvsAsDiffuseMaps.Value,
ExportAnimations = CLIOptions.o_fbxAnimMode.Value != AnimationExportMode.Skip,
FbxFormat = CLIOptions.f_fbxAsciiFormat.Value == true ? 1 : 0,
};
ModelExporter.ExportFbx(exportPath, convert, fbxSettings);
}
Expand Down
20 changes: 18 additions & 2 deletions AssetStudioCLI/Options/CLIOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ internal static class CLIOptions
public static Option<int> o_fbxBoneSize;
public static Option<AnimationExportMode> o_fbxAnimMode;
public static Option<bool> f_fbxUvsAsDiffuseMaps;
public static Option<bool> f_fbxAsciiFormat;
//filter
public static Option<List<string>> o_filterByName;
public static Option<List<string>> o_filterByContainer;
Expand Down Expand Up @@ -407,7 +408,16 @@ private static void InitOptions()
optionName: "--fbx-uvs-as-diffuse",
optionDescription: "(Flag) If specified, Studio will export all UVs as Diffuse maps.\n" +
"Сan be useful if you cannot find some UVs after exporting (e.g. in Blender)\n" +
"(But can also cause some bugs with UVs)",
"(But can also cause some bugs with UVs)\n",
optionExample: "",
optionHelpGroup: HelpGroups.FBX
);
f_fbxAsciiFormat = new GroupedOption<bool>
(
optionDefaultValue: false,
optionName: "--fbx-ascii-format",
optionDescription: "(Flag) If specified, Studio will export FBX in ASCII format.\n" +
"If not specified, Binary format will be used",
optionExample: "",
optionHelpGroup: HelpGroups.FBX
);
Expand Down Expand Up @@ -679,6 +689,7 @@ public static void ParseArgs(string[] args)
o_exportAssetTypes.Value = new List<ClassIDType>
{
ClassIDType.Animator,
ClassIDType.AnimationClip,
ClassIDType.Mesh,
ClassIDType.Texture2D,
};
Expand Down Expand Up @@ -726,7 +737,7 @@ public static void ParseArgs(string[] args)
flagIndexes.Add(i);
break;
case "--fbx-uvs-as-diffuse":
if (o_workMode.Value != WorkMode.SplitObjects)
if (o_workMode.Value != WorkMode.SplitObjects && o_workMode.Value != WorkMode.Animator)
{
Console.WriteLine($"{"Error".Color(brightRed)} during parsing [{flag.Color(brightYellow)}] flag. This flag is not suitable for the current working mode [{o_workMode.Value}].\n");
ShowOptionDescription(o_workMode);
Expand All @@ -735,6 +746,10 @@ public static void ParseArgs(string[] args)
f_fbxUvsAsDiffuseMaps.Value = true;
flagIndexes.Add(i);
break;
case "--fbx-ascii-format":
f_fbxAsciiFormat.Value = true;
flagIndexes.Add(i);
break;
case "--filter-with-regex":
f_filterWithRegex.Value = true;
flagIndexes.Add(i);
Expand Down Expand Up @@ -1481,6 +1496,7 @@ public static void ShowCurrentOptions()
sb.AppendLine($"# FBX Bone Size: {o_fbxBoneSize}");
sb.AppendLine($"# FBX Animation Mode: {o_fbxAnimMode}");
sb.AppendLine($"# FBX UVs as Diffuse Maps: {f_fbxUvsAsDiffuseMaps}");
sb.AppendLine($"# FBX Export in ASCII Format: {f_fbxAsciiFormat}");
break;
}
sb.AppendLine("======");
Expand Down