- Home /
blender export, strip out scale curves
Hello,
I've seen a post about a user remove scale curves out of blender's FBX export. Can some information be provided as to how to do that or is there a script already available. I'm not sure if it as simple as changing the current export script and removing some code.
Thanks
thanks, I will also remove the position curves as well. Ther characters are all in a T Pose, just scaled differently to accomodate the differences in the meshes. I may need to try this with a simpler model and fewer bones.
Answer by Paulius-Liekis · Apr 24, 2013 at 06:58 PM
Derive from AssetPostprocessor class. Use AnimationUtils to get AnimationCurves from AnimationClip. Remove scale curves from the list of AnimationCurves.
Answer by ddesmond · Apr 25, 2013 at 02:58 AM
Hello and thanks for responding, for a test, I removed localscale curves and my animation looks odd. What I am trying to do is share an animation between 3 models with the same bones, but with different sizes.
I added the following code for a test: clip.SetCurve("Armature", typeof(Transform), "m_LocalScale", null); clip.SetCurve("Armature/hip", typeof(Transform), "m_LocalScale", null); clip.SetCurve("Armature/hip/abdomen", typeof(Transform), "m_LocalScale", null);
I see the scale difference, but the animation isn't working as expected. Is there a way to share the animation, I am using the legacy animation system as I want to do this in code.
I originally thought I could change the size of the bones and the animation would work.
Thanks
It's not a simple task, especially if there are differences between null/T/A-poses of your characters. Anyway the problem most likely is caused by the fact that your animation contain position curves, so they change "size of your bones". Try removing position curves too.
thanks, I will also remove the position curves as well. Ther characters are all in a T Pose, just scaled differently to accomodate the differences in the meshes. I may need to try this with a simpler model and fewer bones. Is there a difference between the child transform (bone objects) and the mesh renderer bones?
I am wondering if it would be easier to have different animations per armature. I was trying to avoid that as I have so many, but trying to share animations seems to difficult. If someone even has a product I can use, I would be interested in a paid solution as well.
The easier solution is to use the new animation system ($$anonymous$$ecanim) in Unity 4.0. It does retargeting for you.
Otherwise you break your characters into classes by size/proportions and have animations for those classes and use exactly same skeleton in on the models in the same class. That's how most the the games are done (the ones that do not use realtime retargeting)
Yes, I would have loved to use $$anonymous$$ecanim, unfortunately you don't have api access. I want to be able to change animations on the fly and access them via code. I think your second option is what I was avoiding, but where I am heading. Thanks alot for your input and advice.
Your answer
Follow this Question
Related Questions
Renaming an animation from FBX format 2 Answers
Blender to Unity FBX Problems 2 Answers
Problem in Game mode with animation 0 Answers
BlendShapes not Showing Up (Blender -> FBX -> Unity 2018.1) 2 Answers
Blender to Unity FBX requirements? 0 Answers