예제 #1
0
파일: Program.cs 프로젝트: Cryru/Emotion
        public static void AssimpToEm3(string[] args, string filePath)
        {
            var animations = new List <string>();
            var offset     = 0;

            while (CommandLineParser.FindArgument(args, "AddAnim=", out string animPath, offset))
            {
                animations.Add(animPath);
                offset++;
            }

            var loadedEntity = Engine.AssetLoader.Get <AssimpAsset>(filePath);

            if (loadedEntity == null)
            {
                return;
            }
            for (var i = 0; i < animations.Count; i++)
            {
                var animation = Engine.AssetLoader.Get <AssimpAsset>(animations[i]);
                loadedEntity.Entity.Animations = Extensions.JoinArrays(loadedEntity.Entity.Animations, animation.Entity.Animations);
            }

            Engine.Log.Info($"Saving entity {loadedEntity.Entity.Name} with {loadedEntity.Entity.Animations.Length} animations.", ToolLogger.Tool);
            string nameWithoutExtension = AssetLoader.GetFilePathNoExtension(loadedEntity.Name);

            Engine.AssetLoader.Save(EmotionMeshAsset.EntityToByteArray(loadedEntity.Entity), $"AssetsOutput/{nameWithoutExtension}.em3", false);
        }
예제 #2
0
파일: Program.cs 프로젝트: Cryru/Emotion
        public static void ObjToEm3(string objPath)
        {
            var loadedEntity = Engine.AssetLoader.Get <ObjMeshAsset>(objPath);

            Engine.Log.Info($"Saving entity {loadedEntity.Entity.Name}.", ToolLogger.Tool);
            string nameWithoutExtension = AssetLoader.GetFilePathNoExtension(loadedEntity.Name);

            Engine.AssetLoader.Save(EmotionMeshAsset.EntityToByteArray(loadedEntity.Entity), $"AssetsOutput/{nameWithoutExtension}.em3", false);
        }