briochie / wow.unity

A collection of assets to make working with wow.export easier in Unity.
MIT License
22 stars 7 forks source link

Stuck in Loop without an Animation #37

Open doomed999 opened 2 weeks ago

doomed999 commented 2 weeks ago

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

briochie commented 2 weeks ago

Honestly, may just remove the whole animation clip creation system. I'm not happy with it's implementation, and I've frankly never used it. I just recreate the effects in a shader.

Would love opinions on that before I just take a knife to features, though.

doomed999 commented 2 weeks ago

I haven't used the tool enough to see what it does. I think in the instance of what I am doing it might come in handy and I don't want to learn about shaders yet! I'm working on some mass world imports so recreating all of the effects might be painful.

doomed999 commented 1 week ago

Playing around some more, the animation clips aren't even being applied to the prefabs :) I see where they come in now and kind of agree! Probably better ways to accomplish what the goal was for this.