S&box Wiki

Revision Difference

Importing_a_new_model#547888

<cat>Dev.Model</cat>⤶ <cat>Model.Intro</cat>⤶ <title>Importing a new model</title> # Things you're going to need Porting a model with ModelDoc is a lot different than Source 1 and most importantly, a lot easier. You simply need to put your model in .fbx/.smd/.dmx along with your textures. After collecting all of these, you'll have to put them in their own folders inside your resource's folder. 1. First and foremost locate your resource/addon in your game folder, where you can see all other content folders. 2. Your models go in the models folder and your textures should go in the materials folder. 3. After getting all of these sorted, bring up your asset browser and look for the ModelDoc icon. ModelDoc's button should look something like this: ![ModelDoc](https://i.imgur.com/PDK58BZ.png) 4. Once that's opened, simply right click on the left side of the interface and click on add. Once you click on add the Type interface will open which should look something like this: ![Types](https://i.imgur.com/H98jl8o.png) 5. Simply click on the add meshes button: ![AddMeshes](https://i.imgur.com/1QXB75I.png) and then look for your model, double click it and then it'll appear on the left hand side of your interface under RenderMeshList. Note that you haven't applied a material to it yet so even if you do compile it into a .vmdl, you won't quite be able to see it well in the viewport so let's go ahead and create a material for it first. # Creating a material from your textures <ambig page="guide_to_making_materials"> </ambig> # Giving your model a material Giving your model a material is fairly simple. 1. If you want ModelDoc to use your material names, simply add a new type by right clicking on the left side of the interface and adding a DefaultMaterialGroup. 2. Click on it and then simply clicking on the magnifying glass icon and looking for the material that we created earlier. It should look something like the picture below. ![Magnifying2](https://i.imgur.com/d6j7zoT.png) You can now compile your model and at this point you should be able to see it in the viewport with it's proper textures. You can fine-tune the materials through material editor and check the differences in real time. <validate>If your model has multiple materials/textures, you're going to need to make a material for every one of them and apply it at this point.</validate> #Prop Data Depending on your model, you're going to need to set it's prop data, for now you can simply set it as a static prop model. As I expand this guide I'll add the rest and different types of prop archetypes. # Physics and Collisions There is a lot you can do in terms of adding collisions, physics, mass, surface types and all that stuff all together in the same part of modeldoc, so I would recommend clicking below to head over to the separate specified page to find out. <ambig page="PhysicsHullFromRender"> here is where a beautiful person like yourself would go to understand how to do these and more!</ambig>