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")); }
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); }
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")); }
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); } }
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"); } }
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); } }