Orange Box JiggleBone decompiler

Download: http://tinyurl.com/4oreqt
Source code: http://pastebin.com/f1a45cb37

I coded this up a while back, figured it wasn’t doing much good rotting away on my hard drive.
It decompiles jigglebone data from compiled models and gives you the QC.
I think I’ve killed most of the bugs but there could still be some problems, so tell me if anything goes wrong with it.

To use it, open a command prompt (Start -> Run -> cmd) and cd to the location of the model file you’re using this on (ex: cd “%userprofile%\desktop”), then: jiggle_qcgen.exe modelfile.mdl.

It will output a qci file with the jiggle bone data, below are some examples:

From Chell.mdl:


$jigglebone "ponytail" {
	is_rigid {
		length 20
		tip_mass -100
		angle_constraint 25
	}
}

From AntlionWorker.mdl:



$jigglebone "Antlion.AntR_bone" {
	is_flexible {
		yaw_stiffness 700
		yaw_damping 8
		pitch_stiffness 700
		pitch_damping 8
		along_stiffness 100
		along_damping 0
		length 5
		tip_mass 10
		angle_constraint 20
	}
}

$jigglebone "Antlion.AntL_bone" {
	is_flexible {
		yaw_stiffness 700
		yaw_damping 7
		pitch_stiffness 700
		pitch_damping 8
		along_stiffness 100
		along_damping 0
		length 5
		tip_mass 15
		angle_constraint 20
	}
}

$jigglebone "Antlion.glasswingR_bone" {
	is_flexible {
		yaw_stiffness 700
		yaw_damping 6
		pitch_stiffness 700
		pitch_damping 8
		along_stiffness 100
		along_damping 0
		length 30
		tip_mass 5
		angle_constraint 37
	}
}

$jigglebone "Antlion.glasswingL_bone" {
	is_flexible {
		yaw_stiffness 700
		yaw_damping 5
		pitch_stiffness 700
		pitch_damping 8
		along_stiffness 100
		along_damping 0
		length 30
		tip_mass 5
		angle_constraint 40
	}
}


For those who are thinking “what the fuck is a jigglebone?”: http://developer.valvesoftware.com/wiki/%24jigglebone

Great, now to jiggle some boob bones on Alyx. :q:

haha has to be done :smiley:

Jigglebone, teehee.

**


(User was banned for this post (Reason: Image macro) [event] 81682 [/event])

**

nice…

Vary nice.

Would this work on non-OB models? Like, if I compile it for the ep1 engine, would it still work?

And is it possible to use it to make an attempt a something in the process of learning how to make a (almost) completely new playermodel for teamfortress 2?

Nope

Someone must do a new Mdldecompiler for the 2007 engine, i’ve emailed valve about this, but no one replied :frowning:

Valve don’t do decompilers

They must do…

Valve do lots of stuff and they can’t do a simple MDL decompiler ?

:frowning:

…of course they can, but why would they do it for their own formats?

Well, there are mods, and mods usually uses Custom models, and to learn how to do custom models we need to see an example first right ? Unless you are very smart and can do everything from the scratch. :slight_smile:

Yeah but all you really need for custom models is the skeleton and animations which are in the SDK anyway.

Even if they weren’t it would be simple to get the skeletons, example:



studiohdr_t *phdr = (studiohdr_t*)ModelFileBuffer;

fprintf( smdfile, "nodes
" );
for( int i = 0; i < phdr->numbones; i++ )
{
    mstudiobone_t *pbone = phdr->pBone( i );
    fprintf( smdfile, "%3i \"%s\" %i
", i, pbone->pszName(), pbone->parent );
}
fprintf( smdfile, "end
" );

fprintf( smd, "skeleton
time0
" );
for( i = 0; i < phdr->numbones; i++ ) 
{
    mstudiobone_t *pbone = phdr->pBone( i );
    fprintf( smdfile, "%3i %f %f %f %f %f %f
", i, pbone->pos.x, pbone->pos.y, pbone->pos.z, pbone->rot.x, pbone->rot.y, pbone->rot.z );
}
fprintf( smdfile, "end
" );


Bam, then you have the skeleton SMD.

forget this.

Forgot what?

I’ve posted in the wrong thread. :stuck_out_tongue:

Oh :frowning:
/me cries

Lol. Don’t worry, this thread is very useful, moderators should stick this :slight_smile:

wow this is very useful tool for me :smiley: since jigglebones are pretty new to me

anyway, can anyone download the exe file ? the address is all messed up