Пример #1
0
        private static unsafe void createAndBindMaterials(string outputFilename, IGrannyFile file, List <GrannyModelInfo> modelInfos)
        {
            GrannyFileWrapper fileWrapper2 = new GrannyFileWrapper(CivNexusSixApplicationForm.form.SaveAsAction(file, outputFilename, false));

            CivNexusSixApplicationForm.form.RefreshAppData();

            for (int modelIndex = 0; modelIndex < modelInfos.Count; modelIndex++)
            {
                var modelInfo = modelInfos[modelIndex];
                for (int meshIndex = 0; meshIndex < modelInfo.meshBindings.Count; meshIndex++)
                {
                    GrannyMeshInfo meshInfo = modelInfo.meshBindings[meshIndex];
                    fileWrapper2.createMaterials(modelIndex, meshIndex, meshInfo);
                }
            }

            GrannyFileWrapper fileWrapper3 = new GrannyFileWrapper(CivNexusSixApplicationForm.form.SaveAsAction(fileWrapper2.wrappedFile, outputFilename, false));

            fileWrapper3.pruneMaterials();

            CivNexusSixApplicationForm.form.SaveAsAction(fileWrapper3.wrappedFile, outputFilename, false);

            CivNexusSixApplicationForm.form.RefreshAppData();
        }