SchultzGames
Para tirar dúvidas, crie um tópico especifico na área "Dúvidas em Geral" e aguarde ser respondido. Evite comentar em tópicos não relacionados a sua dúvida :D
TÓPICOS RECENTES:
Tópico:
Postado em:
Postado por:
Jogo Mobile - Ultimate Flight Simulator - Real World SDK
Unity - FPS e CPU ???
Usar microfone na Unity
Jogo ficando escuro quando faço a Build pela cena menu
Dúvida sobre movimentação do personagem
[RESOLVIDO] ACESSAR SCRIPT DE OUTRO GAMEOBJECT
Para eu ter shader em meu projeto eu tenho que usar o hdrp ou o 3d padrao?
Rotate Camera Mobile
Sou modelador 3d (!!! Arquitetonico!!!) Disponivel !!!!!!
Preciso de alguém que saiba programação e Raycast
Servidor/cliente usando sockets
Assets carregados com addressables causando erro na versão "buildada"
Jogo multiplayer com salas - não vai para o lobby
Texto - Não escreve no 'play'. Clica mais não digita.
Error Unity Vulkan - Out of memory! (allocating memory for image)
Câmera Não esta renderizando na segunda janela.
Movimento da Câmera No Android
[RESOLVIDO] - Unity não está mais funcionando o "Build and Run"
Precisa de modelador com ou sem experiência
Duvida com "mesclagem" de animação
[TUTORIAL] Como fazer uma gota de água na Unity
Missoes Aparecerem aleatoriamente do nada
Dúvida pafra IOS
botoes não esta funcionando corretamente nem a fisica?
Duvida com NavMeshAgent
COMO AUMENTAR E DIMINUÍ A SENSIBILIDADE DO TOQUE POR CÓDICO (MOBILE)
A Licença da Unity só funciona se eu tiver Internet
Problema com OnTriggerEnter
Transparência ao colidir
bool para evitar de salvar frames repetido
Unity - Transições no AnimatorController rodando errado
problemas com "wall Jump" , atribuir força ao eixo X
Meu Jogo ja Esta Pronto! EXPERIMENTEM!!
JOSTICK NAO SE MOVE
botoes para mobile
ERRO NO SCRIPT FOME E SEDE ETC
CORTAR ARVORES E DROPAR
Configurar sistema
Unity - Sugestões da Loja
Standard Assets para UNITY 5 em ".unitypackage"
Problema com o Shader
[TUTORIAL] Sistema Simples de Falas
Velocímetro Bugado
Como faço para alinhar uma textura na posição absoluta do mundo no shader
Sobre o Tutorial de Cortar Arvores
Erro Mov Player
[TUTORIAL] VELOCIMETRO DE PONTEIRO
[TUTORIAL] Ligar/Desligar luz por Interruptor
Sistema de lampadas
Conversor de movimento do Unity para o MMD [Ajuda]
Script de configurações não esta funcionando corretamente
CAMERA BUGANDO NA TRANSIÇÃO DE CENA
Volante girando errado [AJUDA]
Novo Asset Sistema de Portas e Chaves
ERRO NAS RODAS DO CARRO
[TUTORIAL] Sistema de câmera em primeira pessoa SIMPLES
AJUDA PARA UM SISTEMA DE CHECKPOINT
Jogo offline com Loja?
Unity -TextMeshProUGUI- 1 das coisas q estão deixando a scene lenta p abrir
Detectar quando o animation curve chega no final
Problema com compilação para Android na Unity 2019.4.35
Aplicativo para IOS
Árvores feitas na Unity
RECRUTAMENTO WAR CORE FPS
[RESOLVIDO] Unity - Scrollbar não funciona
[TUTORIAL] AI que cria scripts para você, inclusive scripts para Unity !!!!
[RESOLVIDO] Animando Image na Unity não funciona
Hospedar um jogo multiplay na itch.io
Script para detetectar o movimento do player
Alguém ajuda com um erro por favor? PSDImporter.cs
[RESOLVIDO] - Unity - Rotação da Câmera - Mathf.Clamp não funciona
Alterar textura .unity3d
Comportamento do movimento do inimigo. Sair do caminho e Fugir
Procuro uma equipe
Ajuda Com Sala de Jogo Multiplayer
COMO FAZER A PORTA ABRIR SÓ EMPURRANDO ELA COM O PLAYER?
Visual Studio - Vend os Scripts na Aba "Modo de Exibição de Classe" soltos
app fica fechendo após mobile notification
[RESOLVIDO] Controlar dois player dentro de um jogo multiplay usando mirror
Unity - O Jogo fecha quando vai abrir a Scene
[TUTORIAL] Mudando material
Procuro programador Unity para jogo 2D
AJUDA REALISTIC CAR CONTROLLER
Chama para isqueiro
[RESOLVIDO] Ajuda para destruir objeto
Unity - Sistema de Giro da Tela - Ajuda pfv!
Unity - Touch na Tela do Celular
Dawn Of Hell - Horror Game BR (2022-2023)
Unity - Jogo online ou offline?
ANIMAÇÃO INIMIGO ESTÁ INDO PRA TUDO QUANTO É LADO
[RESOLVIDO] Erro de Script no Android
Bundle Assets, Resources, e Addressables
Jogo online (qual a melhor opção?)
Dúvida sobre como criar o inimigo IA!
Unity dando pause no jogo a cada 4 segundos
bom dia amigos eu sou meio lego nos scripts será que alguem pode me ajudar
JOGO "CHALLENGE" FINALIZADO E DISPONÍVEL PARA BAIXAR.
error CS0246
[TUTORIAL]Como Chamar Um Método Usando Uma String como Parametro
Dom Jun 04, 2023 2:41 pm
Ter maio 30, 2023 7:28 pm
Ter maio 30, 2023 6:04 am
Seg maio 29, 2023 7:53 pm
Sáb maio 27, 2023 3:11 pm
Sex maio 26, 2023 4:59 pm
Sex maio 26, 2023 11:27 am
Qui maio 25, 2023 10:33 am
Sáb maio 20, 2023 12:25 pm
Ter maio 16, 2023 5:43 pm
Ter maio 16, 2023 5:42 pm
Ter maio 09, 2023 7:42 pm
Seg maio 08, 2023 7:13 am
Seg maio 08, 2023 6:38 am
Seg maio 08, 2023 1:49 am
Sáb maio 06, 2023 11:44 pm
Sáb maio 06, 2023 6:42 pm
Sáb maio 06, 2023 1:35 am
Qua maio 03, 2023 12:32 pm
Seg maio 01, 2023 8:51 pm
Seg maio 01, 2023 12:29 pm
Dom Abr 30, 2023 8:49 pm
Dom Abr 30, 2023 5:06 pm
Sáb Abr 29, 2023 4:05 pm
Qui Abr 27, 2023 4:39 pm
Qui Abr 27, 2023 12:40 am
Ter Abr 25, 2023 5:33 pm
Ter Abr 25, 2023 10:23 am
Dom Abr 23, 2023 12:11 am
Sáb Abr 22, 2023 4:27 am
Sex Abr 21, 2023 11:38 pm
Sex Abr 21, 2023 10:21 pm
Qui Abr 20, 2023 4:57 pm
Qui Abr 20, 2023 12:28 pm
Qua Abr 19, 2023 3:03 pm
Qua Abr 19, 2023 1:52 pm
Qua Abr 19, 2023 11:59 am
Qua Abr 19, 2023 11:54 am
Sáb Abr 15, 2023 8:13 pm
Sex Abr 14, 2023 7:43 am
Qui Abr 13, 2023 4:36 pm
Qui Abr 13, 2023 4:36 pm
Qua Abr 12, 2023 6:05 pm
Ter Abr 11, 2023 6:22 pm
Seg Abr 10, 2023 7:33 pm
Seg Abr 10, 2023 3:25 pm
Dom Abr 09, 2023 8:53 pm
Dom Abr 09, 2023 7:26 pm
Dom Abr 09, 2023 5:59 pm
Dom Abr 09, 2023 12:06 am
Sex Abr 07, 2023 7:24 pm
Qui Abr 06, 2023 6:45 am
Qua Abr 05, 2023 9:24 am
Ter Abr 04, 2023 4:55 pm
Ter Abr 04, 2023 1:00 pm
Dom Abr 02, 2023 11:52 pm
Sex Mar 31, 2023 12:50 pm
Sex Mar 31, 2023 11:03 am
Sex Mar 31, 2023 10:05 am
Qua Mar 29, 2023 7:48 pm
Ter Mar 28, 2023 10:50 pm
Ter Mar 28, 2023 9:19 am
Seg Mar 27, 2023 10:16 am
Dom Mar 26, 2023 7:39 pm
Qui Mar 23, 2023 4:52 pm
Ter Mar 21, 2023 11:20 pm
Ter Mar 21, 2023 8:52 pm
Sáb Mar 18, 2023 8:41 pm
Sex Mar 17, 2023 3:12 pm
Sex Mar 17, 2023 1:24 pm
Seg Mar 13, 2023 10:45 pm
Seg Mar 13, 2023 9:48 pm
Seg Mar 13, 2023 8:24 pm
Seg Mar 13, 2023 7:17 pm
Dom Mar 12, 2023 10:27 pm
Dom Mar 12, 2023 7:22 pm
Sex Mar 10, 2023 8:26 pm
Sex Mar 10, 2023 8:00 pm
Qui Mar 09, 2023 9:05 am
Ter Mar 07, 2023 2:27 pm
Sex Mar 03, 2023 6:47 pm
Sex Mar 03, 2023 12:01 am
Qui Mar 02, 2023 4:00 pm
Qui Mar 02, 2023 1:35 pm
Qua Mar 01, 2023 5:47 pm
Qua Mar 01, 2023 2:11 am
Seg Fev 27, 2023 11:08 pm
Seg Fev 27, 2023 7:19 pm
Dom Fev 26, 2023 11:49 pm
Dom Fev 26, 2023 8:29 pm
Dom Fev 26, 2023 7:47 pm
Dom Fev 26, 2023 7:46 pm
Dom Fev 26, 2023 6:08 pm
Sáb Fev 25, 2023 8:16 pm
Seg Fev 13, 2023 7:02 pm
Seg Fev 13, 2023 2:44 am
Dom Fev 12, 2023 9:57 pm
Dom Fev 12, 2023 2:19 pm
Sáb Fev 11, 2023 1:01 pm



































































































