Пример #1
0
        public static void Main(string [] args)
        {
            if (args == null || args.Length < 1)
            {
                Console.Error.WriteLine("Usage: FbxPrint.exe FILENAME [ FILENAME ... ]");
                return;
            }

            foreach (var filename in args)
            {
                var importer = new Importer(filename);
                var scene    = importer.Import(filename);

//                var acs1 = scene.SrcObjects.Where(x => x is AnimCurve).ToList();
//                var acs2 = acs1.Cast<AnimCurve>().ToList();
//                var ordered = acs2.OrderBy(x => x.GetUniqueID()).ToList();
//                var acs = ordered.ToList();
//                foreach (var srcobj in acs)
//                {
//                    var ac = srcobj as AnimCurve;
//                    if (ac != null)
//                    {
//    //                    ObjectPrinter.PrintObject(ac);
//    //                    Console.WriteLine(ObjectPrinter.PrintObjectID(ac));
//                        ObjectPrinter.PrintAnimCurve(ac);
//                        Console.WriteLine();
//     //                    break;
//                    }
//                }

                var printer = new FbxSharp.ObjectPrinter();
                printer.PrintObjectGraph(scene);
            }
        }
Пример #2
0
        public static void Main(string [] args)
        {
            if (args == null || args.Length < 1)
            {
                Console.Error.WriteLine("Usage: FbxPrint.exe FILENAME [ FILENAME ... ]");
                return;
            }

            bool tokens = false;
            bool parse  = false;

            foreach (var filename in args)
            {
                if (filename == "--tokens")
                {
                    tokens = true;
                    continue;
                }
                if (filename == "--parse")
                {
                    parse = true;
                    continue;
                }

                if (tokens)
                {
                    using (var reader = new StreamReader(filename))
                    {
                        var t     = new Tokenizer(reader, filename: filename);
                        var token = t.GetNextToken();
                        while (token.HasValue)
                        {
                            var tt = token.Value;
                            Console.WriteLine("\"{0}\", {1}, {2}", tt.Value, tt.Type, tt.Location);
                            token = t.GetNextToken();
                        }
                    }
                    continue;
                }
                if (parse)
                {
                    using (var reader = new StreamReader(filename))
                    {
                        var p    = new Parser(new Tokenizer(reader, filename: filename));
                        var objs = p.ReadFile();
                        foreach (var obj in objs)
                        {
                            PrintParseObject(obj);
                        }
                    }
                    continue;
                }
                var importer = new FbxImporter(filename);
                var scene    = importer.Import(filename);

                var printer = new FbxSharp.ObjectPrinter();
                printer.PrintObjectGraph(scene);
            }
        }
Пример #3
0
        public static void Main(string [] args)
        {
            if (args == null || args.Length < 1)
            {
                Console.Error.WriteLine("Usage: FbxPrint.exe FILENAME [ FILENAME ... ]");
                return;
            }

            foreach (var filename in args)
            {
                var importer = new FbxImporter(filename);
                var scene    = importer.Import(filename);

                var printer = new FbxSharp.ObjectPrinter();
                printer.PrintObjectGraph(scene);
            }
        }
Пример #4
0
        public static void Main(string [] args)
        {
            Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture;


            if (args == null || args.Length < 1)
            {
                Console.Error.WriteLine("Usage: FbxPrint.exe FILENAME [ FILENAME ... ]");
                return;
            }

            foreach (var filename in args)
            {
                var importer = new FbxImporter(filename);
                var scene    = importer.Import(filename);

                var printer = new FbxSharp.ObjectPrinter();
                printer.PrintObjectGraph(scene);
            }
        }