Page 1 of 2

Importing your Obj file tutorial

Posted: September 23rd, 2009, 12:11 pm
by Radder
Hi all, new here. I just downloaded Sandbox the other day and it took awhile to figure out how to load an obj file with the textures correctly.It is really easy in the end. This assumes you have a obj trianglated model with it's uv map for your textures.

1. Create a new folder in the packages/models folder. Name your new folder so that is describes the model like cabin etc...
2. Save or copy your obj file into your new folder you just created. ( I also include my obj's mlt file to the folder but that might not be necessary. If you do add it rename it to tris.mlt)
Rename your obj file to tris.obj
3. Save or copy your jpg texture file into the new folder. Rename your jpg texture file to skin.jpg
Also you need a cfg file. You can copy one from the other folders or make your own using notepad.
If you copy a cfg file from another folder be sure to delete the text inside it. It can be left blank with no information.
Rename the cfg file obj.cfg
The model now will load with the textures and with collison detection on.
There are loading paramters that you can put in the cfg file but that can be dissused later

There might be other ways to get your obj file with textures loading into your map but this way does work well.

Re: Importing Obj file

Posted: September 23rd, 2009, 12:27 pm
by Radder
Here is how you load the your model into the map.

Press "E" to get into edit mode.
Press the tilde key (the one above the tab key) to bring up the console's text input
type "mmodel "the name of your new folder"
Below is the correct way to type it:
mmodel cabin ( replace cabin with the name of your new folder you created.)

Press enter.
Now your model is added to your mapmodel list.
Press the escape key. click on new mapmodel, go to the last number in the list and you will see your new model at the bottom. It is the same name as the new folder you created in the above post.
Click on the name and your model with textures loads into the map.

Re: Importing your Obj file tutorial

Posted: November 21st, 2009, 11:50 am
by PizzaLover101
What am i doing wrong?

my cfg file is
mmodel testing/sniper/tris
and it shows up in the model directory, but it says that it can't load the skin

Re: Importing your Obj file tutorial

Posted: November 22nd, 2009, 9:50 am
by Mike
It doesn't look like you have the skin linked in your cfg. Check out the .cfgs for our models to get an example of what it should look like. Take care.
-mike

Re: Importing your Obj file tutorial

Posted: November 25th, 2009, 2:27 pm
by Creatorrookie
What's a Uv map?

Re: Importing your Obj file tutorial

Posted: November 26th, 2009, 8:40 pm
by PizzaLover101
ok, thank you

Re: Importing your Obj file tutorial

Posted: November 26th, 2009, 10:04 pm
by Creatorrookie
What's an mlt file?

Re: Importing your Obj file tutorial

Posted: November 26th, 2009, 10:17 pm
by Creatorrookie
If the file I downloaded was "Rifleobj.rar. Is the rar significant, or will not apear as a mapmodel?
Am I supposed to convert the file?

Re: Importing your Obj file tutorial

Posted: November 27th, 2009, 7:14 am
by siimvuss
.rar means the file is packed its like .zip you have to unpack it then you can put the file in where ever you want

Re: Importing your Obj file tutorial

Posted: March 4th, 2010, 5:21 pm
by stefos
When exporting OBJ files from external programs I get an MTL file and the textures, I don't get just one texture skin how do I load these textures with my model...or how do I export a model from an external program in obj format with just the one texture skin and not the mtl file?

As above I can easily import models into SandBox (obj) but not the textures :(