Conversor de movimento do Unity para o MMD [Ajuda]

Ir para baixo

DÚVIDA Conversor de movimento do Unity para o MMD [Ajuda]

Mensagem por AGAMENOM Qua Abr 05, 2023 4:15 am

Bem eu estou fazendo um script que salva os movimentos para o MMD. Mas ele está com alguns erros.

Sendo estes erro na convenção da rotação e movimento dos osso.

No vídeo eu explico melhor.


Se caso alguém quiser dar uma olhada e tentar me ajudar estou deixado o arquivo para baixar.
Miku Miku Dance Collection.rar
AGAMENOM
AGAMENOM
Avançado
Avançado

Masculino PONTOS : 1243
REPUTAÇÃO : 15
Idade : 20
Respeito as regras : Conversor de movimento do Unity para o MMD [Ajuda] WvDYdlf

https://paradoxicaltimegam.wixsite.com/paradoxicaltime

Ir para o topo Ir para baixo

DÚVIDA Re: Conversor de movimento do Unity para o MMD [Ajuda]

Mensagem por AGAMENOM Dom Abr 09, 2023 12:06 am

Olá bem eu consegui fazer ele funcionar.
Então eu queria saber se da para fazer uma bool para evitar de salvar frames repetido.

exemplo de como ele esta salvado no estado atual:

