Trouble Getting Custom Props into Portal 2

Avatar
lastnovember
6 Posts
Posted Aug 01, 2011
Hi there, I'm having a few issues.

When I try to open a custom prop in the Model Viewer I get an error saying: "Error loading model" and they don't work in Hammer at all. I couldn't find barely any examples of people trying to get custom props into Portal 2. Has anyone here successfully done this? Here's my workflow, maybe someone could tell me what I'm doing wrong.

I'm using the smd plugin for maya: http://developer.valvesoftware.com/wiki/Modifying_a_Source_Model_in_Maya

  1. Create a cube in Maya.
  2. Save in location: C:\Users\Home\Documents\maya\projects\default\scenes - as "cube1"
  3. Select model in Maya and go File/Export SMD. This creates a new SMD file: C:\Users\Home\Documents\maya\projects\default\smd - named "cube1.smd".
  4. Duplicate this file and name it "cube1_collision.smd" and put it in the same folder and put a copy of idle.smd in the same folder.
  5. Open up a new notepad and paste in:
$modelname "cube1\cube1.mdl"
$cdmaterials "models\cube1/"

$scale 1.0
$surfaceprop "Metal"

$body "Body" "cube1.smd"

$sequence "idle" "cube1.smd" fps 30

$collisionmodel "cube1_collision.smd"
{
$mass 5
}
  1. In notepad: File/Save As
  2. Save in: C:\Users\Home\Documents\maya\projects\default\smd
  3. Save as type: All Files
  4. File Name: cube1.qc

  1. Open GUIStudioMDL
  2. Go to: Config/Set EP1 Tools Path: C:\Program Files (x86)\Steam\steamapps\common\portal 2\bin
  3. Go to: Config/Set Orange Box Tools Path: C:\Program Files (x86)\Steam\steamapps\common\portal 2\bin
  4. Target Mod or "GameInfo" Path/Add: C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2\gameinfo
  5. Go to: File/Load QC File: C:\Users\Home\Documents\maya\projects\default\smd\ cube1.qc
  6. Go to: Actions/Compile - This creates a new folder: C:\Program Files (x86)\Steam\steamapps\common\portal 2\portal2\models\cube1\
  7. In that folder are 3 new files: cube1.dx90 - cube1.mdl - cube1.vvd

  1. Open Steam/Library/TOOLS/Portal 2 Authoring Tools
  2. In Portal 2 Authoring Tools open Model Viewer
  3. In Model Viewer: File/Load Model
  4. Open: [ROOT]\models\cube1\cube1.mdl

When I do this I get an error message: "Error loading model". Does anyone know what I'm doing wrong?

Advertisement
Registered users don’t see ads! Register now!
Avatar
Vordwann
767 Posts
Posted Aug 01, 2011
Replied 3 hours later
I believe you have to do a basic UVW map, regardless of 3d modeling program, to get your model into Hammer.
Avatar
Skotty
671 Posts
Posted Aug 01, 2011
Replied 39 minutes later
This error tells me that there is a major problem with the model itself. If it would be just the texture, it would load it anyway. Oh and: you got 3 files, but none of them is a .phy file, so the physmodel is not working.

A broken model can have a lot of reasons. Problems in the smd, problems in the .qc or problems while compiling.
For me your .qc file looks good.
Most times if there is a problem the compiling process gets aborted. If it's ok you could upload the smd for me and I'll try to find the problem for you.

Avatar
lastnovember
6 Posts
Posted Aug 01, 2011
Replied 43 minutes later
Thanks for the help, guys! It's just a 6 poly cube, I started off trying to compile a character model, but regressed to a cube because I thought it would be easier. Would I need to change the uvs on a cube? The cube compiles fine, the error is only in the Model Viewer.

Here's the .smd file:
http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=1128

If the .smd exporter is the problem then I can try blender or 3ds Max instead.

Avatar
Vordwann
767 Posts
Posted Aug 01, 2011
Replied 1 hour later
Well there is a thing called wall worm model tools for 3ds max that does all the hard work for you.
Avatar
lastnovember
6 Posts
Posted Aug 01, 2011
Replied 4 hours later
I saw that before, but didn't realize it was a compiler. Gosh, how useful.. I'll give it a go, thanks.
Avatar
Skotty
671 Posts
Posted Aug 02, 2011
Replied 15 hours later
I can't download your file, it's deleted. Upload it as a attachment file.
Avatar
lastnovember
6 Posts
Posted Aug 02, 2011
Replied 4 hours later
box_3.rar

oops, that would make more sense I suppose. Also; I tried the Wall Worm Model Tools and I get the same error in the model viewer, dang it.

Attachments
box_3.rar
0.00 MB 33 downloads
Avatar
Skotty
671 Posts
Posted Aug 02, 2011
Replied 4 hours later
It's so simple: You just don't have any texture on your model! You need a texture on every polygon of the model. Everything without any texture won't exist in the smd and ingame. Non existing models are not possible.
Avatar
lastnovember
6 Posts
Posted Aug 02, 2011
Replied 2 hours later
Do you mean a texture needs to be applied to the model before you export it as an .smd file. Or do you mean you need to specify the location of the .vtf texture you're using in the .qc file? Because I did both before compiling it and I still get an error. Did you edit the .qc? if so can you paste it back to me? Cheers.
Avatar
Skotty
671 Posts
Posted Aug 02, 2011
Replied 2 hours later
The .qc seems to be correct. The problem is, no texture is applied on your model. You need to do it before exporting.
Advertisement
Registered users don’t see ads! Register now!
Avatar
Vordwann
767 Posts
Posted Aug 07, 2011
Replied 4 days later
That makes sense. If you want to optimize higher poly models, you still need to texture every face, but use polygon culling (deleting polygons the player will never see).