Пример #1
0
        // ------------- COMMANDS ------------- \\

        public static void ConvertSimpleSkin(SimpleSkinToGltf opts)
        {
            SimpleSkin simpleSkin = ReadSimpleSkin(opts.SimpleSkinPath);
            var        gltf       = simpleSkin.ToGltf(opts.MaterialTextures);

            gltf.Save(opts.OutputPath);
        }
Пример #2
0
        private static void ConvertSimpleSkinToGltf(FileConversionParameter parameter)
        {
            WadEntry   simpleSkinWadEntry = parameter.Parameter;
            SimpleSkin simpleSkin         = new SimpleSkin(simpleSkinWadEntry.GetDataHandle().GetDecompressedStream());
            ModelRoot  gltf = simpleSkin.ToGltf();

            gltf.SaveGLB(Path.ChangeExtension(parameter.OutputPath, "glb"));
        }
Пример #3
0
        public static void ConvertSkinnedModel(SkinnedModelToGltf opts)
        {
            SimpleSkin simpleSkin = ReadSimpleSkin(opts.SimpleSkinPath);
            Skeleton   skeleton   = ReadSkeleton(opts.SkeletonPath);

            var gltf = simpleSkin.ToGltf(skeleton, opts.MaterialTextures, opts.Animations);

            gltf.Save(opts.OutputPath);
        }
Пример #4
0
        private static void ConvertSimpleSkinToGltf(FileConversionParameter parameter)
        {
            WADEntry simpleSkinWadEntry = parameter.Parameter;

            using MemoryStream stream = new MemoryStream(simpleSkinWadEntry.GetContent(true));
            SimpleSkin simpleSkin = new SimpleSkin(stream);
            ModelRoot  gltf       = simpleSkin.ToGltf();

            gltf.SaveGLB(Path.ChangeExtension(parameter.OutputPath, "glb"));
        }
Пример #5
0
        private static void ConvertSimpleSkinWithSkeletonToGltf(FileConversionParameter parameter)
        {
            WadEntry simpleSkinWadEntry = parameter.Parameter;
            WadEntry skeletonWadEntry   = parameter.AdditionalParameters.FirstOrDefault(x => x.Item1 == FileConversionAdditionalParameterType.Skeleton).Item2;

            SimpleSkin simpleSkin = new SimpleSkin(simpleSkinWadEntry.GetDataHandle().GetDecompressedStream());
            Skeleton   skeleton   = new Skeleton(skeletonWadEntry.GetDataHandle().GetDecompressedStream());

            ModelRoot gltf = simpleSkin.ToGltf(skeleton);

            gltf.SaveGLB(Path.ChangeExtension(parameter.OutputPath, "glb"));
        }
Пример #6
0
        static void Main(string[] args)
        {
            SimpleSkin simpleSkin = new SimpleSkin(@"C:\Users\Crauzer\Desktop\New folder\assets\characters\aatrox\skins\base\aatrox.skn");
            Skeleton   skeleton   = new Skeleton(@"C:\Users\Crauzer\Desktop\New folder\assets\characters\aatrox\skins\base\aatrox.skl");

            var textureMap = new Dictionary <string, MagickImage>()
            {
                { "Body", new MagickImage(@"C:\Users\Crauzer\Desktop\New folder\assets\characters\aatrox\skins\base\aatrox_base_tx_cm.dds") }
            };

            ModelRoot gltf = simpleSkin.ToGltf(skeleton, textureMap);

            gltf.SaveGLB(@"C:\Users\Crauzer\Desktop\New folder\assets\characters\aatrox\skins\base\aatrox.glb");
        }
Пример #7
0
        private static void ConvertSimpleSkinWithSkeletonToGltf(FileConversionParameter parameter)
        {
            WADEntry simpleSkinWadEntry = parameter.Parameter;
            WADEntry skeletonWadEntry   = parameter.AdditionalParameters.FirstOrDefault(x => x.Item1 == FileConversionAdditionalParameterType.Skeleton).Item2;

            using MemoryStream simpleSkinStream = new MemoryStream(simpleSkinWadEntry.GetContent(true));
            using MemoryStream skeletonStream   = new MemoryStream(skeletonWadEntry.GetContent(true));

            SimpleSkin simpleSkin = new SimpleSkin(simpleSkinStream);
            Skeleton   skeleton   = new Skeleton(skeletonStream);

            ModelRoot gltf = simpleSkin.ToGltf(skeleton);

            gltf.SaveGLB(Path.ChangeExtension(parameter.OutputPath, "glb"));
        }