In this series, I will show a series of tasks to use Blender, create a simple model and upload it to STYLY, for those who don’t have any experience with modelling.
In the previous article…
In the previous article, I explained how to apply bones to the model.
There are two ways to set bones. Please refer to the following articles.
What to do in this article
In this article, we add animation to the object with bone and upload it to STYLY.
The name of each bone
You need to rename the bones to upload them to STYLY later. This naming convention also makes the bones easy to handle when adding animation. Double-click the bone name in the Hierarchy to rename it.
You can identify a bone by selecting it in the Edit mode, so select each bone and rename it as shown below.
The setting for ‘Master bone’
In the current state, you need to move all the bones when you want to move or rotate the whole character by animation.
Therefore, we create a ‘parent’ bone to put all the bones together as children, which is called ‘Master bone’.
In the Edit mode, select the tip around the centre of the spine and extrude it in the Y direction by pressing the ‘E’ key and then the ‘Y’ key in sequence.
Name it ‘Master’.
①Select the Master bone in the Hierarchy window. ②Select the ‘Bone’ tab. ③ Remove the current parent-child link by pressing the ‘x’ button.
To make all the bone to be the children of the master bone, select ‘Master’ as the parent of ‘Spine1’ which is the top of the upper-body bone hierarchy, ‘Hip_L’ at the top of the left-leg hierarchy and ‘Hip_R’ at the top of the right-leg hierarchy. It makes all the bones to be the children of ‘Master’, so you can now move them together by moving ‘Master’.
In addition, you can turn bone into stick by selecting the bone and clicking the ‘Stick’ button in the Armature tab. It gives a simple visualization to make the operation easier when adding animation.
Let’s make animation
Finally, we now start adding animation!
The Timeline for animation is shown in the lower part of the screen.
Set the sync mode to ‘AV Sync’ to play the animation at the original speed even if some frames are dropped.
Define each animation such as running, walking, as ‘Action’. We use each ‘Action’ to manage each animation.
Create Actions on the Dope Sheet. You can open the Dope Sheet from the ‘Editor Type’ selector in the bottom-left corner.
We set the keyframes by making poses on this Dope Sheet or the Timeline.
① Switch ‘Dope Sheet Mode’ to ‘Action Editor’. ② Click ‘New’.
As shown in the screenshot below, enter the name in the box(①) and press the ‘F’ button(②) to save the animation.
You can select the created animation from the drop-down menu (③).
This time, we create a ‘walking’ animation as an example.
Before making the first pose, set the current frame to 1.
Select a bone and press ‘Ctrl+Tab’ to go to ‘Pose Mode’. We make a pose by moving the bones in this mode. Since we make a walking motion here, create the pose when walking.
After making a pose, select all the bones by the ‘A’ key. Then press the ‘I’ key and select ‘LocRot’.
It inserts a keyframe. The keyframe is added to all the bones in the Dope Sheet and the yellow vertical line appears at the position of the keyframe in the Timeline.
Select a frame a bit ahead to make the next pose.
In the case of walking motion, we need to make a symmetrically opposite pose, so let’s paste the reversed pose of the first one.
Right-click ‘Dope Sheet Summary’ at the top of the keyframe on the Dope Sheet to select it. Note that you need to right-click when selecting and moving a key and left-click when changing the frame position.
After selecting ‘Dope Sheet Summary’, copy it by Ctrl+C, click a frame a bit ahead and press Ctrl+Shift+V.
It inserts a key with the reversed pose.
Then, copy and paste the first pose at a frame further ahead. Since we don’t need to reverse the pose this time, just paste it by Ctrl+V.
Go back to the Timeline, set ‘End Frame’ to the frame with the last pose.
Let’s play it then.
Check the animation. If you found something wrong, try adding more keyframes between the existing keyframes to refine the movement or moving the keyframes to adjust the speed so that you make the animation look good enough to convince yourself!
If you want to add a new action, exit the Edit mode by pressing the ‘x’ button next to the Action name and then press ‘New’ to create a new Action.
Upload the model to STYLY
Export the model
Let’s export the model with animation to STYLY.
Since I couldn’t make the animation working when I imported the model from Bender to STYLY directly, we need to import it via Unity.
Firstly, export the model from Blender.
Select the bone and mesh and click ‘File > Export > FBX’.
In the setting window, check ‘Selected Objects’ and select ‘Armature’, ‘Mesh’ and ‘Other’ (You can select them all by clicking them with the shift key held down).
On the ‘Animation’ tab, you may leave all the boxes checked.
Then, enter the filename and export.
Process in Unity
Next, open Unity. You should use Unity2017.4.
Import Unity plugin for STYLY.
You can download it from:
After importing, the window shown below appears. Enter the E-mail address and the API key.
Put the model exported earlier in the ‘Assets’ folder and then place it in the scene.
Select the model file in ‘Assets’ and click the ‘Rig’ tab in the Inspector. Then, change ‘Animation Type’ to ‘Humanoid‘ and click ‘Configure…’.
It brings the scene to check the bone. If you found everything coloured in green, it would mean all the bones are set correctly. So, click ‘Done’ to go back to the original scene.
If you found some parts coloured in red, you need to set them again. In some cases, you can fix them just by rotating them in Unity, so please look into the error messages. I heard that incorrect bone names would cause an error.
After going back to the original scene, drag the animation of the object in ‘Asset’ into the object placed in the scene.
Select ‘Windows > Animator’ from the top menu to open Animator. Now you should find the animation you just dragged into the scene (the orange one below).
If its name was left blank, set the name in the Hierarchy view.
If you want to make the transition from the animation you just placed to the other animation you created, drag it into this Animator window, right-click on the first animation and select ‘Make Transition‘ to connect to the next animation with the arrow.
Since we are making a walking animation this time, I will explain how to loop the animation.
Click the ‘Edit’ button on the Inspector of the animation in the object under the ‘Assets’ folder.
Then, the Inspect changes to the state to edit that animation, so check the ‘Loop Time‘ box and click ‘Apply‘.
Play the animation to check if it loops. If it doesn’t loop, it might have not been set correctly, for example, the ‘Looptime’ not being checked. So please press ‘Edit’ again to check.
Once it’s done, drag the object in the Hierarchy window into ‘Assets’ to convert it into a reusable asset, which is called ‘Prefab‘.
Right-click the Prefab in ‘Assets’ and select ‘STYLY > Upload prefab or scene to STYLY‘. It starts uploading it to STYLY. When it’s completed successfully, the window with the message, ‘Upload Succeeded’, appears.
Go to STYLY and select ‘Assets > 3D Model > My Models’. Now you should find the object with animation uploaded earlier.
Place it in the scene. It looks nice, doesn’t it? (Actually, just the head appears on the floor because it’s too big…lol)
That is all!
Please watch ‘Vtuber’ video by this panda (the name is ‘Pants-da’)!