Weighting/Rigging issue

I’ve been trying to do a simple model replacement for the P228 in CSS (using the Crysis Socom pistol), however:

As you can see, I’m clearly not doing something right. The slide is in the completely wrong place. Ignore the arms, I had Half-Life 2 set instead of CSS in GUIstudioMDL when I compiled, hence the missing texture.

Anyway, I’ve tried doing this via 3DS Max, but editing envelopes is a bitch, so I tried it via Milkshape, which ignores weights completely, making things much easier for me. I was able to link the objects to the right bones easily and such and get rid of the original P228 model. Everything animates correctly other than the slide not being in the right place. Does it have something to do with the origin not being in the correct place?

I should also note that when trying to see it in CSS, the model doesn’t even appear. I’m pretty sure this also has something to do with the rig itself not functioning properly.

Any info, like a suitable tutorial (I’ve checked all over the place) or your own advice would be greatly appreciated. If I can get this fixed, I’ll compile a separate model with a custom name for you guys to use in sweps and other nonsense…and the pistol sounds from Crysis too. :smiley:

No one? Just forwarding me to a related tutorial is all I ask for…

This looks like something you need to figure out yourself, since it could be any number of things. I will suggest using 3ds max to manually edit vertex weights (using the envelopes is kinda dodgy). It’s easy for stuff like this, since you can choose entire objects and force all their weight to the correct bone.

Yeah I’ve been trying to figure that out this whole time. It’s just that I can’t select all of the verts of the object that I want to weigh to the single bone. I guess it’s all trial and error in the end, though.

Thanks for the help.

Step 1: Apply skin modifier

http://img189.imageshack.us/img189/3941/84959537.png

Step 2: Expand “Parameters” tab and edit envelopes, check Select Vertices and Select Element

http://img40.imageshack.us/img40/3664/69281959.png

Step 3: Scroll down and click the wrench icon to bring up a little window

http://img9.imageshack.us/img9/696/31456975.png

Step 4: Select bone you want to weigh from the modifier panel

http://img189.imageshack.us/img189/2926/70323411.png

Step 5: Click “1” to give those selected vertices all their weight to the selected bone

http://img149.imageshack.us/img149/6662/15501571.png

[editline]10:30PM[/editline]

Oh yeah in between steps 4 and 5, select the desired vertices

[editline]10:35PM[/editline]

And also during step 2, add in your bones (although it seems you may have gotten that far anyway) with that “Add” button

Thanks a CRAP load. I figured out the reason why I couldn’t select all the verts for each object. The option to “Select Elements” wasn’t ticked.

Thanks, I’ll try and see how this plays out.

Edit:

It’s actually worse now. The clip isn’t positioned correctly. The trigger and hammer pretty much always work though. I made sure I had absolutely every vert selected for each object when I was weighing them.

Just a thought, but would the origin of each piece of the gun matter? Even though the slide was fucked up, I couldn’t see the model in CSS at all. I’m pretty sure Source uses the model’s origin to determine where it sits in the first person view, or something like that. Also, would the fact that the gun isn’t one single object affect anything? The clip, frame, hammer, trigger, and slide are all separate objects (for the sake of actually being able to select individual pieces).

It doesn’t matter that the gun is separate objects. Most aren’t. And to change the origin is the $origin command.

But I don’t know what’s going on, I say just keep looking at the provided viewmodels in sourcesdk_content and keep trying different stuff.

if you want the entire object to follow the bone, just use the linking tool.

[editline]06:54PM[/editline]

Still works when exporting to .smd and is a lot easier.

It’s kind of strange though how the bones aren’t already linked. The bones are from the P228_Reference SMD when I decompiled the MDL file. I thought that just replacing the mesh and linking the pieces to the corresponding bones would be enough.

Anyway, I’ll try linking right now. Thanks for all the help.

EDIT:

Good FECKING lord, this explains everything. The animation SMDs are totally butt-fucked. All the bones are moved around and shit; the one selected is the slide bone. Is this an issue with the MDL decompiler, an importing issue, or would I SERIOUSLY have to fix all of this myself? That’s…going to suck ass…