Nome do Osso,0,-0.385,-0.631,0.213,0,0,0
Nome do Osso,1,-0.385,-0.631,0.213,0,0,0
Nome do Osso,2,-0.385,-0.631,0.213,0,0,0
Nome do Osso,3,-0.385,-0.631,0.213,0,0,0
Nome do Osso,4,-0.385,-0.631,0.213,0,0,0
Nome do Osso,5,-0.385,-0.631,0.213,0,0,0

Ai se a bool fosso ativa ele so salvava o primeiro e o último com os valores repetidos:

Nome do Osso,0,-0.385,-0.631,0.213,0,0,0
Nome do Osso,5,-0.385,-0.631,0.213,0,0,0

Assim evitaria de salvar frames necessários no arquivo.

Script que Salva o arquivo:
Código:
using System.Globalization;
using System.IO;
using UnityEngine;
using System.Text;

public class ModelRecorderSave : MonoBehaviour
{
    [Header("Model Recorder Save")]
    [SerializeField] private string FileSave = "Miku Miku Dance Collection/Save Movements/Movement/TestMovement.csv"; // CSV file name.
    [SerializeField] private string ModelName = "TestModel"; // model name.
    [SerializeField] private int KeyFrameSaves; // number of keyframes saved.
    [Space(5)]
    [Header("Settings.")]
    [SerializeField] private Animator animator; // model animator.
    [SerializeField] private int savingsReduction = 3; // keyframe reduction.
    [SerializeField] private bool SkipFirstFrame = false; // whether to skip the first frame or not.
    [Space(5)]
    [Header("MMD Frame Counter")]
    [SerializeField] private int MMDFrameCount = 0; // MMD frame counter.
    [Space(5)]
    [Header("All ModelRecorder Scripts.")]
    [SerializeField] private ModelRecorder[] recorders; // array of all ModelRecorder scripts in the model.
    [Space(5)]
    [SerializeField] private VMDRecorderSampleInformation Information; // VMDRecorder information.

