Bone attachments

Avatar
narsqrd
35 Posts
Posted Sep 20, 2012
I'm looking at a model in the Model Viewer, and I see that it has all sorts of bones but only 3 predefined attachments. Doing some research I see that if i wanted to add such attachments to the model I'd have to modify the .qc file and recompile the model -- that would of course involve first decompiling the model, editing the current .qc file and recompiling -- which really turns out to be a head ache when there are few (if any) functioning decompilers available.

Is there any other way to parent an entity to a model at a particular bone that doesn't have a predefined attachment? Or am I s.o.l?

Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Sep 20, 2012
Replied 2 hours later
Unfortunately, no, there isn't. Sorry.
Avatar
Skotty
671 Posts
Posted Sep 20, 2012
Replied 35 minutes later
You would have to change the model itself, more or less. While the process itself isn't complicated, the model could break while doing this.
Avatar
narsqrd
35 Posts
Posted Sep 20, 2012
Replied 47 minutes later
Alright, so let me get more specific and see if my particular problem can be solved differently.

I'm looking to use a Chell model holding a portal gun, so the gun would have to attach to the weapon_bone of the Chell model.

In Hammer's model viewer there seem to be 2 models for Chell. 1 "proper" model (player\chell\player.mdl) with textures and working animations, but the only attachments defined are for parts on the head, none involving the weapon_bone. The other model (player.mdl -- not in a subdirectory) is not textured and most of the animations don't appear to work, but it does have a defined weapon_att attachment for the weapon_bone. In that same directory there is also a player_animations.mdl which I would figure is involved in giving that model proper animations, but I don't know how that works.

I would try to edit the .qc file from the first Chell model and hope that nothing breaks between de- and re- compiling, but the only MDLDecompiler program I've found seems dated and keeps crashing on me.

Avatar
FelixGriffin
2,680 Posts
Posted Sep 20, 2012
Replied 1 hour later
Yeah, nothing with animations will ever decompile right. Sorry.
Avatar
protoborg
288 Posts
Posted Sep 21, 2012
Replied 14 hours later

FelixGriffin wrote:
Yeah, nothing with animations will ever decompile right. Sorry.

Pessimistic much?

Actually, with the right program, you can get it to decompile correctly. The only problem is Valve is not about to give you THEIR compiler. Without it, yes, the decompile will fail to work correctly.

Avatar
FelixGriffin
2,680 Posts
Posted Sep 21, 2012
Replied 7 hours later
I've been hacking for weeks trying to decompile and recompile all the shared human animations from HL2 into the Portal 2 animation format. So far I've managed to get one glitchy gesture SMD file that launches the right arm off.
Avatar
Skotty
671 Posts
Posted Sep 21, 2012
Replied 23 minutes later

protoborg wrote:
The only problem is Valve is not about to give you THEIR compiler.

Sounds stupid. Valve doesn't need any decompiler! They have ALL SMD files.

And yes, decompiling Portal 2 models is a bit tricky. There is something called "MDLDecompiler 0.5 by Cannonfodder # Fixed & Patched by Hooch". It works better than the last version Cannonfodder released, at least for Left 4 Dead 1 and 2 models.
For Portal 2 it works better, too. But you still have to copy some of the VTX files and give them names with .90, because this MDL decompiler still needs "the old" files that are now missing in the new MDL version.

Avatar
HMW
806 Posts
Posted Sep 22, 2012
Replied 17 hours later

FelixGriffin wrote:
So far I've managed to get one glitchy gesture SMD file that launches the right arm off.

You do know that the gesture of launching your right arm off is perceived as highly offensive in some cultures, right?

Avatar
FelixGriffin
2,680 Posts
Posted Sep 22, 2012
Replied 14 minutes later
That wasn't what it was supposed to do! :sad:

I didn't even know that bones could detach in animations, or that gesture_turn_right_180 had detaching bones.

Avatar
HMW
806 Posts
Posted Sep 23, 2012
Replied 20 hours later
That's new info for me too, that animations can actually change the topology of bones. (I.E. detach them.)

Have you tried opening the decompiled SMDs in something like Blender and see if they play correctly there? (You need to import the reference SMD first, then import the animation you want.)

If you don't know how that works, I can have a look if you PM me the SMD files.

Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Sep 23, 2012
Replied 48 minutes later
I'll try that. I can usually open Blender correctly, and I've managed to build a simple model of a 1-foot untextured cube. It's just editing and saving that don't work. :razz: