Editing Frame 0 and FBX Exporting

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
varmint
Posts: 5
Joined: Mon Sep 28, 2015 12:55 pm

Editing Frame 0 and FBX Exporting

Post by varmint »

Hey everyone, I've been struggling with this for a while but I think I'm pretty close though. This is an issue I've seen people asking about before without a lot of luck. I thought I'd see if anyone has any ideas or even shots in the dark to try.

It's about exporting to FBX and importing into Unity. I've nailed down a fairly reliable workflow/pipeline to get content created with AS Pro 11.1 into Unity. But there's still one last deal-breaking problem I haven't been able to conquer yet.
Anime Studio exports out frame 0 to the FBX for both the mainline animation as well as every animation from your actions window. So obviously every animation begins with a frame of the character in the bind pose I originally drew them in. Even if I start the animation at frame 1 in Unity, it still blends between the frame 0 bind post and the first frame of the animation. Both are unacceptable of course.

I honestly don't know why you'd ever want to export frame 0 so I assume this is a bug. In lieu of a bug fix, which might take months or a year, I'm looking for other workarounds.

* If there a way I can override the behavior of frame 0 or somehow copy and paste frame 1 data into frame 0?
* Could I accomplish the above via script?

I downloaded some trials of non-autodesk 3D FBX editors to open the exported FBX and remove frame 0. Unfortunately, doing so trashes the layer translation data so again, I'd need to do even further edits in a 3D program to get it to work. If I'm going to learn a 3D program, I'm just going to make 3D stuff! I'd rather use what I have, know and maybe works.

So anyway, I'm desperate and looking for any good ideas or suggestions for workarounds here. I just need some way to get my characters exported with their anims starting at frame 1 somehow OR I need a way to reliably copy frame 1 data into frame 0 either manually or by script.
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Editing Frame 0 and FBX Exporting

Post by dkwroot »

In Unity, you can set the animation range for FBX files. Just import an FBX file into Unity and click on it within the Assets folder. If you look at the inspector, you should see all of the actions listed under "Clips". Click on the action you want to alter and you'll see information for it below. You will also see the length of the action. Just set the "start" option from 0 to 1 and you're good to go.
varmint
Posts: 5
Joined: Mon Sep 28, 2015 12:55 pm

Re: Editing Frame 0 and FBX Exporting

Post by varmint »

Hi, thanks for the reply! Your suggestion is basically where my journey stopped before I posted. Here's what's going on.

For some reason after I import the model into Unity and I edit the original clip to begin on frame 1, the position of the layers get all jumbled and the characters just appear exploded. However, I found that if I make a NEW clip out of the source clip and edit THAT one, the model doesn't get quite as corrupted.

But two other things DO happen: One, the model still blends from the T-pose in frame 0 so the animation pop. I can't see where in Unity to tell it NOT to blend like that without a script call. If I start on frame 2, its not so bad but then I've thrown away a frame of animation and "not so bad" is a little lower bar than I prefer. Secondly, the animated layers get a weird 3D rotation to them that is not in the source FBX.

If I could solve those two problems I think I might be fine. I'm also exploring how horrible it would be to simply redo all the Frame 0's by hand so they begin on a valid start pose. Then make a different file for each starting pose. That'd be really cludgy though but it would work I think.

Anyway, thank you again for the response!
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Editing Frame 0 and FBX Exporting

Post by jahnocli »

I don't have AS 11, so this suggestion is something you may already have tried and discounted, but couldn't you move everything along with the sequencer before you export so that the animation starts on, say, frame 10? Then, in Unity, you could throw away the first nine frames...
You can't have everything. Where would you put it?
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Editing Frame 0 and FBX Exporting

Post by dkwroot »

In Anime Studio, go to the "View" menu and turn on "FBX Preview Mode" and then run your animation. Let us know if it runs right in the viewer or if it's wacky.
varmint
Posts: 5
Joined: Mon Sep 28, 2015 12:55 pm

Re: Editing Frame 0 and FBX Exporting

Post by varmint »

