S&box Wiki

Revision Difference

Bodygroups#543994

<cat>Dev.Model</cat> <title>Bodygroups</title> # What are bodygroups? Bodygroups are a really helpful tool that you are most likely going to need if you plan on importing ragdolls or just props with a lot of customization settings. You can use them to customize a player model as well as a ragdoll, the way they work is quite simple. Bodygroups are a category where you put any amount of meshes into that category which you can later switch between. Bodygroups are a way to hide and show parts of a mesh in a easy option. For Example having a set of hats in a bodygroup list you can switch between,⤶ or like enabling and disabling a cape.⤶ All of this within one model together rather than individual models.⤶ # Making a bodygroup ⤶ In Source 2, having bodygroups is a lot simpler than Source 1 as all you have to do is the following:⤶ ⤶ 1. Open your model in ModelDoc, right-click on the left-hand side to bring up the Type browser and look for BodyGroupChoice which should look something like this: ![BodyGroupChoice](https://i.imgur.com/NZDxHAv.png) ⤶ 2. After finding it, simply add it to your model and then put a name you want for your bodygroup, a good example would be different helmets for your player model / ragdoll / jointed prop. ⤶ 3. After adding that, click on your category on the left-hand side where it'll prompt you to add a mesh. Adding a mesh is also quite easy, you can either choose it manually or use the eyedropper tool and select it from the Meshes category on the right-hand side which looks like this: ![Meshes](https://i.imgur.com/SMWbGfz.png) ⤶ 4. If you'd like to add another mesh to your bodygroup, simply click on the add mesh button again and add another mesh.⤶ ⤶ <note>If you'd like to add another bodygroup, simply repeat the whole process and select all of your meshes for your new bodygroup category</note>⤶ ⤶ ## Prepping your meshes⤶ This isn't vital, but i really recommend it, as it makes everything more clear. First go to your RenderMeshList, click each mesh and then rename it to something appropriate. ![naming example](https://i.imgur.com/Ek9cpoS.png) ⤶ Make sure to do this for every mesh, you can just name it the same as the original file, if you dont you will be left with a bunch of meshes named. unnamed_1, unnamed_2 and so on, which is not useful. ⤶ ## Adding bodygroups⤶ ⤶ Ok now you can click the `+Add` and then search for ⤶ ![bodygroupchoice](https://i.imgur.com/5AiSZj6.png)⤶ ⤶ add it and name it whatever you want, i recommend naming this "base" since this is where we will put all the base meshes.⤶ now you will have something like this.⤶ ⤶ ![example](https://i.imgur.com/3tfdoLN.png)⤶ ⤶ Now i would find Choice #0 in your bodygroup, and rename that to whatever the base mesh is (citizen, mario, john) whatever its name is, or whatever you wanna name it just make sure its clear that its for the base mesh.⤶ ⤶ Then within this choice add all your base meshes (THAT IS IF YOU WANT ALL THE BASE MESHES TO ALWAYS DISPLAY).⤶ Like so.⤶ ⤶ ![base bodygroup](https://i.imgur.com/N9B1gMe.png)⤶ ⤶ now we got this we can leave it and not add any other choices, this way the base mesh will always display no matter what.⤶ ⤶ But now we wanna add some accessories ⤶ ⤶ right click your BodyGroupList and add a new bodygroup, and name it whatever you need (For me it will be hats, since i want my hat options in there)⤶ ⤶ ![right click](https://i.imgur.com/tAAIIAx.png)⤶ ⤶ Now you can go through and name your body groups.⤶ ⤶ and then right click your bodygroup and add a new choice like we did with the list.⤶ ⤶ ![right click2](https://i.imgur.com/Z8WAhv8.png)⤶ ⤶ what i have done though is add my 1st option as none, so that way it defaults to no hats, you can see the 3 choices here, this means, i can either select no hat, hat 1 or hat 2.⤶ ⤶ ![choices](https://i.imgur.com/0BxyzkG.gif)⤶ ⤶ you can keep doing the same until you got all your bodygroups and their choices.⤶ ⤶ To test your bodygroups you can locate the Preview State button at the top, and then go through the options within it like so.⤶ ⤶ <upload src="70317/8d92110030147e0.mp4" size="14095074" name="2021-05-27 13-59-42.mp4" />⤶ ⤶ Now you can create your bodygroups.⤶ ⤶ <warning>You can not put multiple meshes within the same bodygroup options, EG: in hats, i cant make both hats try enable jetpack, you need to have jetpack as its own option.</warning>