From 3190f7b041c342126d1768bf18bc15c752c264d5 Mon Sep 17 00:00:00 2001 From: Alvani Wiwoho Date: Fri, 3 Mar 2017 16:26:24 +0700 Subject: [PATCH] Fix animation name and remove parameters property --- GlTF_Animation.cs | 6 ++---- SceneToGlTFWiz.cs | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/GlTF_Animation.cs b/GlTF_Animation.cs index 729a52d..77ccc72 100644 --- a/GlTF_Animation.cs +++ b/GlTF_Animation.cs @@ -5,7 +5,6 @@ public class GlTF_Animation : GlTF_Writer { public List channels = new List(); - public GlTF_Parameters parameters; public List animSamplers = new List(); bool gotTranslation = false; bool gotRotation = false; @@ -154,13 +153,12 @@ public void PopulateAccessor(AnimationClipCurveData cd, Keyframe[] refKeyFrames) Dictionary boneAnimData = new Dictionary(); GlTF_Accessor timeAccessor; - public GlTF_Animation (string n) { - name = n; - parameters = new GlTF_Parameters(n); + public GlTF_Animation () { } public void Populate (AnimationClip c, Transform tr) { + name = "anim_" + c.name + "_" + GlTF_Writer.GetNameFromObject(tr, true); // AnimationUtility.GetCurveBindings(c); // look at each curve // if position, rotation, scale detected for first time diff --git a/SceneToGlTFWiz.cs b/SceneToGlTFWiz.cs index 340d449..e669726 100644 --- a/SceneToGlTFWiz.cs +++ b/SceneToGlTFWiz.cs @@ -860,7 +860,7 @@ public static BoundsDouble Export(string path, Transform[] trs, Transform root, // int nClips = a.GetClipCount(); for (int i = 0; i < nClips; i++) { - GlTF_Animation anim = new GlTF_Animation(a.name); + GlTF_Animation anim = new GlTF_Animation(); anim.Populate (clips[i], tr); GlTF_Writer.animations.Add (anim); }