Questions on rigging and model formats

Ok, first of all, I know there are the tutorials on this subject already on the forum. I’ve actually looked over them, but I can’t follow them because I am using Truespace 7 instead of 3DS Max, because my trial ran out and I can’t afford the program.

I’m trying to figure out a good, bad, or at least functional workflow to go from the .obj files to a source engine model that games like Garry’s Mod will understand.

I can do rigging, or at least the Truespace equivilent of it. I’m no good at it, just started today actually, but I can learn with practice. I have no idea if, or how, to export the skeleton rigging to the source engine, or even if it can be done. If anyone has any input or some plugin that could do that, please post the link. I’ve searched myself, but “truespace to source engine” isn’t very useful, and the truespace fourms are locked up into an archive(which had next to no info on any source conversions).

What I have been able to do so far, even with just a few hours practice:

-Open up Wavefront .obj files, textures and all, such as the raw model rips found all over this place.

-Start rigging and weighting an arm of one of the models. I’d like to note that I have no idea what a Valve skeleton should look like, I was simply rigging it for animation, but Truespace 7 has a decent result and a nice “instant rig” tool. Basically I placed the skeleton I had built inside the model, pressed the “attach to skin” tool, and the skeleton was instantly rigged to it’s “skin”(albeit, with a few flaws since it was a quick test).

-Do a few frames of animations with the skeleton, once again just to test.

Now, I have hit a problem. Namely, the following:

-I don’t have a good converter for saving .mdl files from inside truespace 7.

-I don’t know how to save the skeleton or the animations(without saving a “scene” or “.obj”), I probably need a plugin for that, and I haven’t found one yet.

-I have no reference for what a Source Engine ragdoll or prop contains on the modeler side, or any limits I need to know about for physics/animation/bone rigging/ect.

A lot of you seem to know where these sort of references are though. Could you post some links to helpful info, or if you know of any plugins that might be useful, I’d like links for that as well. I do believe, with the right tools and a bit of persistance, I can figure out how to get Truespace to put out something useful, but I don’t have the resources to work from yet.

In short, I’m a modeler who has done stuff in 3d, and would like to learn how to model for Source Engine, by making random stuff for Garry’s Mod. I’ve basically got a few hours a day to burn, except on busy days, and nothing really better to do. I can open your .obj rips, but have no idea how to go from there to a HL2 model file. I’m willing to learn, and I’ve got the time to do so, so shoot me some info and possibly plugins to use.

Ok, I’ve determined that without the gamepak plugin for truespace, it’s pretty much worthless for this stuff. I can model and output .obj(both truespace and lightwave .obj, not sure which is which in the export window yet as I don’t have lightwave to test with). If gamepak actually existed, I could export straight to HL2 models. Unfortunetly, I think it tanked with the rest of caligari’s website when they shut themselves down. I can’t even access the store to buy it if I had the money to.

I’ve tried getting the exporter for blender, but when I followed the tutorial here: http://developer.valvesoftware.com/wiki/Exporting_a_model/Blender#Exporting_the_model

I get a “python script error” on saving anything, and 0k files as output. Since I know NOTHING of blender, I can’t even access wherever the heck it dumps the error.

I’ll probably spend some more time on this later. For now, I’m quite in a bit of a fix. I can model stuff in Truespace but that stuff seems worthless without the ability to export anything other then .obj files. And I can stare at blender and wonder why the exporter has a “python script error”, where the error window is in this bloody interface from hell, and why nothing is being output.

Help would be more then a little appreciated at this point.

I’ll try learning my way around blender, but with me being spectacularly bad at remembering shortcut keys and being a very visual person, all the tutorials have been much like teaching a blind person to drive a car. It’s great I can try different buttons and stuff, but once something goes wrong, I have no clue where to even start fixing it before it crashes.

You need the version of Python to go with your version of Blender, I had that problem aswell it doesn’t explain it very well on the Blender site. If you have got Python and your getting that error…well… that’s the same for me :frowning:

I’ll have a dig around for you and see if I can find anything useful for Truespace but having never heard of it before, its likely not got an SMD importer/exporter (as I would have expected it to come up when i was looking for other ones).

Yes and on the note of SMDs models/skeletons (in whatever format you make them), need to be either exported or converted to SMD format before you can then compile them into an MDL file. You cannot go straight from modelling program to MDL unfortunately (though compiling is easy when you know what your doing ^^).

You could always try MilkShape 3D.

I certainly do ^^

Same here.

This is probberly offtopic, but Omolong how do you export the playermodels, as everytime I try they end up mangled weirdly @.@