    private static readonly float MMDFrameTime = 0.033333f; // time between each MMD frame.
    private float elapsedTimeCharacter = 0f; // elapsed time of the character.

    private float animationLength; // total duration of the animation.
    private bool EndAnimation = false; // if the animation has come to an end.

    private static readonly string Format = "Vocaloid Motion Data 0002"; // CSV file format.
    private static readonly int codeType = 0; // code type in CSV file.

    private void Awake()
    {
        animationLength = animator.GetCurrentAnimatorStateInfo(0).length;  // gets the total duration of the animation.

        recorders = FindObjectsOfType<ModelRecorder>(); // Get all ModelRecorder scripts in sena.

        // configures each ModelRecorder script.
        foreach (ModelRecorder recorder in recorders)
        {
            recorder.animator = animator;
            recorder.SavingsReduction = savingsReduction;

            if(SkipFirstFrame == true)
            {
                recorder.SkipFirstFrame = true;
            }
            else
            {
                recorder.SkipFirstFrame = false;
            }
        }
    }

    void Update()
    {
        animationLength -= Time.deltaTime;

        // when the animation comes to an end, it saves the CSV file.
        if (animationLength <= 0 && !EndAnimation)
        {
            EndAnimation = true;
            Save();
        }

        // if the animation has not yet reached the end, it updates the MMD frame counter.
        if (EndAnimation == false)
        {
            elapsedTimeCharacter += Time.deltaTime;

            if (elapsedTimeCharacter >= MMDFrameTime)
            {
                MMDFrameCount++;
                elapsedTimeCharacter -= MMDFrameTime;
            }
        }
    }

