I’m working on a little project with an animated character that involves the character travelling a fair distance. Now I can build the the character with lots of frames in Blender - but the file size increases dramatically, particularly if I want to follow a number of different paths
So, I looked for an alternative with the animation travelling along a path - and I found this Babylon demo with the “dude” character which seemed to work fine:
So I created a very similar playground with a simple character of mine. It did not work - one mesh in the character followed the path, the rest did not! The “dude” is a multi-mesh character, so why did it work ?
I’m a pretty poor coder, but I started looking at the working “dude” playground and was immediately struck by line that scales all the character meshes and the skeleton by just scaling one mesh (line 30 calling “meshes[0]”) - how was it working with just that one mesh?
Looking at the scene inspector, I immediately noticed that “meshes[0]” was just a Transform node. So how to do that in Blender with the .babylon exporter? The 'dude" model is in the .babylon format which I like.
The solution : attach an “empty” to my character, then attach all the meshes that are part of the character to that “empty”. Then, instead of calling for “meshes[0]”, get the empty by name - and it worked :
The character is relatively low poly with a short walking in place animation (24 frames) with an additional 6 frames for the idle pose. There are two paths - a small square(on left) and a larger rectangle (on right). I have drawn the paths so you can see them - adds two draw calls - but that is not essential.
When the character stops, hit the “s” key - and it will restart.
It is possible to to add more paths and to randomize which path(s) gets played. Right now I am struggling to remember my trigonometry from 60 years ago to draw loops and circular shapes.
Stay Safe All, gryff