示例#1
0
    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();
    }
示例#2
0
    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);
    }