Skip to content

Stuck in Loop without an Animation #37

@doomed999

Description

@doomed999

On the M2Utility - PostProcessImports() The for loop can crash, I haven't dove into to see why, but I added a try/catch so it could fail the needed ones and still end up clearing the queue.

                try
                {

                    if (metadata.textureTransforms.Count > 0 && metadata.textureTransforms[0].translation.timestamps.Count > 0)
                    {
                        for (int i = 0; i < metadata.textureTransforms.Count; i++)
                        {
                            Debug.Log("Creating animation clips for: " + metadata.fileName);
                            Debug.Log("Creating animation clip metadata.textureTransforms[i].translation.timestamps.Count: " + metadata.textureTransforms[i].translation.timestamps.Count);
                            Debug.Log("Creating animation clip metadata.textureTransforms[i].translation.values.Count" + metadata.textureTransforms[i].translation.values.Count);
                            AnimationClip newClip = AnimationUtility.CreateAnimationClip(metadata.textureTransforms[i]);
                            AssetDatabase.CreateAsset(newClip, Path.GetDirectoryName(path) + "/" + Path.GetFileNameWithoutExtension(path) + "[" + i + "]" + ".anim");
                        }
                    }
                }
                catch (Exception e)
                {
                    Debug.LogError("Failed to create animation clip for: " + metadata.fileName);
                    Debug.LogError(e);
                }

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions