Esempio n. 1
0
        public Asset Convert(String input, String output, ConvertSettings settings)
        {
            LogProvider.Log(LogLevel.Info, "converting " + input);
            LogProvider.Log(LogLevel.Info, "will be saved at " + output);

            // TODO: guess importer/exporter to use by file extension if not set
            if (settings.Importer == null)
            {
            }
            if (settings.Exporter == null)
            {
            }

            Stream streamInput = File.Open(input, FileMode.Open, FileAccess.Read);
            Stream streamOutput = File.Open(output, FileMode.Create, FileAccess.Write);
            return Convert(streamInput, streamOutput, settings);
        }
Esempio n. 2
0
        public Asset Convert(Stream input, Stream output, ConvertSettings settings)
        {
            Stopwatch watch = new Stopwatch();
            watch.Start();

            Asset model = settings.Importer.Read(input);

            // processing
            //if (settings.ScaleFactor != 1.0f)
            //	model.Scale(settings.ScaleFactor);
            //if (settings.RecalculateNormals)
            //	model.RecalculateNormals();

            settings.Exporter.Write(model, output);

            // log time
            watch.Stop();
            LogProvider.Log(LogLevel.Info, "completed in " + watch.Elapsed.ToString());

            return model;
        }