Thanks for all the tips and stuff.

Today I switched over to Softimage Mod Tool, which supports outputting to the right formats. It’s a new program though, so I’m having to learn all over again. Especally with the polygon selection, Softimage works like 3d studio, where as Truespace had each object like a tree. In other words, to select polygons in truespace was a lot easier, because by hitting down on the arrow keys, you’d go down one level in the object and be selecting and working with the polygons instead of the objects. I’m having loads of trouble selecting polygons in Softimage, because I have to hit U and then click each individual polygon while moving the camera around, which basically sucks when compared to the Truespace “every object is a tree of polygons” method.

Regardless, I’ve managed to get a box and a cone that I scrapped together exported, converted, and imported into addon format for Garry’s Mod. That’s a huge leap and bound forwards.

The texture, despite being a .tga, isn’t working in Source though. I’m getting the classic purple squares. I also have no idea what settings for materials there are for the physics. Currently I’m using the tutorial’s “wood” setting.

I have also since discovered that I have no concept of weight scaling in Source Engine. I’ve tried both 5 and then 30, and found that this results in something really really lightweight, and dosn’t get tossed around well at all. Of course, this is just a matter of playing with settings till I work out what “feels” like the right mass.

I will say, softimage does have a LOT of buttons for what I’m using it for, but at least it functions and does the trick. I shall probably have to spend a few days taking tutorials on using softimage proper before attempting anything serious for Gmod though.

When you finish with the model, could you post the tutorials you used? I want to learn this stuff too but am bad at finding things.

You have to convert the TGA file into a VTF file using this: VTFEdit (or a Photoshop plug-in if you are so inclined).

You will also need a VMT file named the same as the texture file was called when you apllied it in the modelling program (its important the VTF is called this, it doesn’t matter what the VTF file is called which we will get to in a sec). The VMT file is a text file which must have the .vmt extension when saved. It must contain this:


"VetexlitGeneric"
{
$basetexture "models/(path)/(name)"
}

for your most basic texture on a model. You can later add other more fancy stuff and different shaders for different things but this is your starting point.

The file hierarchy that your VMT and VTF files are put in are very important, if you incorrectly define them in the VMT your textures will not work (as you will have told the engine to look in the wrong place). Therefore you must put your textures files in a hierachy like so “materials/models/head/hat”. In this case the materials part is the first folder that you have all the following folders are put sequentually in this and then the next in the next one and so on. The “models” folder is the next folder down which you should always have for models (so you can find your textures more easily, though you don’t have to do this, its just the norm and makes life more easy for others). The next folder down in my example is “head” which will be inside the models folder and is just there really so your textures will not be loose in the models folder (as it can be annoying). Then finally there is the VMT file called “hat” which will be in the “head” folder (along with others usually if the model has more textures). So the VMT file called "hat.vmt " will look like this if you also called your VTF “hat”:


"VetexlitGeneric"
{
$basetexture "models/head/hat"
}

Notice the “materials” folder is not mentioned here as it is required for it to work so does not need to be defined. Also I have left off the “.vmt” from the end name as it is not needed (though if you do put it it makes no difference). Some people will also put the command lines in “” but i’m not sure why as they are completely unneeded, but just so you know. You can also call your texture (VTF) whatever you like and put it in any folder you wish but that will be the path you use in the VMT (the VMT path is the one you put in the QC under $cdmaterials).

Use mass 100 as default for models, i’ve found it generally results in everything being the right weight (which is quite strange i know).

Hopefully i’ve helped you be able to sort out your texture issues, but if they are still pink and black after doing that or if i’ve confused you let me know and i’ll try to help :slight_smile:

Ah, so that’s what a vmt is. I didn’t have one, so it’s off to a loading screen to test again. Just to confirm, the vmt is in the same place as the compiled vtf texture file, right? Well, guess I’ll find out once I get back into garry’s mod.

I wanted to post up the links in reply to Urami as soon as possible. Most of what I’ve been doing has been off the tutorials here:

Namely, I recently finished the “exporting a model from XSI” article found here:

Only thing I did that was different was compile using the HL2:episode 1 folders instead of the Deathmatch folders, simply because Garry’s mod is using the original HL2 engine, I think anyway. This in turn makes the compiling section a bit tricky to follow, but just give it a read over before making anything to understand what the tutorial is trying to get you to do. If you use the HL2:Episode 1 folder, your compiled files end up in the “username\half-life 2 episode one\episodic” folder, in either “models” or “materials”(which for me got created once I compiled a texture.)

