Tutorials/Animation Replacement: Difference between revisions
m (test) |
(Reanimated The Tutorial 2) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{TOC|right}} | {{TOC|right}} | ||
== Preface == | == Preface == | ||
This tutorial will teach you how to add your own animations to official Cobblemon models made by the team. Due to the unique way the official Pokémon are coded, you can’t simply apply animations to them using a poser file. Instead, you can create a '''clone''' of the official model and use this clone to replace the official one. Knowledge of animation and creating custom Pokémon is highly recommended. | This tutorial will teach you how to add your own animations to official Cobblemon models made by the team. Due to the unique way the official Pokémon are coded, you can’t simply apply animations to them using a poser file. Instead, you can create a '''clone''' of the official model and use this clone to replace the official one. Knowledge of animation and [[Tutorials/Creating_A_Custom_Pokemon|creating custom Pokémon]] is highly recommended. | ||
=== Step 1: Acquire all assets for your target Pokémon === | === Step 1: Acquire all assets for your target Pokémon === | ||
You are going to need all of a | You are going to need all of a Pokémon's assets so you can load them into Blockbench. You can obtain these assets by searching for them on the [https://gitlab.com/cable-mc/cobblemon/-/tree/main/common/src/main/resources/assets/cobblemon/bedrock/pokemon Gitlab] or the mod's JAR file. | ||
You will need all of the following files: | You will need all of the following files: | ||
Line 19: | Line 19: | ||
# Load the target Pokémon's model, texture, and animations into Blockbench. | # Load the target Pokémon's model, texture, and animations into Blockbench. | ||
# Create any desired edits to the model and animations. | # Create any desired edits to the model and animations. | ||
# Make sure you have an '''entire set''' of animations that can be assigned to a | # Make sure you have an '''entire set''' of animations that can be assigned to a Pokémon. | ||
# Ensure each of your animations follow the naming format of <code>animation.<pokemon>.<animation type></code> | # Ensure each of your animations follow the naming format of <code>animation.<pokemon>.<animation type></code>. | ||
# Keep Blockbench open and proceed to Step 3 | # Keep Blockbench open and proceed to Step 3. | ||
If at any point you created or removed bones, the updated texture file will also need to be in your resource pack! '''You are expected to know how to fix this if you made such edits.''' | If at any point you created or removed bones, the updated texture file will also need to be in your resource pack! '''You are expected to know how to fix this if you made such edits.''' | ||
=== Step 3: Export the model and animations as "clones" === | === Step 3: Export the model and animations as "clones" === | ||
Due to the way official | Due to the way official Pokémon are coded, you cannot reference the model under the same name. It will cause issues when loading the resource pack. You will need to export your model with an alternate name. '''The animation file can have the same name as before.''' | ||
# Export bedrock geometry of your model. File > Export > Export Bedrock Geometry | # Export bedrock geometry of your model. File > Export > Export Bedrock Geometry | ||
Line 38: | Line 38: | ||
=== Step 4: Create a new poser file === | === Step 4: Create a new poser file === | ||
Because official models do not use a traditional poser file, you will have to create your own! This poser file needs to assign all the pose and quirk animations it had before. You may even need to assign animations it didn't have previously. | Because official models do not use a traditional [[poser]] file, you will have to create your own! This poser file needs to assign all the pose and quirk animations it had before. You may even need to assign animations it didn't have previously. | ||
# Create a new poser JSON for your | # Create a new poser JSON for your Pokémon. | ||
#* You can reference the [[Poser]] Wiki page for details on every property of this JSON. | |||
#* The Poser Wiki page also contains an [[Poser#Poser_File_Example|example which you can use as a template]] for this step. You can remove poses which are not needed for your animations. | |||
# Be sure to assign all animations and quirks that you just exported! | # Be sure to assign all animations and quirks that you just exported! | ||
# Save the file. | # Save the file. | ||
# Name this new poser file <code><pokemon>.json</code> and save it somewhere | # Name this new poser file <code><pokemon>2.json</code> and save it somewhere. | ||
# Ensure that the file extension for this poser file is | # Ensure that the file extension for this poser file is JSON and not anything else (such as TXT). | ||
If you are very familiar with poser files, you can reference the kotlin model files found on the [https://gitlab.com/cable-mc/cobblemon/-/tree/main/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon Gitlab]. They closely resemble the JSON format and can be useful to obtain the data for Portrait and Profile values of your target Pokémon! | If you are very familiar with poser files, you can reference the kotlin model files found on the [https://gitlab.com/cable-mc/cobblemon/-/tree/main/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon Gitlab]. They closely resemble the JSON format and can be useful to obtain the data for Portrait and Profile values of your target Pokémon! | ||
=== Step 5: Edit the resolver file === | === Step 5: Edit the resolver file === | ||
The resolver file you acquired back in Step 1 will be repurposed into a new one. The resolver file controls what models, textures, and animations a | The resolver file you acquired back in Step 1 will be repurposed into a new one. The [[resolver]] file controls what models, textures, and animations a Pokémon species will use. You will mostly be changing load order values and the name of the files to <pokemon>2. This will effectively replace the in game model and animations with the one you made. | ||
# Open the acquired resolver file in your preferred text editor | # Open the acquired resolver file in your preferred text editor. | ||
# Locate the string for <code>"order"</code> | # Locate the string for <code>"order"</code>. | ||
# Change the value of "order" from 0 to 1 | # Change the value of "order" from 0 to 1. | ||
# Locate any lines in the json with the string for <code>"model"</code> | #* In some cases, this value may have to be higher. This is the case for Pokémon that have some regional forms, gender differences, or similar. | ||
# Locate any lines in the json with the string for <code>"poser"</code>. | |||
#* In the case of editing the Pokémon with special forms, as mentioned earlier, you might have to include new variations to replace the posers of these forms if applicable. | |||
# Change the designated poser to the poser you made previously.</br> example:</br><code>"poser": "cobblemon:charmander"</code> > <code>"poser": "cobblemon:charmander2"</code> | |||
# Locate any lines in the json with the string for <code>"model"</code>. | |||
#* In the case of editing the Pokémon with special forms, as mentioned earlier, you might have to include new variations to replace the models of these forms if applicable. | |||
# Change the designated model to your clone.</br> example:</br><code>"model": "cobblemon:charmander.geo"</code> > <code>"model": "cobblemon:charmander2.geo"</code> | # Change the designated model to your clone.</br> example:</br><code>"model": "cobblemon:charmander.geo"</code> > <code>"model": "cobblemon:charmander2.geo"</code> | ||
# Save the file | # Save the file. | ||
# Change the name of this edited resolver to <code>1_<pokemon>_base</code> and save it somewhere | # Change the name of this edited resolver to <code>1_<pokemon>_base</code> and save it somewhere. | ||
#* The <code>1</code> in the name of this file represents the load order. So if the load order value of this resolver is not 1 for any reason, change the file name to match the load order value. | |||
The <code> | |||
The reason you change the "order" value from 0 to 1 is to let this data load after the main mods data. This should let it overwrite so your clone model will be the one to appear in game. If the regular official model referenced a poser file, the resource pack would fail to load. | |||
=== Step 6: Arrange the asset files into a resource pack === | === Step 6: Arrange the asset files into a resource pack === | ||
You should have a new resolver, poser, model, and animation file. You simply need to arrange these files into a resource pack now. '''Make sure your folder names and locations are exactly the same as the main mod's.''' Some folders may include the | You should have a new resolver, poser, model, and animation file. You simply need to arrange these files into a resource pack now. '''Make sure your folder names and locations are exactly the same as the main mod's.''' The folder path and file names need to match so you can replace these files. Some folders may include the Pokémon's national Pokédex number. | ||
# Create a resource pack with the following layout: | # Create a resource pack with the following layout: | ||
Line 86: | Line 87: | ||
********'''<pokemon>2.geo.json''' | ********'''<pokemon>2.geo.json''' | ||
******posers | ******posers | ||
*******'''<pokemon>.json''' | *******'''<pokemon>2.json''' | ||
******resolvers | ******resolvers | ||
*******<target pokemon folder> | *******<target pokemon folder> | ||
Line 92: | Line 93: | ||
** '''pack.mcmeta''' | ** '''pack.mcmeta''' | ||
** '''pack.png''' (optional) | ** '''pack.png''' (optional) | ||
</div> | |||
=== Step 7: Test your resource pack in game === | === Step 7: Test your resource pack in game === | ||
Load your resource pack in game to see if the animations have successfully been | Load your resource pack in game to see if the animations have successfully been replaced. You can have Blockbench open to edit the animation file '''in the resourcepacks folder''' if needed. | ||
# Copy your pack folder and place it in the "resourcepacks" folder in the Minecraft root directory. | # Copy your pack folder and place it in the "resourcepacks" folder in the Minecraft root directory. | ||
# Start up Minecraft and click on ''Options'', then ''Resource Packs''. Select your pack to load it. | # Start up Minecraft and click on ''Options'', then ''Resource Packs''. Select your pack to load it. | ||
Line 104: | Line 105: | ||
Your new animations, as well as any unedited ones, should now be working on the official model! | Your new animations, as well as any unedited ones, should now be working on the official model! | ||
{{Addon Creation}} | |||
[[Category:Tutorial]] |
Latest revision as of 06:00, 27 February 2024
Preface
This tutorial will teach you how to add your own animations to official Cobblemon models made by the team. Due to the unique way the official Pokémon are coded, you can’t simply apply animations to them using a poser file. Instead, you can create a clone of the official model and use this clone to replace the official one. Knowledge of animation and creating custom Pokémon is highly recommended.
Step 1: Acquire all assets for your target Pokémon
You are going to need all of a Pokémon's assets so you can load them into Blockbench. You can obtain these assets by searching for them on the Gitlab or the mod's JAR file.
You will need all of the following files:
- model - <pokemon>.geo.json
- animations - <pokemon>.animation.json
- textures - <pokemon>.png
- resolver - 0_<pokemon>_base.json
The resolver file will be used much later.
Step 2: Create your replacement animations
Now that you have the assets for your target Pokémon, you can edit them to your liking. Sometimes you may need to edit more than just the animations. You may need to change the properties of a bone to support your new animations. Remember to also include the animations that you don't want to edit in your animation list since you will be replacing the entire animation file!
- Load the target Pokémon's model, texture, and animations into Blockbench.
- Create any desired edits to the model and animations.
- Make sure you have an entire set of animations that can be assigned to a Pokémon.
- Ensure each of your animations follow the naming format of
animation.<pokemon>.<animation type>
. - Keep Blockbench open and proceed to Step 3.
If at any point you created or removed bones, the updated texture file will also need to be in your resource pack! You are expected to know how to fix this if you made such edits.
Step 3: Export the model and animations as "clones"
Due to the way official Pokémon are coded, you cannot reference the model under the same name. It will cause issues when loading the resource pack. You will need to export your model with an alternate name. The animation file can have the same name as before.
- Export bedrock geometry of your model. File > Export > Export Bedrock Geometry
- Name this model file
<pokemon>2.geo.json
and save it somewhere. - Open the animation tab in Blockbench.
- Export the animations. Animation > Export Animations
- Click
Select All
and click confirm - Name this animation file
<pokemon>.animation.json
and save it somewhere.
The animation file can keep the same name because it can overwrite the one in the mod without issues.
Step 4: Create a new poser file
Because official models do not use a traditional poser file, you will have to create your own! This poser file needs to assign all the pose and quirk animations it had before. You may even need to assign animations it didn't have previously.
- Create a new poser JSON for your Pokémon.
- You can reference the Poser Wiki page for details on every property of this JSON.
- The Poser Wiki page also contains an example which you can use as a template for this step. You can remove poses which are not needed for your animations.
- Be sure to assign all animations and quirks that you just exported!
- Save the file.
- Name this new poser file
<pokemon>2.json
and save it somewhere. - Ensure that the file extension for this poser file is JSON and not anything else (such as TXT).
If you are very familiar with poser files, you can reference the kotlin model files found on the Gitlab. They closely resemble the JSON format and can be useful to obtain the data for Portrait and Profile values of your target Pokémon!
Step 5: Edit the resolver file
The resolver file you acquired back in Step 1 will be repurposed into a new one. The resolver file controls what models, textures, and animations a Pokémon species will use. You will mostly be changing load order values and the name of the files to <pokemon>2. This will effectively replace the in game model and animations with the one you made.
- Open the acquired resolver file in your preferred text editor.
- Locate the string for
"order"
. - Change the value of "order" from 0 to 1.
- In some cases, this value may have to be higher. This is the case for Pokémon that have some regional forms, gender differences, or similar.
- Locate any lines in the json with the string for
"poser"
.- In the case of editing the Pokémon with special forms, as mentioned earlier, you might have to include new variations to replace the posers of these forms if applicable.
- Change the designated poser to the poser you made previously.
example:"poser": "cobblemon:charmander"
>"poser": "cobblemon:charmander2"
- Locate any lines in the json with the string for
"model"
.- In the case of editing the Pokémon with special forms, as mentioned earlier, you might have to include new variations to replace the models of these forms if applicable.
- Change the designated model to your clone.
example:"model": "cobblemon:charmander.geo"
>"model": "cobblemon:charmander2.geo"
- Save the file.
- Change the name of this edited resolver to
1_<pokemon>_base
and save it somewhere.- The
1
in the name of this file represents the load order. So if the load order value of this resolver is not 1 for any reason, change the file name to match the load order value.
- The
The reason you change the "order" value from 0 to 1 is to let this data load after the main mods data. This should let it overwrite so your clone model will be the one to appear in game. If the regular official model referenced a poser file, the resource pack would fail to load.
Step 6: Arrange the asset files into a resource pack
You should have a new resolver, poser, model, and animation file. You simply need to arrange these files into a resource pack now. Make sure your folder names and locations are exactly the same as the main mod's. The folder path and file names need to match so you can replace these files. Some folders may include the Pokémon's national Pokédex number.
- Create a resource pack with the following layout:
Folder Structure
- (resource pack name)
- assets
- cobblemon
- bedrock
- pokemon
- animations
- <target pokemon folder>
- <pokemon>.animation.json
- <target pokemon folder>
- models
- <target pokemon folder>
- <pokemon>2.geo.json
- <target pokemon folder>
- posers
- <pokemon>2.json
- resolvers
- <target pokemon folder>
- 1_<pokemon>_base.json
- <target pokemon folder>
- animations
- pokemon
- bedrock
- cobblemon
- pack.mcmeta
- pack.png (optional)
- assets
Step 7: Test your resource pack in game
Load your resource pack in game to see if the animations have successfully been replaced. You can have Blockbench open to edit the animation file in the resourcepacks folder if needed.
- Copy your pack folder and place it in the "resourcepacks" folder in the Minecraft root directory.
- Start up Minecraft and click on Options, then Resource Packs. Select your pack to load it.
- Load/create a world save that contains Cobblemon.
- Once in the world, you can run the command
/pokespawn <target pokemon>
. - Ensure your new animations are working properly.
- Make any desired edits to the animation files and save. Refresh resource packs with F3+T to see the changes you make.
Your new animations, as well as any unedited ones, should now be working on the official model!