    void Save()
    {
        // gets the total number of keyframes saved.
        int totalSaves = 0;
        foreach (ModelRecorder recorder in recorders)
        {
            totalSaves += recorder.animationRecorder.Count;
        }

        KeyFrameSaves = totalSaves;

        string filePath = Application.dataPath + "/" + FileSave; // full path of CSV file.
        var encoding = Encoding.GetEncoding("shift_jis"); // Set file encoding to Shift_JIS.

        // creates a CSV file and writes the information to it.
        using (StreamWriter writer = new StreamWriter(filePath, false, encoding))
        {
            writer.WriteLine(Format + "," + codeType); // writes the first line with the format and code type.
            writer.WriteLine(ModelName); // write the name of the model.
            writer.WriteLine(KeyFrameSaves); // writes the number of keyframes saved.

            // for each ModelRecorder script, it writes the information of the saved animations.
            foreach (ModelRecorder recorder in recorders)
            {
                string boneName = recorder.BoneName;

                foreach (AnimationRecorder animRecorder in recorder.animationRecorder)
                {
                    int frame = animRecorder.Frame;
                    float xMovement = animRecorder.XMovement;
                    float yMovement = animRecorder.YMovement;
                    float zMovement = animRecorder.ZMovement;
                    float xRotation = animRecorder.XRotation;
                    float yRotation = animRecorder.YRotation;
                    float zRotation = animRecorder.ZRotation;

                    // Replacing commas with periods in variables.
                    string xMovementStr = xMovement.ToString(CultureInfo.InvariantCulture);
                    string yMovementStr = yMovement.ToString(CultureInfo.InvariantCulture);
                    string zMovementStr = zMovement.ToString(CultureInfo.InvariantCulture);
                    string xRotationStr = xRotation.ToString(CultureInfo.InvariantCulture);
                    string yRotationStr = yRotation.ToString(CultureInfo.InvariantCulture);
                    string zRotationStr = zRotation.ToString(CultureInfo.InvariantCulture);

                    // Writes the line with the current Key Frame information.
                    writer.WriteLine(boneName + "," + (frame - 1) + "," + xMovementStr + "," + yMovementStr + "," + zMovementStr + "," + xRotationStr + "," + yRotationStr + "," + zRotationStr);
                }
            }

            // Write the additional information at the end of the file.
            writer.WriteLine(codeType);
            writer.WriteLine(codeType);
            writer.WriteLine(codeType);
        }
        Debug.Log("Completion of CSV file creation"); // Displays a message on the console confirming the creation of the CSV file.

        Information.CharacterIsOver = true; // Sets the CharacterIsOver variable to true, indicating that character animation is complete.
    }
}

O Script que grava a animação se acharem necessário para compreender o código.
Código:
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;

public class ModelRecorder : MonoBehaviour
{
    [Header("Settings.")]
    public Animator animator; // Animator component to record.
    [SerializeField] private Transform boneTransform; // variable to store the Transform of the bone that will be recorded.
    public ExtraArmRotation extraArmRotation; // ExtraArmRotation Script.
    public string BoneName; // Name of the bone to record.
    public bool RecorderRotation; // Whether to record rotation.
    public bool RecorderMovement; // Whether to record movement.
    public bool ZeroNegativeY; // Controls whether the Y-axis movement should be constrained to zero if the object is moving downwards.
    [Space(10)]
    [Header("MMD Frame Counter")]
    public int MMDFrameCount = 0; // Counter for MikuMikuDance frame count.
    public int SavingsReduction = 3; // Reduction rate for number of frames to save.
    public bool SkipFirstFrame; // Controls whether the first frame will be skipped or not.
    [Space(10)]
    public List<AnimationRecorder> animationRecorder = new List<AnimationRecorder>(); // List of recorded animations.
    [Space(10)]
    public Vector3 initialPosition; // Initial position of the character.

    private static float mmdFrameTime = 0.033333f; // Time for each MMD frame.
    private float elapsedTimeCharacter = 0f; // Elapsed time for the character since last MMD frame.
    private bool FirstFrame = true; // Tracks whether this is the first frame or not.
    private float animationLength; // The length of the current animation.
    private bool EndAnimation = false; // Whether the animation has ended.

