Improved animation workflow
Using layers to separate animations in a file is a real workflow pain. Is there any chance of more Unity-like options for animation importing? Organizationally, it works way better if you have multiple FBX files--one for the skeleton, and one for each animation. Or at the very least, having all the animations in one, but using start/stop frames to divide them up into individual animations instead of using layers.
I suppose it would be kind of a pain because you'd have to introduce an import workflow that lets you choose frames or associate animations with a skeleton, but I think it would work much better.
Thanks all for the feedback! We'll add to our feature requests.
In the meantime, we just added a guide that should help give some guidance on working with animations without animation layers. The guide has you replace the interactive template animation scripts with ones that support animation with an inputted time start and end:
https://lensstudio.snapchat.com/guides/3d/non-anim-layers-setup/
Let me know if it's helpful!
+1. To make this workflow easier I have been using MotionBuilder which lets me quickly retarget animations to skeletons and export takes to layers in one go without having to chop them up by start/stop frame.
+1.
FBX also has "takes" which is the standard method MotionBuilder, Maya, etc. use to store multiple animation clips in one FBX file, rather than layers which is primarily meant for adjusting mocap data and blending animation states, etc. The layer system really wasn't meant for this purpose (at least from my perspective, primarily using Maya.) The one-way process of having to prepare all the animations, baking them into layers, then preparing the layers for export really destroys iteration time and seems to be prone to errors.
Importing/Exporting takes with Maya:
http://help.autodesk.com/view/MAYAUL/2018/ENU/?guid=GUID-A5F13987-036D-42E3-BF66-EA312C045EBA
http://help.autodesk.com/view/MAYAUL/2018/ENU/?guid=GUID-31148EE5-CAA8-48F2-9E51-3C9712EE8A14
Ralph's suggestion is ideal, but maybe it would be easier to implement FBX takes as well as layers without adding a whole lot of new features to Lens Studio in the meantime? Thanks!
Ah thanks for the update! That works. Although what's weird is with these scripts I can't get the idle to play after the character is placed. Only after you tap it and it does the tap animation will it play the idle after. But I can see from some prints I put in the method that it is indeed playing the idle, it's just never actually starting for some reason.
I also had to take out the check for the secondary animation in the tap script because it would never trigger again because the idle animation was considered a secondary animation with that check.
We'll investigate, thanks Ralph!
Hi Ralph.
We've been investigating your issue mentioned above regarding the idle animation not playing after the character is placed. Unfortunately we haven't been able to reproduce this issue as described. We exported a new character from maya with all animations on one single timeline and followed the guide for relinking the scripts to IdleAnim.js and TapAnim.js. After entering our desired start and stop times and pushing to device, the character idled and performed the desired tap animation when tapped and returned to idle. If somehow the bool (script.api.secondaryAnimPlaying) got set upon initialization then I can see how that might cause the issue but we haven't been able to create that situation after following the guide.
Can you clarify what you mean when you say "the idle animation was considered a secondary animation with that check"? I can see why you would remove the check in TapAnim.js for script.api.secondaryAnimPlaying around line 82 because it is a bit redundant but I'm not sure how the the idle animation could be considered a secondary animation since this bool is only set from TapAnim.js
Yeah what I had to do is comment out that check for script.api.secondaryAnimPlaying and then it plays the idle after I tap. I think this related to another bug I have where the idle won't play at the beginning. It's probably something dumb I'm doing, but I'm using the untouched scripts--hence I think it might be an issue with my FBX. I've got a support ticket open on it so maybe once you guys can check out the FBX you can find something wrong with it.
Or I'm just doing something really dumb. :)
Hi Ralph. I took a look at your project and I think I know what has happened. The start and end time for IdleAnim.js and TapAnim.js with regards to non layer based animations expects a value in "seconds" and it looks like you have entered the "frames" of animation from your 3D package. It seems you may have animated at 30fps so the start time for the idle in Lens Studio should be 120/30 == 4.0 and the end time should be 350/30 == 11.60. I tested this on our end and it starts idling as expected and everything seems to be working as expected.
We didn't note this in our documentation so we're adding that now.
Hmm, in every 3D content tool I've used, for importing/exporting/baking animation data, clip ranges have always been measured in frames, not in seconds. I understand if you chose seconds as the unit to make it more familiar to people who use video editing software, I just want to point out that I believe most people who generate realtime 3D animation are going to be thinking in terms of frames by default and might run into this hiccup often. Thanks!