Compare commits
2 Commits
9f4ff27079
...
e1c83d9d13
Author | SHA1 | Date | |
---|---|---|---|
e1c83d9d13 | |||
513d9d541b |
@ -11,6 +11,7 @@
|
|||||||
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="13.10.0" />
|
<PackageReference Include="Magick.NET-Q16-AnyCPU" Version="13.10.0" />
|
||||||
<PackageReference Include="Magick.NET.Core" Version="13.10.0" />
|
<PackageReference Include="Magick.NET.Core" Version="13.10.0" />
|
||||||
<PackageReference Include="NLua" Version="1.7.3" />
|
<PackageReference Include="NLua" Version="1.7.3" />
|
||||||
|
<PackageReference Include="System.Threading.Tasks" Version="4.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using ImageMagick;
|
using ImageMagick;
|
||||||
using NLua;
|
using NLua;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Xml.Linq;
|
|
||||||
namespace ArtemisFgTools
|
namespace ArtemisFgTools
|
||||||
{
|
{
|
||||||
internal class Program
|
internal class Program
|
||||||
@ -81,12 +80,13 @@ namespace ArtemisFgTools
|
|||||||
string pathWithSize = Path.Combine(fgImagePath, fgObject.Path, siz.ToString() ?? string.Empty);
|
string pathWithSize = Path.Combine(fgImagePath, fgObject.Path, siz.ToString() ?? string.Empty);
|
||||||
foreach (var pose in fgObject.Pose)
|
foreach (var pose in fgObject.Pose)
|
||||||
{
|
{
|
||||||
foreach (var fuku in fgObject.Fuku)
|
Parallel.ForEach(fgObject.Fuku, fuku =>
|
||||||
|
//foreach (var in )
|
||||||
{
|
{
|
||||||
bool special = false;
|
bool special = false;
|
||||||
string fuku_current = fuku;
|
string fuku_current = fuku;
|
||||||
//if the tail of fuku is |0099, spec to true & remove |0099
|
//if the tail of fuku is |0099, spec to true & remove |0099
|
||||||
if (fuku.EndsWith("|0099"))
|
if (fuku_current.EndsWith("|0099"))
|
||||||
{
|
{
|
||||||
special = true;
|
special = true;
|
||||||
fuku_current = fuku[0..^5];
|
fuku_current = fuku[0..^5];
|
||||||
@ -102,7 +102,7 @@ namespace ArtemisFgTools
|
|||||||
ProcessAndSave(baseImg, layerImg, layer2Img, savePathWithAll, special);
|
ProcessAndSave(baseImg, layerImg, layer2Img, savePathWithAll, special);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -113,11 +113,11 @@ namespace ArtemisFgTools
|
|||||||
string pathWithSize = Path.Combine(fgImagePath, fgObject.Path, siz2.ToString() ?? string.Empty);
|
string pathWithSize = Path.Combine(fgImagePath, fgObject.Path, siz2.ToString() ?? string.Empty);
|
||||||
foreach (var pose in fgObject.Pose)
|
foreach (var pose in fgObject.Pose)
|
||||||
{
|
{
|
||||||
foreach (var fuku in fgObject.Fuku)
|
Parallel.ForEach(fgObject.Fuku, fuku =>
|
||||||
{
|
{
|
||||||
bool special = false;
|
bool special = false;
|
||||||
string fuku_current = fuku;
|
string fuku_current = fuku;
|
||||||
if (fuku.EndsWith("|0099"))
|
if (fuku_current.EndsWith("|0099"))
|
||||||
{
|
{
|
||||||
special = true;
|
special = true;
|
||||||
fuku_current = fuku[0..^5];
|
fuku_current = fuku[0..^5];
|
||||||
@ -130,7 +130,7 @@ namespace ArtemisFgTools
|
|||||||
string savePathWithAll = Path.Combine(savePathWithSizePart, $"{fgObject.Head}no{pose[0]}{fuku_current}{pose[1]}0_{face}" + (special ? ($"_{pose[0]}0099.png") : (".png")));
|
string savePathWithAll = Path.Combine(savePathWithSizePart, $"{fgObject.Head}no{pose[0]}{fuku_current}{pose[1]}0_{face}" + (special ? ($"_{pose[0]}0099.png") : (".png")));
|
||||||
ProcessAndSave(baseImg, layerImg, layer2Img, savePathWithAll, special);
|
ProcessAndSave(baseImg, layerImg, layer2Img, savePathWithAll, special);
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -144,6 +144,11 @@ namespace ArtemisFgTools
|
|||||||
|
|
||||||
private static void ProcessAndSave(string baseImg, string layerImg, string layer2Img, string target, bool special)
|
private static void ProcessAndSave(string baseImg, string layerImg, string layer2Img, string target, bool special)
|
||||||
{
|
{
|
||||||
|
if (File.Exists(target))
|
||||||
|
{
|
||||||
|
Console.WriteLine($"{Path.GetFileName(target)}已存在,跳过!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
string? directory = Path.GetDirectoryName(target);
|
string? directory = Path.GetDirectoryName(target);
|
||||||
if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
|
if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory))
|
||||||
{
|
{
|
||||||
@ -284,7 +289,7 @@ namespace ArtemisFgTools
|
|||||||
{
|
{
|
||||||
if (comment != null)
|
if (comment != null)
|
||||||
{
|
{
|
||||||
string pattern = @"^pos,(\d+),(\d+),(\d+),(\d+)$";
|
string pattern = @"^pos,(-?\d+),(-?\d+),(-?\d+),(-?\d+)$";
|
||||||
Match match = Regex.Match(comment, pattern);
|
Match match = Regex.Match(comment, pattern);
|
||||||
if (match.Success)
|
if (match.Success)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user