    // Adds the LateUpdate() method to the call queue of EditorApplication.delayCall() in Awake().
    private void Awake()
    {
        EditorApplication.delayCall += LateUpdate;
    }

    private void Start()
    {
        animationLength = animator.GetCurrentAnimatorStateInfo(0).length; // Get the length of the current animation.
    }

    // Removes the LateUpdate() method from the call queue of EditorApplication.delayCall() in OnDisable().
    private void OnDisable()
    {
        EditorApplication.delayCall -= LateUpdate;
    }

    void Update()
    {
        animationLength -= Time.deltaTime;  // Decrease the length of the animation by the time passed since the last frame.

        // If the animation has ended and EndAnimation is false.
        if (animationLength <= 0 && !EndAnimation)
        {
            // Ensures last MMD frame is saved if SavingsReduction is greater than 0.
            if (EndAnimation == false && SavingsReduction > 0)
            {
                Recorder(); // Record animation data.
            }

            EndAnimation = true; // Set EndAnimation to true.
        }
    }

    private void LateUpdate()
    {
        // Checks if this is the first time LateUpdate has been called.
        if (FirstFrame && SkipFirstFrame)
        {
            // If so, set FirstFrame to false and return immediately, skipping the first frame.
            FirstFrame = false;
            return;
        }

        // If the animation has not ended.
        if (EndAnimation == false)
        {
            elapsedTimeCharacter += Time.deltaTime; // Add the time passed since the last frame to elapsedTimeCharacter.

            // If the elapsed time for the character since the last MMD frame is greater than or equal to the time for each MMD frame.
            if (elapsedTimeCharacter >= mmdFrameTime)
            {
                MMDFrameCount++; // Increment the MMD frame count.

                // If SavingsReduction is 0 or the MMD frame count is divisible by SavingsReduction.
                if (SavingsReduction == 0 || MMDFrameCount % SavingsReduction == 0)
                {
                    Recorder(); // Record animation data.
                }

                // Ensures first MMD frame is saved if SavingsReduction is greater than 0.
                if (SavingsReduction > 0 && MMDFrameCount == 1)
                {
                    Recorder(); // Record animation data.
                }

                elapsedTimeCharacter -= mmdFrameTime; // Subtract the time for each MMD frame from elapsedTimeCharacter.
            }
        }
    }

