private void Run(string[] args) { ImportSettings settings; if (args.Length > 0 && args[0] == "release") { settings = ImportSettings.MakeReleaseSettings(); } else { settings = ImportSettings.MakeFromViewerInitialSettings(); } new UiImporter().Run(); new EnvironmentCubeGenerator().Run(settings); OutfitImporter.ImportAll(); var loader = new FigureRecipeLoader(objectLocator); FigureRecipe genesis3FemaleRecipe = loader.LoadFigureRecipe("genesis-3-female", null); FigureRecipe genitaliaRecipe = loader.LoadFigureRecipe("genesis-3-female-genitalia", genesis3FemaleRecipe); FigureRecipe genesis3FemaleWithGenitaliaRecipe = new FigureRecipeMerger(genesis3FemaleRecipe, genitaliaRecipe).Merge(); Figure genesis3FemaleWithGenitalia = genesis3FemaleWithGenitaliaRecipe.Bake(null); Figure parentFigure = genesis3FemaleWithGenitalia; List <Figure> childFigures = settings.FiguresToImport .Where(figureName => figureName != parentFigure.Name) .Select(figureName => loader.LoadFigureRecipe(figureName, genesis3FemaleRecipe).Bake(parentFigure)) .ToList(); List <Figure> figuresToDump = Enumerable.Repeat(parentFigure, 1) .Concat(childFigures) .ToList(); Console.WriteLine($"Dumping parent..."); AnimationDumper.DumpAllAnimations(parentFigure); var textureProcessorSharer = new TextureProcessorSharer(device, shaderCache, settings.CompressTextures); foreach (Figure figure in figuresToDump) { bool[] channelsToInclude = figure != parentFigure?ChannelShaker.MakeChannelsToIncludeFromShapes(figure) : null; Console.WriteLine($"Dumping {figure.Name}..."); SystemDumper.DumpFigure(figure, channelsToInclude); GeometryDumper.DumpFigure(figure); UVSetDumper.DumpFigure(figure); MaterialSetDumper.DumpAllForFigure(settings, device, shaderCache, fileLocator, objectLocator, figure, textureProcessorSharer); ShapeDumper.DumpAllForFigure(settings, fileLocator, device, shaderCache, parentFigure, figure); } textureProcessorSharer.Finish(); }
public static void DumpFigure(Figure figure, SurfaceProperties surfaceProperties, DirectoryInfo figureDestDir) { DirectoryInfo uvSetsDirectory = figureDestDir.Subdirectory("uv-sets"); UVSetDumper dumper = new UVSetDumper(figure, surfaceProperties, uvSetsDirectory); dumper.DumpShared(); foreach (var pair in figure.UvSets) { dumper.Dump(pair.Key, pair.Value); } }
public void DumpFigure(ShapeImportConfiguration[] shapeConfigurations, DirectoryInfo figureDestDir) { Console.WriteLine($"Dumping {figure.Name}..."); if (figure == parentFigure) { AnimationDumper.DumpAllAnimations(parentFigure, figureDestDir); } bool[] channelsToInclude = figure != parentFigure?ChannelShaker.MakeChannelsToIncludeFromShapes(figure, shapeConfigurations) : null; SystemDumper.DumpFigure(figure, surfaceProperties, channelsToInclude, figureDestDir); GeometryDumper.DumpFigure(figure, surfaceProperties, figureDestDir); UVSetDumper.DumpFigure(figure, surfaceProperties, figureDestDir); }
public static void DumpFigure(Figure figure, SurfaceProperties surfaceProperties, DirectoryInfo figureDestDir) { DirectoryInfo refinementDirectory = figureDestDir.Subdirectory("refinement").Subdirectory("level-" + surfaceProperties.SubdivisionLevel); Quad[] spatialFaces = refinementDirectory.File("faces.array").ReadArray <Quad>(); SubdivisionTopologyInfo spatialTopologyInfo = Persistance.Load <SubdivisionTopologyInfo>(UnpackedArchiveFile.Make(refinementDirectory.File("topology-info.dat"))); DirectoryInfo uvSetsDirectory = figureDestDir.Subdirectory("uv-sets"); UVSetDumper dumper = new UVSetDumper(figure, surfaceProperties, uvSetsDirectory, spatialFaces, spatialTopologyInfo); foreach (var pair in figure.UvSets) { dumper.Dump(pair.Key, pair.Value); } }