Modding:VS Model Creator tutorials: Difference between revisions

From Vintage Story Wiki
Added entire section on how to use the step-parenting system in the model creator, probably need some cleaning up and to be referenced in related pages.
(Marked this version for translation)
Tags: Mobile edit Mobile web edit
(Added entire section on how to use the step-parenting system in the model creator, probably need some cleaning up and to be referenced in related pages.)
Line 104: Line 104:
 
 


<!--T:29-->
##////////////marker##editstart
 
== Parenting == <!--T:29-->
The parenting system allows you to attach models to the individual parts of a set backdrop model. This is is how armor models stay attached to the arms and legs of the player model while that model is performing its own set animations like running or crouching. This tutorial will cover how to use this system to implement armor models onto the player; but the same method can be used to implement custom clothing models or hair styles for the player. If you use a different backdrop you can add custom accessories to any animated model of your choice.
[[File:Vsmc 19.png|thumb|center|800px]]
&nbsp;
 
<!--T:30-->
Now there are two ways to start, the first method starts with an existing parented model from the game, this is far easier than the second method, but it's not as flexible. This will help you learn how the models in the base game are parented so you can eventually create your own from scratch. The second method shows you how to parent any shape to any backdrop element, which gives you far more freedom.
&nbsp;
 
<!--T:31-->
'''For method #1:'''
Start by importing the shape json of an item that is similar to what you want to add, here we will be using the "legs.json" file located in your game directory and nested in- ''Vintagestory/assets/survival/shapes/entity/humanoid/seraph/armor/plate'' Go ahead and import this model into the Model Creator by dragging and dropping it into the window. This should usually prompt you with a window asking to import a backdrop shape:
[[File:Vsmc_20.png|thumb|center|800px]]
&nbsp;
 
<!--T:32-->
Sometimes it will not prompt you with an import window and you will need to manually set the backdrop. You can do this by going to the tab "project" at the top of the window and select "Set Backdrop...":
[[File:Vsmc_21.png|thumb|center|800px]]
&nbsp;
 
<!--T:33-->
In the import backdrop pop up window navigate to the following location for the appropriate seraph shape json to import, you should use seraph-hairless.json located in ''Vintagestory/assets/game/shapes/entity/humanoid/seraph-hairless'' for most things as it's the cleanest model to work with, but you can always create your own custom backdrop version with certain elements removed like the clothing tiles to strip the model down even more. You can also delete the face cubes if they are in the way. If you edit the seraph shape json be sure to save it as your own version and try not to mess with the naming of the major body parts, preferably name it something like "seraph-backdrop" and place it in an easily accessible location so you can easily import the file again.
[[File:Vsmc_22.png|thumb|center|800px]]
&nbsp;
 
<!--T:34-->
With the backdrop set your model workspace should look like the first image, note the leg armor model is still bunched up in the corner, sometimes the model will update itself and automatically fix itself, but most of the time you will need to update it manually. You can update the model by selecting any piece of the leg armor model and moving its position once in any direction, then just press ctrl + z and undo the move. This should update the model and then it will look like the second image:
[[File:Vsmc_23.png|thumb|center|800px]]
[[File:Vsmc_24.png|thumb|center|800px]]
&nbsp;
 
<!--T:35-->
Now that you have the model and backdrop loaded into the model creator you are free to edit the shape however you'd like, just be sure to make your edited/added shapes branch off the original parts, the original parts are pre-parented to the backdrop so any newly added voxels must be attached to the tree of that part. Note how in the image "ArmorKneeSide9" is attached to and under the tree of "ArmorLowerLegL", Most major shapes at the start of trees or under the root are usually parented to the backdrop already. Just export the finished shape json and use it as normal, and be sure to edit the texture locations in the exported json to their correct locations.
[[File:Vsmc_25.png|thumb|center|800px]]
&nbsp;
 
<!--T:36-->
'''For method #2:'''
This method should be used if you already have a model created and want to parent it to the appropriate part of the body. We will start with these boots, which I want to attach to the bottom of each leg on the player model.
[[File:Vsmc_26.png|thumb|center|800px]]
&nbsp;
 
<!--T:37-->
Navigate up to the tab "project" at the top of the window and select "Set Backdrop...", as mentioned in method #1 you should use the seraph-hairless.json shape located in ''Vintagestory/assets/game/shapes/entity/humanoid/seraph-hairless'', or a custom stripped down version. Select your backdrop shape of choice and then press the "Import backdrop" button on the pop-up window.
[[File:Vsmc_27.png|thumb|center|800px]]
&nbsp;
 
<!--T:38-->
Your model creator window should now show an un-textured seraph model in in the center like this:
[[File:Vsmc_28.png|thumb|center|800px]]
&nbsp;
 
<!--T:39-->
Next select the part of your shape that you want to have attached to the backdrop model, here we are selecting the right boot main cube (it's the main cube because all the detail cubes are attached to it in the element tree), next scroll down on the left side of the model creator window and at the bottom you will see a "Not set" button under "Stepparrent element", press this button and you will see the following pop up window:
[[File:Vsmc_29.png|thumb|center|800px]]
&nbsp;
 
<!--T:40-->
Now in this pop-up window you will need to select the part of the backdrop model you want this cube you selected to be attached to, in this case I selected the right boot's main cube so I want it attached to the lower part of the right leg which in this case is all the way at the bottom of the "Element" drop down list. Once you select the right element go ahead and press the "Apply" button.
 
'''Note:''' the element names under this drop down menu correspond to the exact names on the player model used in game, this is why it's important to not rename them if you use a custom backdrop model. Also if you don't know what an element corresponds to name wise simply open up the backdrop shape file your using in a separate model creator window and select the element you want to know the name of and it should show in the left window under the "New element" button and tree window.
[[File:Vsmc_30.png|thumb|center|800px]]
&nbsp;
 
<!--T:41-->
After pressing the "Apply" button in the window it should close and then attach that cube to the backdrop element you selected in the list:
[[File:Vsmc_31.png|thumb|center|800px]]
&nbsp;
 
<!--T:42-->
Now repeat this process for each element you want attached to the backdrop model, you may need to modify the position of each model to properly align it to the backdrop. Also, when creating armor/clothing models be sure to separate the model up into several major cubes so they are easy to parent to the seraph model, for instance break up the leg armor into two major sections- the upper and lower leg, then add your detail cubes under the tree/ attached to one of these major parts. Nearly every single shape that shows up on the player model can be imported/parented/and edited this way, and you can also extend this process to create armor models for other entities like adding trader clothing.
[[File:Vsmc_32.png|thumb|center|800px]]
&nbsp;
 
<!--T:43-->
{{Navbox/modding}}
{{Navbox/modding}}
</translate>
</translate>
Confirmedusers
19

edits