Making Animations for a pokemon - Thutmose/Pokecube GitHub Wiki
First You make a Resource pack with the proper folder structure. For an example of this structure look at the zip file included in the tutorial to add a new Pokemon.
The Resource Pack should have a "pack.mcmeta" and a "pack.png" in the top folder along with an "assets" folder. Then you nest the following folders within each other "pokecube_mobs" within "assets", the "gen_#" folder where # is whichever gen the Pokemon you're editing is part of. For example for this I'll be using Vulpix so it'll be "gen_1". Then you make an "entity" folder within that and a "models" folder within the "entity" folder.
Now get a copy of the .xml file for the Pokemon you're editing into the models folder. This can be gotten from the Thutmose/Pokecube-Models github or copied out of the Pokemon Mobs jar file with a program such as 7-Zip. The URI bar of the file should look something like "Minecraft>resourcepacks>SleepyVulpix>assets>pokecube_mobs>gen_1>entity>models>vulpix.xml"
Now you're going to want to load up your instance of minecraft with the Pokecube mods and start up a testing world. Load up the resource pack you've created with Esc > Options > Resource Packs
Give yourself a "Model Reloader" and right click it in your hand to bring up it's interface. Change the Bulbasaur bar into whichever Pokemon you want to edit, If you have JEI installed make sure to move your mouse to the left side of the screen so you don't look up the recipes of whatever item is invisibly behind the interface.
Now on one side of your screen open the .xml file from earlier in a text editor such as Notepad or TextEdit. This should be a plaintext program and not Microsoft Word which can insert hidden characters that sometimes messes up text inputs for programs. For Vulpix my setup looked like this to start.
Now you want to give it a Phase so the game knows when to use your pose/animation. in your .xml add
<phase type="sitting">
</phase>
This tells the game tat when the pokemob is sitting do the bits between the
and the
Now we need to tell it how to move when it's sitting. So first we get the name of the body part we want from the blender file or the .x3d file. First I'm going to angle the body and move it to the ground.
to to this I'll tell the game what part to be moving with a
and when the change to the body ends with
Now to tell the body how to move while sitting. First I'll just set it on the floor. to do so I add a component that tells the body to be rotated and moved downwards. It's the first component of this body part so it gets the name 1 and startkey 0. This means that it is the first part of the "animation" and that it begins at the very beginning, frame 0. I'm also going to give it a length of 30 game ticks which equates to 1.5 seconds.
Now I'm going to spin the body around so I'll need to look at Vulpix from the side ingame. That's just a simple drag to the left until it's the angle I want it to be. Then to actually angle Vulpix I'll add a rotation offset with rotOffset="90,0,0" and change one of the 0's to 90 to see which axis that number will rotate around. I'll save the .xml and reload the model by clicking the F5 on the bottom left of the screen.
So I found the right axis that we want to spin around on the first try. But I've spun it a little too much. So now I'll take the 90 down to 70 and see how it looks. Just change the number save the .xml and press the F5 once more.
Still not quite enough. Lets try cutting it all the way down to 45. Change, save, F5 aaand
Looks good. But I think it's but is floating a little too high above the cursor in the center of the screen, which is where the ground would lay. So Time to offset the body some. I'll add posOffset to the body this time. After a bit more testing I've found that the second number in posOffset is the one that moves it down, or up if it's a negative number. the only problem is if you go too low the Pokemon blocks you from seeing the cursor so you're not sure if you've moved it too far. My solution to this was to give myself a vulpix in game and tell it to sit and stay on a glass block and stand on a half block to get closer to even with the glass top.
This lets me see that 5 was a tiny bit too far and further testing reveals that 4 is better to sit right on the glass. Now lets see if we can make Vulpix breath a bit. First I'm going to add a part linked to the Chest piece and not give it any offsets.
Okay so now I can edit the Chest piece. Well to animate it I'm gonna try just moving it back and forth. To do this I add a second Component and tell it to start right after the first one ends. Then I need to add a posChange="0,0,0" and change the numbers to move forward for 30 ticks and then back to the beginning.
As you can see by the startKey Component 2 starts at tick 30 which can be figured out by adding the length of the first component to it's startKey. This means that it will start immediately after component 1 ends. Now I don't think that the animation looks good with the bottom clipping through Vulpix's belly so I'm gonna make 2 changes. First I'm going to reduce how much it moves by turning the 1's in posChange into 0.5's Then I'm going to add a small rotation. To add the rotation I've added the rotChange argument to the components. This told it to rotate 5 degrees forward then 5 degrees back in time with it moving forwards and backwards.
Now if you load it up in Minecraft you'll see that I've chosen numbers that cause the bottom of the chest to, almost, perfectly line up with the front of the body. To make a pose you just repeat this process with all the various pieces until the model looks how you want it to. If you are unsure what the body parts are called then the easyist way to check them is to open the .blend file for the model in blender. Also remember that When you move a part then the parts attached to it will follow the part. This means that you can swing the arm around and the hand will stay attached but it also means that if you position the hand before you move the arm then it can lead to a few unexpected movements. Mostly though it's just playing around and refreshing the Pokecube model reloader until it looks like you want it to. Check up on https://github.com/Thutmose/Thut/blob/1.9/ThutCore/src/main/java/thut/core/client/render/tabula/components/AnimationComponent.java to see what other features you can use to give your animation the final kick.
One Last Thing! Don't be afraid to look at preexisting .xml setups. You might find a neat trick like the wildcard used here for Vulpix's tails.