The folder I used to compile into episode 1 was “sourcesdk_content\hl2”, which contains a “modelsrc” and “materialsrc” folder to put the uncompiled models in.

Last, the tutorial says the exe tools for the sourcesdk are in “username\sourcesdk\bin”, but I had to actually go two folders deeper to find the HL episode 1 compilers in “username\sourcesdk\bin\ep1\bin”

Other then that, the tutorial is very good and well written. It helped me get a model into source at least. :slight_smile:

Oh, and for ease of simplicity, copy someone’s addon for a prop, like say, the “Facepunch Smiley” addon, and just rename model folders, edit the info.txt and spawnlist.txt files. It’s a lot easier to test models in Gmod using the addon format instead of dumping all the materials and textures in the Gmod folders themselves.

Good luck!

I’ll get into Gmod and see if my horrible test texture is working after dinner tonight. Will update then.

That should work yes.

You can configure it for garry’s mod want me to paste in my explaination of how to do it (I think I saved it after the 4th time I typed it out ¬.¬).

You can compile from any folder you want so long as you tell the compiler where to look, which one are you using?

And yea that tutorial hasn’t been updated since before OB came out which is why it says to put it in the wrong place (bane of my life that bloody thing).

Also Garry’s mod is now running on a current version of the Orange Box engine (so jigglebones work), not on the ep1 engine (though your compiler must still be in the ep1/bin due to .dll files).

I’ve always done this :stuck_out_tongue: but using my own custom addon folder for compiled models. (Actually you don’t have to edit the info.txt if you don’t want to, it makes no difference whats written in it, its just having one with the right layout in it that makes a folder an addon. Though saying that you should never put “override” “1”, though i’m not sure why).

Ok so I read the tutorials and my brain asploded. Im far too inexperienced to understand what it is saying lol. Darkgriffin, if you get it working, could you upload it? For some reason i feel greedy for asking but it would be weeks before i could do it myself

It’s pretty much going to take me weeks as well, it’s just I actually have weeks to do it with, since the only other project I have is a personal game project(not Source engine related at all), and that is going to be at least a good few months of boring programming, and 2d sprite work. I’m learning this mostly because Truespace is no longer supported, and this is at least used for some commercial game engines, meaning I can add it to my vast, ever expanding, game making knowledge. :slight_smile:

Actually, I haven’t touched Guilimon at all since opening it successfully. I know nothing of rigging in this new modeler, and have been trying to get a test prop working to learn how source works first. At this point, I basically know how to output him as a stiff prop with purple squares, curtesy of my epic fail on texture paths and management. Which probably isn’t very useful, him being purple and black and stiff and all. :stuck_out_tongue:

The textures still arn’t working. I probably should just redo the whole thing from scratch anyway, this time I know I need to pay much more attention to directory paths. I’ll probably just make a setup similar to what Source Engine expects for my raw models and textures as well, just to keep everything consistant. As it is now, my modeling enviroment is using the default texture paths of the modeler, which might be why the textures arn’t working once the model is converted over.

Tomorrow I guess I’ll try another prop from scratch, this time with proper directory paths throughout the process.

Silver Spirit, I’d love to know how to configure the compiler to work directly into the Garry’s mod folders. Perhaps even directing the model output straight into a testing/in progress addon folder?

Goodnight everyone. I should have some time to hammer away at this a bit tomorrow. I’m going to try taking a texture tutorial from the wiki, so I can learn more about how the texture system works. It’s a lot different from the whole Materials, Lightmaps, and Feel(bumpmaps) systems Truespace had. I can tell it’s a lot more powerful, but it’s also new to me. The UV mapping tool in Softimage was amazing compared to the preset options in Truespace, as was the ability to save out the wireframe of a model for texturing.(Truespace instead has “live paint”, where you paint directly on the model. It’s great for artists, but bad for game engines in general, because the “textures” you get with the live paint have variable, dynamic dimensions.)

Unfotunately it will just dump your model in your main garrysmod/garrysmod/models/(path) folder (“path” being whatever you defined as the path of the model, which you will have to make in said models folder or the compile will fail, for most compilers), as far as i’m aware theres no way of telling it an exact desination to compile to (though that would be incredibly useful, so good idea ^^).

Right so the directions. This is the only one I could find lying around so I might write a better one layer. Just follow the steps and if you get confused let me know :):

Steam -> Tools -> SDK (open) -> Edit Game Configuration -> Name it Garry’s Mod -> click on the browse button “…” -> find the GMod gameifo.txt in the garrysmod/garrysmod folder click it, then click ok -> Then set it to Current game if it hasn’t automatically and Orange Box engine and close -> Run compilers and should work.