    // Records the animation data.
    void Recorder()
    {
        AnimationRecorder animRec = new AnimationRecorder(); // Create new animation recording object.

        // If motion recording is enabled, records the object's position relative to its starting position.
        if (RecorderMovement == true)
        {
            Vector3 currentPosition = transform.position;
            Vector3 recordedPosition = currentPosition - initialPosition; // Calculate the movement since the initial position.
            float scale = 0.08f;
            animRec.XMovement = Mathf.Round(-recordedPosition.x / scale * 1000f) / 1000f; // Round and save X-axis movement.
            animRec.ZMovement = Mathf.Round(-recordedPosition.z / scale * 1000f) / 1000f; // Round and save Z-axis movement.

            // Checks whether or not to readjust the Y movement value.
            if (ZeroNegativeY == true)
            {
                // Checks if the Y coordinate value is less than zero.
                if (recordedPosition.y <0)
                {
                    recordedPosition.y = 0; // If yes, sets the Y coordinate value to zero.
                }

                animRec.YMovement = Mathf.Round(recordedPosition.y / scale * 1000f) / 1000f; // Round and save Y-axis movement.
            }
            else
            {
                animRec.YMovement = Mathf.Round(recordedPosition.y / scale * 1000f) / 1000f; // Round and save Y-axis movement.
            }
        }

        // If rotation recording is enabled, records the object's rotation relative to its initial rotation.
        if (RecorderRotation == true)
        {
            Transform boneTransform = this.boneTransform;
            Vector3 currentRotation = boneTransform.localEulerAngles;
            Vector3 recordedRotation = currentRotation;

            // Check if extraArmRotation is empty.
            if (extraArmRotation != null)
            {
                // If extraArmRotation is attached to it adds the extra rotations to the animation.
                Vector3 extraRotation = new Vector3(recordedRotation.x + extraArmRotation.rotacaoX, recordedRotation.y + extraArmRotation.rotacaoY, recordedRotation.z + extraArmRotation.rotacaoZ);

                // Normalizes the rotation angles to fall within the range of -180 to 180 degrees.
                float xRotation = NormalizeAngle(extraRotation.x);
                float yRotation = NormalizeAngle(extraRotation.y);
                float zRotation = NormalizeAngle(extraRotation.z);

                // Checks that the normalized angles are in the correct range and adjusts them if necessary.
                if (xRotation > 180)
                {
                    xRotation = xRotation - 360;
                }

                if (yRotation > 180)
                {
                    yRotation = yRotation - 360;
                }

                if (zRotation > 180)
                {
                    zRotation = zRotation - 360;
                }

                // Rounds and saves rotations on the X, Y, and Z axes.
                animRec.XRotation = Mathf.Round(-xRotation * 1000f) / 1000f;
                animRec.YRotation = Mathf.Round(yRotation * 1000f) / 1000f;
                animRec.ZRotation = Mathf.Round(-zRotation * 1000f) / 1000f;
            }
            else
            {
                // Normalizes the rotation angles to fall within the range of -180 to 180 degrees.
                float xRotation = NormalizeAngle(recordedRotation.x);
                float yRotation = NormalizeAngle(recordedRotation.y);
                float zRotation = NormalizeAngle(recordedRotation.z);

                // Checks that the normalized angles are in the correct range and adjusts them if necessary.
                if (xRotation > 180)
                {
                    xRotation = xRotation - 360;
                }

                if (yRotation > 180)
                {
                    yRotation = yRotation - 360;
                }

                if (zRotation > 180)
                {
                    zRotation = zRotation - 360;
                }

                // Rounds and saves rotations on the X, Y, and Z axes.
                animRec.XRotation = Mathf.Round(-xRotation * 1000f) / 1000f;
                animRec.YRotation = Mathf.Round(yRotation * 1000f) / 1000f;
                animRec.ZRotation = Mathf.Round(-zRotation * 1000f) / 1000f;
            }
        }

        animRec.Frame = MMDFrameCount; // Saves the current animation frame number to the footage object.

        animationRecorder.Add(animRec); // Add the current animation recording to the list of animation recorders.
    }
   
    private float NormalizeAngle(float angle)
    {
        // If the angle is greater than 180, subtract 360 to get its equivalent negative angle.
        if (angle > 180f)
        {
            angle -= 360f;
        }

        return angle; // Returns the normalized angle.
    }
}

// A class to store the animation recording data.
[System.Serializable]
public class AnimationRecorder
{
    [Header("Animation Recorder.")]
    public int Frame; // The frame number of the recorded animation.
    [Space(10)]
    public float XRotation; // The X-axis rotation of the recorded frame.
    public float YRotation; // The Y-axis rotation of the recorded frame.
    public float ZRotation; // The Z-axis rotation of the recorded frame.
    [Space(10)]
    public float XMovement; // The X-axis movement of the recorded frame.
    public float YMovement; // The Y-axis movement of the recorded frame.
    public float ZMovement; // The Z-axis movement of the recorded frame.
}
AGAMENOM
AGAMENOM
Avançado
Avançado

Masculino PONTOS : 1243
REPUTAÇÃO : 15
Idade : 20
Respeito as regras : Conversor de movimento do Unity para o MMD [Ajuda] WvDYdlf

https://paradoxicaltimegam.wixsite.com/paradoxicaltime

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

 
Permissões neste sub-fórum
Não podes responder a tópicos