Hey that's a great idea, I hadn't thought of that! That looks like it will take care of the blending issue at least. I'm still left with weird rotation issue but I'm going to see what import settings I can noodle from unity and maybe see if its feasible to just write a script to crawl the FBX and fix anything that's rotated into a "3D" angle but that's more of a unity thing. I'll update the thread either way.

Thanks so much for the suggestion. That solves issue one of two :mrgreen:
varmint
Posts: 5
Joined: Mon Sep 28, 2015 12:55 pm

Re: Editing Frame 0 and FBX Exporting

Post by varmint »

dkwroot wrote:In Anime Studio, go to the "View" menu and turn on "FBX Preview Mode" and then run your animation. Let us know if it runs right in the viewer or if it's wacky.
I just sanity checked and all the animations look correct with FBX Preview Mode active. Converting everything over to not use unsupported features was the big step one. The characters are seriously pared down to pretty much bare skeletal structure as well. I limited myself to one vector layer per bone, as I was running into issues with layers becoming jumbled too.
dkwroot
Posts: 677
Joined: Thu May 02, 2013 6:56 am
Location: USA
Contact:

Re: Editing Frame 0 and FBX Exporting

Post by dkwroot »

Are you using bone offset or anything?
varmint
Posts: 5
Joined: Mon Sep 28, 2015 12:55 pm

Re: Editing Frame 0 and FBX Exporting

Post by varmint »

I'm pretty sure the remaining issue is a Unity problem. I was trying to import the model as "humanoid" because there are supposedly specific benefits in doing that. It's apparently super easy to re-use animations between models when they are imported as humanoid. But despite meeting all the criteria for humanoid skeletons, it's doing extra stuff that's adding weird rotation at the best case and causing the character to explode into pieces in a disturbing but somewhat spectacular manner worst case.

If I abandon using "humanoid" import settings and use "generic", combined with starting the animations at a later keyframe, it looks like I can get animations playing back properly in game. It sounds like, since I'm still using their newer mecanim system I can still swap out models but it may not be as easy as if they were humanoid.

There's also a distinct chance, all of this could be a Unity 5 bug. Since Unity 5 they've been overhauling their animation systtem. The latest non-release/test version of Unity 5.2 (which I'm NOT running) broke several pieces of their animation system. And I've seen some bug reports about 5.1 which I AM using, where people are having inexplicable import problems eerily similar to mine.

So I'm going to plug forward using the "generic" import settings for mecanim. There's a distinct chance it either may not matter and/or that whatever the weirdness could get fixed by the time the release version of Unity 5.2.

So if there's a TL;DR punchline to this whole thread; it's these two take aways if you are trying to get stuff exported to Unity:

1- You are going to have to deal with frame 0 getting exported out. This isn't actually a big deal though when Unity's animation system does what it's supposed too...
2- For the currently release version of Unity it seems like you must import the FBX as a "generic" mecanim animation. Humanoid seems to corrupt the model. I didn't look at the "legacy" setting as Unity doesn't recommend using it any longer.
ilovelessons
Posts: 52
Joined: Sat Dec 03, 2016 12:11 pm

Re: Editing Frame 0 and FBX Exporting

Post by ilovelessons »

Hi am using Moho 12 Pro,

I am presently experiencing the same problem in my animation. I used the offset bones to create my character. However when I view in Moho before I exported it everything looks fine.

However when I export it to unity all the bones are separated for the entire animation (i.e. it is in the offset position for the entire 300 frames). I tried the following

1. Changing the CLIPs to start to 1
2. I tried importing the thing called "AnimeStudioFBXImporter.cs" Unity Importer file and putting it in an EDITOR Folder in Assets and it still didn't work.

Anyone else experienced this same problem and found a solution?

I am going to keep trying different settings and if I come up with anytime I'll post up what I found
solidgoldrobot
Posts: 3
Joined: Tue Aug 22, 2017 9:41 pm

Re: Editing Frame 0 and FBX Exporting

Post by solidgoldrobot »

I am experiencing this problem. Haven't found a solution yet. Seems like offset bone is simply not supported by FBX export (and not disabled by FBX Preview Mode). :/
Post Reply