コード例 #1
0
        private static void ConvertScoToGltf(FileConversionParameter parameter)
        {
            WadEntry     staticObjectWadEntry = parameter.Parameter;
            StaticObject staticObject         = StaticObject.ReadSCO(staticObjectWadEntry.GetDataHandle().GetDecompressedStream());
            ModelRoot    gltf = staticObject.ToGltf();

            gltf.SaveGLB(Path.ChangeExtension(parameter.OutputPath, "glb"));
        }
コード例 #2
0
        public static void CreateSimpleSkinFromLegacy(CreateSimpleSkinFromLegacy opts)
        {
            StaticObject staticObject = StaticObject.ReadSCO(opts.StaticObjectPath);
            WGTFile      weightFile   = new WGTFile(opts.WeightFilePath);
            SimpleSkin   simpleSkin   = new SimpleSkin(staticObject, weightFile);

            simpleSkin.Write(opts.SimpleSkinPath);
        }
コード例 #3
0
        private static void ConvertScoToGltf(FileConversionParameter parameter)
        {
            WADEntry staticObjectWadEntry = parameter.Parameter;

            using MemoryStream stream = new MemoryStream(staticObjectWadEntry.GetContent(true));
            StaticObject staticObject = StaticObject.ReadSCO(stream);
            ModelRoot    gltf         = staticObject.ToGltf();

            gltf.SaveGLB(Path.ChangeExtension(parameter.OutputPath, "glb"));
        }
コード例 #4
0
        private static void ConvertScoToObj(FileConversionParameter parameter)
        {
            WadEntry     staticObjectWadEntry = parameter.Parameter;
            StaticObject staticObject         = StaticObject.ReadSCO(staticObjectWadEntry.GetDataHandle().GetDecompressedStream());
            var          objs = staticObject.ToObj();

            string baseName = Path.GetFileNameWithoutExtension(parameter.OutputPath);

            foreach ((string material, OBJFile obj) in objs)
            {
                string objPath = parameter.OutputPath.Replace(baseName, baseName + '_' + material);
                obj.Write(objPath);
            }
        }
コード例 #5
0
        public override void reader(MFileObject file, string optionsString, FileAccessMode mode)
        {
            if (mode == FileAccessMode.kImportAccessMode)
            {
                string name = Path.GetFileNameWithoutExtension(file.expandedFullName).Replace('.', '_');

                StaticObject scb = StaticObject.ReadSCO(file.expandedFullName);
                scb.Load(name);
            }
            else
            {
                throw new ArgumentException("SCOImporter:reader - Invalid File Access Mode: " + mode, "mode");
            }
        }
コード例 #6
0
        private static void ConvertScoToObj(FileConversionParameter parameter)
        {
            WADEntry staticObjectWadEntry = parameter.Parameter;

            using MemoryStream stream = new MemoryStream(staticObjectWadEntry.GetContent(true));
            StaticObject staticObject = StaticObject.ReadSCO(stream);
            var          objs         = staticObject.ToObj();

            string baseName = Path.GetFileNameWithoutExtension(parameter.OutputPath);

            foreach ((string material, OBJFile obj) in objs)
            {
                string objPath = parameter.OutputPath.Replace(baseName, baseName + '_' + material);
                obj.Write(objPath);
            }
        }