0

I'm looking into the feasibility of creating a script able to export a blender animation to a JSON to be used by 2D Spine animation software.

This would be based on Blender-JSON-Exporter.

The question is: is it possible to calculate the length and angle of a bone relative to a viewport?

In other works I would like to project the blender 3D animation to a 2D plane aligned to a given camera. The relative angle and length of each bone would then be used to generate a Spine JSON animation file which would replicate the blender animation in a Spine environment.

One use-case in is to use blender to generate spine animations that require a 3-dimensional perspective, e.g. a walk-cycle from a front-perspective.

This seems to me a moonshot to be honest but I though I would ask just in case.

If feasible I'd love to crate a plugin as I think there may be few other people that would enjoy this ability in Spine.

Thanks in advance.

  • It is all answered on this site, you just have to search step by step and problem by problem. Bone endpoints 3d coordinates you get from tail or head PoseBone class attributes: https://docs.blender.org/api/blender_python_api_current/bpy.types.PoseBone.html#bpy.types.PoseBone and you translate those 3d coords into 2d viewport space like this: https://blender.stackexchange.com/questions/882/how-to-find-image-coordinates-of-the-rendered-vertex – Jaroslav Jerryno Novotny Aug 14 '17 at 12:19
  • Brilliant thank you. The second bit in particular is what I was less confident in finding. I'll dig into that. – Adunato Aug 14 '17 at 13:36

0 Answers0