Sorry if this is in the wrong thread, but anyway, I've been trying to compile a model for a project I'm doing, yet no matter what I do, it always comes out untextured. I've read the source developer wiki, yet nothing. This is my last resort. If anyone would be kind enough, to see if they can compile it and get it working? Because I obviously can't no matter what I do. Here's the .obj and the .mtl. OBJ: Cell Project.obj MTL: Cell Project.mtl. By the way, if anyone does decide to help, I would need it done by Monday, the 25th.
Make a more descriptive title next time please.
I can’t change the title name can I?
Nope
Not sure what your problem is on your end... Object was so far of 0,0,0 that it would not display...Placed at 0 and it shows your colors that you applied. Re-saved and checked works ok in Blender,Rhino and 3ds max. Temp.zip
If this doesn't work on your end then you have the display for your colors turned off so how. Without more info I don't know what the problem may be.
Oddly enough it doesn't seem like the models you put up for download exist.
So your problems are:
The model has no texture in-game
The model is an effect
Luckly for you, both problems are fairly straight forward, the fact that it has no texture (90% of the times) is because the path file is wrong, in the qc. the line
$cdmaterials "despacito\"
Indicates where the mdl will try to find its texture, this means that, no matter where you put your mdl (you tried moving it around), that folder is where it will search for its textures, it's not specified because materials always go there but the full folder would be "C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\materials" followed by the folder "despacito", the "\" is there because it's pointing at the entire folder and not a single texture.
How you described might also suggest that you have no texture at all, if this is the case say so because it's very important.
As for the second problem, models in source are divided in 3 in order of complexity:
Effect: The model has no physics
Prop: The model has physics
Ragdoll: The model has joint physics
For the model to be an effect, it has absolutely nothing but the bare minimum, for it to be a prop it needs the $collisionmodel line, while for it to be a ragdoll it's going to need $collisionjoints.
Share with us the QC and some pics so we can see for ourselves.
I have no idea what .mtl is, I thought it was the actual .mdl but I misread, I can't help with 3dsMax.
Yeah, but here’s the thing. It compiles the mod, along with other files such as a vvd and vtx. Through research I found that none of those are textures. Do I need vtfs?
$modelname "models\my_cell_project.mdl"
$body mybody "my_cell_project-ref.smd"
$staticprop
$surfaceprop combine_metal
$cdmaterials "models\"
$sequence idle "my_cell_project.smd" // no animation wanted, so re-using the reference mesh
$collisionmodel "my_cell_project-phys.smd" { $concave }
That's my qc. As for pictures, here:
https://files.facepunch.com/forum/upload/443552/04d7af48-8ea4-4d6e-aa68-0766c00e2086/Garry's Mod 3_19_2019 2_42_29 PM.png
https://files.facepunch.com/forum/upload/443552/3495b3b5-ff05-491d-8572-dc25593dec97/Garry's Mod 3_19_2019 2_43_03 PM.png
Everything looks fine here, the only thing missing is the texture which, by the way, you do need the .vtf and .vmt , make sure the .vmt is named after the material of the model, you can see what its name is in your modelling software, $cdmaterials only defines the path where the .mdl is going to search for textures, the names of the textures it looks for are the ones in the model itself (the smd).
Also, is the model actually concave? You might want to get rid of that, don't know if it actually causes problems tho.
What do you mean by "When I combine all the parts into one model, and export it, it only gives me one smd." ? Are you referring to multiple meshes before exporting to .smd?
You only need 2 smd for this, the model (called reference in this case) and the physics, if your model is simple enough and consists of a single convex mesh, you might just be able to re-use it without problems, something like:
$collisionmodel "my_cell_project-ref.smd"
Alright. But how would I go about texturing it. I mean, I have some experience with texturing, but only texturing flat surfaces. Do I have to recreate the texture all together? When I compile it, it gives me a couple files alongside the .mdl. It gives me 2 vtx files, one for directx 90 and directx 80. Then, it gives me an extra vtx with no name except the model name. Then, it gives me a vvd file. Are any of those the texture?
This..
Has turned into a difficult situation.
For the sake of writing a better response, you should answer these questions, if you want of couse:
Is this a model from a game / third party? (if no skip to number 3)
Do you already have the texture? (if yes skip to number 4)
Is the model already UV unwrapped?
Does the model have a bone?
Is the model completely convex?
To answer the first question, after the compilation, a bunch of files are made with the .mdl , keep them in the same folder, they should have similar names, the textures are not in there, textures are in separate folders.
As for the concave line, I am not that sure, if you answered "yes" to the fifth question, then replace the whole collisionmodel line with the one I made above
$collisionmodel "my_cell_project-ref.smd"
It should work, I say "should" because I've never actually used a collision model line that barebone, but since the model is static, all the other values should be set by the defaults since you didn't specify them, I'll check later if I'm just talking out of my ass.
Now I'm the one to say sorry for the confusion because I should've explained better as well, the physics model and the reference model are 2 separate things, they are 2 different models and need to be made individually, this is why I said effects are the easiest, because they don't require a different model.
You can see various examples of what they look like from an old thread with many nice pictures:
Just ported a model but 2 issues occured
Most of those are concave, but if yours is convex (and simple enough), you may just be able to use your own model as its own physics, maybe a picture from the modelling software's viewport would tell us more.
So, what you’re saying is that I should export my obj into an and twice and name one ref and name the second one phys? Also, when I made it, it was already textured. No it has no bones. Yes it’s my model. I have no idea what “UV wrapped means”. I’m not sure if it is completly convex or not.
Ok, I'm kind of an idiot beacause some of those I could have seen from the pictures, since the missing texture's texture is placed so well, it must be UV unwrapped (to explain this, think of how textures are 2d images but for 3d objects, "unwrapping" a model is just like unwrapping a present, the paper on it wraps around the box, making it 3d, but once unwrapped it's a 2d piece of paper with images on it).
Also, when seeing up close, the model has some small rivets (?) on its surface, so it's not convex, unfortunately, this means you will have to make a physics model yourself, if it were just a cylinder with nothing on it, you could use the reference mesh as the physics, since the physics model is made up of convex simple models.
This doesn't mean you will finally get to use the "concave" line, because changes so small in the geometry should make no difference to how the prop behaves, oh, and because making the physics concave is a hussle.
The link I used to show you how physics models look like is also one where you get to learn how to make one yourself ( Just ported a model but 2 issues occured this thread is really similar to your problem, so make sure you give it a good read)
Beware, all source props need at least one bone, I think, but this can be explained in a few short steps:
Create a new bone and give it a cool name
Give your prop an armature modifier (in the modifier tab)
Select your bone(s) as the target of the modifier
Create a vertex group with the same cool name of the bone
Select in edit mode all vertices (A) and press "assign" when you have the vertex group selected (strenght set to full)
This bone W I L L need to be the S A M E bone used for B O T H the physics model and the reference mesh, so once you exported the new reference model, hide the mesh (and only the mesh) and create the physics model, remember to apply position, rotation and transformations, alternatively, once you added the cylinder, INSTANTLY go to edit mode, so you don't have to apply rotpos+transformations.
When I hide the mesh, everything disappears in blender. Is that what's supposed to happen?
This is exactly the type of update I wanted to hear, if it's textured on blender (thank god you're using blender) it means that:
It has a working texture
Its already unwrapped
The materials are already set correctly to be exported
You can get the material!
First we'll work on actually getting the material out, change view to "UV/Image Editor" , on the right on "image" you will be able to select with a drop-down list the image you'll be viewing, on default it's set on "Render Result", but you can also select the model's material.
Once selected (it will be what appears on the viewport) you can go to "image" an "save as image" or just press F3, save it somewhere are PNG and don't change its name, the name of the .vmt will need to be the same as it is called in the model itself, you can check the name by going into the material tab, but usually it is going to be the same, you still have to be absolutely sure because this is something many people get wrong, this is an example of what the names look like:
https://i.gyazo.com/6414f559129bf25f00633bd032fb5d42.png
Ignore the fact that there are 2.
In source, textures mostly work with .VMT (valve material type) and .VTF (valve texture format), the names themselves give some clues, VTF is just the texture, usually the diffuse, but it can also contain other types of textures using its alpha channel (it works on RGB+A), .VMT is the material, to make it simple, it's basically the .QC of a material, it's in text form and you write how you want it to appear, just like the QC, you can make it very complicated and have a masterpiece of a texture, but usually it's going to be really simple.
You will now need a software called "VTFEdit" , you can download it here (THIS IS A LINK TO A DIRECT DOWNLOAD, IT WILL START AS SOON AS YOU CLICK IT)
From here, you will need to open VTFEdit, select "File" > "Import" and choose the .png of your image, use these as your settings:
https://i.gyazo.com/37de5e65046bc3bd5da500ca93bd9181.png
You can change the width and height, but anything over 1024 will be very heavy, these settings are the bare minimum, and "animated texture" isn't actually animated so don't worry.
Press OK and go again to "file" > "save as" , then choose any name you want, only the vmt needs to have the same name, the vmt will then search for the vtf based on what you write on it.
Now to type up the .VMT, just like you did with a .QC, this is just a normal text file called ".vmt", give it the name we talked about for so long and then type this:
"VertexlitGeneric"
{
$basetexture models/THEnameOFyourVTF
$ambientocclusion 1
}
You could only have the base texture, but I suggest using ambient occlusion on almost all of your future texture, as most of the times it has a positive change (I say "almost" and "most of the times" but really I mean use it always, there is no drawback for simple textures).
Also, change "THEnameOFyourVTF" to the name of your VTF, this is why it didn't matter how you named it, because you can choose what texture the VMT looks for just by changing its text, DO NOT INCLUDE .VTF, as it only accepts vtf, if you do include it, the VMT will search for a file called "name.VTF.VTF".
You're done, save the VMT, put the VMT and VTF on the "models" folder and the next time you look at it in game, the texture will be there.
A few closing notes, the "models" folder's full path is "C:\Program Files (x86)\Steam\steamapps\common\GarrysMod\garrysmod\materials\models" , this is because you set of the line:
$cdmaterials "models\"
Any folder specified in $cdmaterials is automatically created by crowbar in the materials folder mentioned earlier, this is why it's "materials\models".
It didn't work. How about I upload the model and you try it. Maybe I am doing something wrong? Here is the model. Cell Project.mtlCell Project.obj import those into blender as wavefront files. But import the .mtl first.
Oh, I see, it's not that the files you shared didn't work, it's just that the model isn't centered, at least for me.
Ah, it's called cell project because it's a cell, not the name of a game.
You're right, those aren't rivets, they literally are organelles.
This changes everything, for the worse.
The reason it didn't work is because there is no texture and the model isn't unwrapped, the model isn't already textured in blender, you just made a lot of materials and assigned them to the model's faces,
then you assigned them a viewport color
nevermind, you did this:
https://i.gyazo.com/3386c27280d2f8c185a3be72f2e3c562.png
???
There must be at least 10 different materials and they all look like that, where did this come from? At this point I would've preferred if you just colored the materials instead of using nodes.
Sorry but the write-up on this would be long, and it would be easier for you to actually see a video on it.
What you will need to search is how to make textures in blender, there are plenty of tutorials, once you've learned how to UV unwrap your model and color a texture, you can then follow my last post as it assumed you already:
Had a texture
The model was already unwrapped
Well, actually, I made it in sketchup, and imported it.
Sorry, you need to Log In to post a reply to this thread.