ndee85 / coa_tools

COA Tools is a 2D Animation Suite for blender. It offers a 2D cutout animation workflow similar to programs like spine or spriter.
GNU General Public License v3.0
900 stars 139 forks source link

Some FBX solutions and fixes #60

Open LPsyCongroo opened 7 years ago

LPsyCongroo commented 7 years ago

I recently had some success in bringing my COATools project into Unity using FBX, as opposed to the dragonbones runtime (which was giving me a lot of trouble), and got pretty good results:

cutoutanimationsuccess

Textures and animating alpha/frame indexing are still unavailable but I had an idea regarding the latter after reading this: http://answers.unity3d.com/questions/653042/bringing-visibilty-and-material-animation-from-max.html

The idea is to have the COATools alpha settings to drive the transform of a specialized bone. A script is then made in Unity that updates the alpha of the mesh based on this transform each frame. For the frame-index, this could be done either by having a Unity script simultaneously changing the alpha of one sprite to 0 and the other to 1 or by turning their sprite renderers on and off.

I just set up a driver that changes the y-scale of a bone depending on the COATools alpha slider. There are still problems to this approach. The most immediate is that the driver doesn't create keyframes for the bone - this what I'm trying to do now (but I thought I'd post this for discussion in the meantime).

Eventually I'd like to set up a system where you can have COATools automatically generate a separate bone for this feature for each sprite after importing with the click of a button. You can choose whether to do so or not, as you may not need this feature for every sprite and having all these extra bones may be a waste of resources. Some changes would also be made so that when you keyframe alpha (or frame index), the corresponding bone (if you made one) is also keyframed.

If its successful, perhaps @ndee85 can add it as a standard feature for COATools. (Full disclosure, I'm not really a python coder and only just started working with blender, so whatever I come up with may need to be scrutinized first.) If you've got questions or suggestions, let me know =]