コード例 #1
0
        /// <summary>
        /// Exports all models from the target bfres to the selected folder.
        /// Returns array with the converted file names, it's NULL if no models were converted
        /// </summary>
        /// <param name="bfres">Source brfs</param>
        /// <param name="outDir">Target directory</param>
        /// <returns></returns>
        public static string[] Convert(byte[] bfres, string outDir)
        {
            if (bfres == null)
            {
                return(null);
            }
            BFRES s = new BFRES();

            s.Read(bfres);
            Export(outDir, s);
            var res = s.models.Count == 0 ? null : s.models.Select(x => x.name).ToArray();

            s = null;
            GC.Collect();
            return(res);
        }
コード例 #2
0
        public static bool GetTextures(byte[] bfres, string Folder)
        {
            if (bfres == null)
            {
                return(false);
            }
            BFRES s = new BFRES();

            s.Read(bfres);
            ExportTextures(s, Folder);
            bool res = s.models.Count != 0;

            s = null;
            GC.Collect();
            return(res);
        }
コード例 #3
0
        public static bool Convert(byte[] bfres, string outPath)
        {
            if (bfres == null)
            {
                return(false);
            }
            BFRES s = new BFRES();

            s.Read(bfres);
            Export(outPath, s);
            bool res = s.models.Count != 0;

            s = null;
            GC.Collect();
            return(res);
        }
コード例 #4
0
        public static bool GetTextures(byte[] bfres, string Folder)
        {
            if (bfres == null)
            {
                return(false);
            }
            BFRES s = new BFRES();

            s.Read(bfres);
            ExportTextures(s, Folder);
            GC.Collect();
            if (s.textures.Count == 0)
            {
                return(false);
            }
            return(true);
        }
コード例 #5
0
        public static bool Convert(byte[] bfres, string outPath)
        {
            if (bfres == null)
            {
                return(false);
            }
            BFRES s = new BFRES();

            s.Read(bfres);
            Export(outPath, s);
            GC.Collect();
            if (s.models.Count == 0)
            {
                return(false);
            }
            return(true);
        }