• Issue with porting physics model (Blender)
    22 replies, posted
I've been trying to create and compile a physics model for a prop I'm trying to port to Source engine. So, I created the new model I was gonna use as physics model for the object I'm trying to port, I assigned the same vertex group name to the rectangles group of the new model, set the right origin position and exported as .smd. Then I modified the .qc and went ahead to compile. Then I got the error     "  WARNING: Error with convex elements of physics.smd, building single convex!!!!       Model has 1 convex sub-parts" What did I do wrong this time? The 2 models file (one overlaps the other in blender in case you don't see the original): blendermodel
If I were you I'd remove that extra rectangle on top that is superimposed onto another one, I'd assume that's the "convex sub-part" but I can't be sure, I'd also correct the normals, go in edit mode, select all vertices and press CTRL+N and it will do it automatically, maybe that's a problem too? All in all, there shouldn't be anything wrong with the model from my *quick* analisys, if the error persists you could try remaking one from scratch, shouldn't take too long. Another thing to take in account would be having the actual collision mesh well aligned, the model will have bumps and empty spaces if left like this, you can do it manually one by one or do it the quick way selecting all faces from one side like this ☐ and then resizing them with S on a single plane (pressing x or z or y) and pressing 0, so they'll be flat, then doing the same on the other side.
I'm so triggered right now. I re-created the model, CTRL+J'ed all the rectangles, applied the weight, selected 'em and CTRL+N'd (Not sure if I need to do anything else except pressing CTRL+N), also named the vertex group the same with original model and still get the error. I really need a damn break, spent 7 hours working on this freaking frame model today and it keeps beating up me, huh. https://files.facepunch.com/forum/upload/162170/61cce0eb-7b7f-44ae-90bb-c46cdb2b0169/fml.gif
Ok, I am stupid, maybe the problem is that you didn't put $concave in the qc?
Nope, I have done that 100%.
Shit, does it still compile? If so just ignore the warning. Did you remember to smooth it in blender? If nothing works just give me the files and I'll try to compile it, might be something with your compiler. From searching online it seems like the problem is caused from either it not being smooth shaded or having "open edges", I have no clue what that'd be but I'm not even sure you could screw it up that badly on purpose.
Trust me, considering I'm the one who made this model, the chances of Crowbar being the faulty program here are below 1%. Thing is I'm not a modeller and this new process is extremely difficult in my opinion, it's not just making a physics model, I have to rig it, and do a shit ton of other stuff which I didn't know they existed, let alone do them. Like, I can't even get the physics model to be perfect without having rectangles slightly overlap each other. Plus, when resizing one, both sides resize, (figured out how to use proportional editing). I also don't know how to make each rectangle perfectly aligned with the others. It's a huge unending clusterfunk. I'll keep trying later today. Also that's the file: newblendermodel In case you figure anything out mind taking a few screenshots with the whole process you went through to rig it?
Well, I guess that should be more than enough for you, if you pass me the whole folder, including the QC, reference and animations I will try to make the physics and compile it for you.
The file: door01_frame It includes materials, qc, ref, animations (idle-the one you had provided me with when you created the blast door), so you'll just need to place the physics model. If it's possible can you like record or take screenshots of each thing you do since there are more models I'll need to port and I need to learn this method. Also, I wanna apologize for being a pain in the ass ;-;.
Here is the folder with the compiled version: MEGA I also made a lenghty gif that shows how I made the physics, after that I just compiled the model and it worked perfectly, it all works in blender but when I loaded the exported models they were completely messed up, hopefully it was just a blender error and they should work in source since it compiled. https://i.imgur.com/UeR6C0E.gif
That's amazing, I'll test it out tomorrow in-game. Also may I ask, what shortcuts did you use when: 1) Resized the first L (made it wider) 2) Copied the L and technically mirrored it Additionally, right after you finished adjusting the second L, the stuff you did with both of 'em had to do with resizing or you applied something using shortcuts? Thanks in advance!
Holy shit, I forgot there was a mode in blender LITERALLY made for this kind of stuff that shows what buttons you're pressing, my bad. First of all, to go into flat view, you press KP_5, the various KP numbers allow you to move the camera in different views, 1 is the front on which you see me use a lot of times, 3 is side view which is the one I used for the first question: To resize them I pressed first S (which is the resize tool) and then Y so it'd only resize in that plane, to resize slower you can press shift while doing it so it goes slower. To copy selected mesh you press ALT+D (which should stand for duplicate), some tools, like the extrude tool (e) or intrude (i) you'll need to press right click for the new vertices not to move around, the same applies with duplicating mesh, as you can see when I duplicate it it's moving around following my mouse, when I right click the copied mesh will take the same position as the original one. Since it's selected I decide to rotate it by the origin point pressing R and like the resizing I select it to only rotate in one axis, I don't remember which but then if you type a number (this works for many other tools too) it will rotate by that number, in my case I would've done "R+Y+180" to rotate it and "mirror" it. In the last part, since I wasn't precise, I decided to remove all the wonky bits that would make the collision mesh less precise. To do that I simply select the faces I want to be flat and resize them by a single axis as 0 (like explained before), so if I press S+Y+0 the mesh selected will be completely flat on the Y axis since I resized it to 0 on that plane. I also targeted the center of the mesh, the reason it didn't work the first time was because I was targeting the origin point, resizing it to 0 meant that it would be 0 relative to the origin point so it got there, if I put 2 instead it would've went farther on my left.
Just tested the model in-game, I tried both compiling it myself (no errors in crowbar) and using the compiled files you had in the folder, however it's still a big rectangle model, no concave. Without being familiar with the stuff, do you think the last part where you made everything flat might have conflicted with the model or something?
I'm happy now, because this is absolutely the first time I'm able to confirm something with 100% accuracy and would fight someone over denying this, the last part has nothing to do with it, my best guess is that I should've used 4 different rectangles instead of 2 L, this is the page linked in the collision model page in the valve wiki and the first example it gives is exactly what I did wrong, I still don't understand why it worked for the lift model in gmod but the door's physics model probably got shrinkwrapped forming 2 rectangle's halves closing the gap... not the best from my part.
No problem here. I'll create one myself this Thursday and post an update on this. Cheers.
Alright, I finally managed to make a working physics model, damn great. I want to give a big thanks for all your help and support, I don't even know if I would have even realized the reason behind the compiling error if it wasn't for you! Have a great day.
Great! Glad all worked out, but before that I'd like to give a shout out to my boys in Gnomeregan. Keeping it real Big-T, Snoop-Pup and Little Dees. Y'all are short, but you're real, baby! god that was awful
Ironically enough, I've ran up to another small issue with another models textures. In order not to spam threads on facepunch and since this one hasn't got many replies, I'll post it here. I've got 1 model which includes 3 different drawmeshes which are textured individually. https://files.facepunch.com/forum/upload/162170/f21b45e8-1ed8-4995-8403-b87e63a8c337/upload1.png Question is, how can I export those 3 materials on 1 UV Map .png file? I have tried exporting the UV Map layout: https://files.facepunch.com/forum/upload/162170/41c459db-0cf0-471f-ab50-53361c5b3278/upload2.png But it looks like this afterwards: https://files.facepunch.com/forum/upload/162170/bb82bdaf-ebdf-4d51-8ea0-6d4ce0b8099d/upload3.png In render mode the whole model is also pitch black, while it's textured. Any suggestions?
The answer is more simple than you would've thought, the UV is like that, there's a possibility that it's like that because something went wrong but then again the SCP:CB materials are """""infamous""""" for being like this. It is true that the you'll only need 1 UV map, but you'll need 3 different VMTs (and so 3 different VTFs too), if assigning them in blender worked, then it means that when the model will search for the materials in the $cdmaterials and will find the VMTs then they'll be assigned to those materials. Having multiple materials is used more often than you thing, especially when you want a part of a model to be radically different than another, as example you can have a guy's armour be like metal, but his skin acting like flesh.
What I did in Blender was simply assign each texture on each draw mesh, what I don't understand if it's necessary that I also create a UV Map and what else to do with that UV Map file. Like, when I ported the door frame, the UV Path was preassigned since the materials were applied perfectly to the models, right? Since those 3 textures were also prefectly assigned even though they're individual, wouldn't they also have a UV Path already? Also, when you have 3 VMT/VTFs for 1 model, let's say metal01, metal02, metal03, and the models name is catwalk01. In the VMT, specifically $basetexture, should it be like this: "$basetexture" "models/cbmodels/metal01" or this?: "$basetexture" "models/cbmodels/catwalk01" Also, when I tried the model in-game, it was black/purple. If I'm not wrong, if the textures were actually applied but without a UV path, wouldn't the textures be extremely fucked or it would still have black/pink textures?
Make 3 materials in blender (not textures) Name these 3 materials like the textures Assign the different materials to the correct vertices There should already be these 3 materials so you might not need to do that, but if there aren't you can select the vertices by selecting the ones the textures they're assigned to and then apply the material while you have those vertices selected, you can export it like that, but remember that the names will need to be the same. The base texture will need to be "models/cbmodels/metal01" in the VMT, but you'll also need 3 different VMTs that point to the 3 different VTFs. Call the VMTs the same as they are called in blender and type the folder that all the VMTs are in the $cdmaterials.
Thanks a lot, I actually got the textures to work way faster than I expected, hah. I think I'm almost done with the whole blender-learning process (obviously extremely basic stuff that I'm gonna need, 0.03% of Blender), I just need to figure out how to resize models precisely, since 1 meter in Blender is 1 unit in Hammer, and if it's not resized this way it's gonna be quite painful to adjust, and sometimes even impossible without having a really bad effect on the map. Do you have any tips for this one?
I am sure there's a better way but for now the best thing you can do to get a sense of scale is having a player's model saved so you can compare it.
Sorry, you need to Log In to post a reply to this thread.