I am back again it seems.
The Export All script worked perfectly. However some of my animations appears to be cut off.
Ex. An animation that ranges from -35 to 216 is inside 3dsMax -36 to 180. Inside Unity the dialogue continues while the character stops talking mid-sentence and is left standing with open mouth.
In FaceFX it looks just fine, it syncs and the character speak the full line etc.
This is an issue I get when I do a regular .fbx export as well so I guess it is not the script's fault.
I've made sure the fps is set to 30 on the animation inside FaceFX + the export script and also inside 3dsMax.
I googled for this but I couldn't find someone with similar issue. Am I the only one getting this?
The fbx command will export the currently visible portion of the animation, or the animation between the -starttime and -endtime flags. So it looks like the entire animation isn't "visible" in Studio when you're exporting. It is easy to make the script always export the entire animation range with a quick tweak (note this script is specific to FaceFX Studio 2012 and would need to be altered to work in 2013). Copy and paste the following, and replace the tab markers with actual tabs in your text editor and use that script (note the issueCommand() is all on one line -- do not wrap it).
import FxStudio
import FxAnimation
anim_names = FxStudio.getAnimationNames()
for group in anim_names:
<tab>for anim in group[1]:
<tab><tab>a = FxAnimation.Animation(group[0], anim)
<tab><tab>FxStudio.issueCommand('fbx -reducekeys "false" -format "0" -fps "30" -starttime "{0}" -endtime "{1}" -file "C:\Test\{2}@{3}_{4}.fbx" -group "{3}" -anim "{4}"'.format(a.startTime, a.endTime, FxStudio.getActorName(), group[0], anim))
Hey, thanks for the new script(even letting me know where the tabs go hehe).
I tried it out and it seems the file is the same as the one exported with the old script. I did try a completely regular export by just going to File > Export with the same result, as far as frames goes that is.
I also think the whole animation is visible? I can see the whole range of keys on the slider and scrub from start to end.
I am curious how the startime/endtime works in FaceFX because here it seems it does not cut off frames but instead offsets them.
If I set startime to 10 it makes the animation start at frame 300 instead of the default value of the animation(this is when looking inside 3dsMax and assuming the -fps is set to 30).
The script works for me, so I'm not sure what else I can do without seeing your files. You're not using the old issueCommand from the previous script by mistake are you? You should use the entire new script.
The starttime and endtime to the fbx command are _always_ in seconds. 10 seconds at 30fps is frame 300.
Yes, I made your script into a separate file that I execute. Could I upload my files on a dropbox folder and mail you the link? If so, what files specifically do you need to debug?
I understand that starttime and endtime uses seconds but up until this point I always thought they cut off animation(for instance if I set starttime to 1 everything before 1 second would be deleted in the export, which was not the case), it's just a misunderstanding on my part.
Yes, you can send us a link to a zip file to support [at] oc3ent.com
We would need your 3dsmax source files + textures and the .facefx file you're using.
You can try running the export in command line mode, by going to the install directory and running: facefx-studio -exec script.py
(note the lack of .exe after facefx-studio -- that's important). You will want to make sure your script loads the actor, so after the import FxAnimation line you would do FxStudio.issueCommand('loadActor -f "actor_path"') to load it. That may work around the "visible timeline" stuff that's going on in the Studio GUI. If you had 2013 you could use FxStudio.setVisibleTimeRange(), but that's not available in 2012. Try the command line mode before going through all the trouble of sending us files.
Phew! I am not very used to working with the command prompt but I got the script running in the end.
I get the same result as before however. The files are exported but they are still cut off mid-animation.
The script seems to do what its supposed to do but maybe something else in my setup is at fault?
[edit: I sent the files now]
There was a bug in FaceFX 2012 when exporting FBX animations with negative keyframes. It has been fixed in FaceFX 2013, which uses the visible time range to bound the FBX animation.