GMOD: Appling Physics on Skirt

So I’m struggling for my first port from MMD to playermodel, I cant get it work properly with jiggle bones.

Below is my current jiggle bones.



$jigglebone "hair" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 8
		pitch_stiffness 300
		pitch_damping 6
		tip_mass 6
		length 30
		angle_constraint 30
	}
}
$jigglebone "l1" {
	is_flexible {
		pitch_stiffness 350
		pitch_damping 8
		tip_mass 0
		length 30
		angle_constraint 25
	}
}
$jigglebone "l2" {
	is_flexible {
		pitch_stiffness 350
		pitch_damping 8
		tip_mass 0
		length 30
		angle_constraint 25
	}
}
$jigglebone "lb1" {
	is_flexible {
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 25
	}
}
$jigglebone "lb2" {
	is_flexible {
		pitch_stiffness 350
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 20
	}
}
$jigglebone "s11" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 6
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s1" {
	is_flexible {
		yaw_stiffness 250
		yaw_damping 6
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s21" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 6
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s2" {
	is_flexible {
		yaw_stiffness 250
		yaw_damping 6
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s31" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 6
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s3" {
	is_flexible {
		yaw_stiffness 250
		yaw_damping 6
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s41" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 6
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s4" {
	is_flexible {
		yaw_stiffness 250
		yaw_damping 6
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s51" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 6
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s5" {
	is_flexible {
		yaw_stiffness 250
		yaw_damping 6
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s61" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 6
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s6" {
	is_flexible {
		yaw_stiffness 250
		yaw_damping 6
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s71" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 6
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s7" {
	is_flexible {
		yaw_stiffness 250
		yaw_damping 6
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s81" {
	is_flexible {
		yaw_stiffness 300
		yaw_damping 6
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "s8" {
	is_flexible {
		yaw_stiffness 250
		yaw_damping 6
		pitch_stiffness 300
		pitch_damping 8
		tip_mass 2
		length 30
		angle_constraint 30
	}
}
$jigglebone "b1" {
	is_flexible {
		yaw_stiffness 400
		yaw_damping 8
		pitch_stiffness 250
		pitch_damping 8
		tip_mass 4
		length 30
		angle_constraint 20
	}


When I use this, ofcourse I get leg going through skirt and pretty annoying for me.
And this is position of jiggle bones and weight.

http://images.akamai.steamusercontent.com/ugc/317872565979988109/C8D10B2A8F15720202E8D01A0A5B6FA685271151/

after spending months working on skirt I gave up at this, and checked medic’s smd files, but it all broke inside 3ds max.
but I got this code that applies physics to his cloth.



$collisionjoints "phymodel.smd" {
$mass 100.0
$inertia 10.00
$damping 0.00
$rotdamping 7.00
$rootbone "bip_pelvis"
$jointrotdamping "bip_pelvis" 0.00

$jointmassbias "prp_coat_front_1_r" 0.75
$jointconstrain "prp_coat_front_1_r" x limit -10.00 22.00 0.00
$jointconstrain "prp_coat_front_1_r" y limit -19.00 25.00 0.00
$jointconstrain "prp_coat_front_1_r" z limit -17.00 15.00 0.00


So is there any way to apply this to my ported model?
Since I never learned programing, please give me example and some explanations rather than just saying “Do this”.
If you need my file, Here it is.

What’s actually wrong with it? Do the jiggle bones just not move at all or what?

No, it works but as you see, her skirt is pretty long and it doesn’t look good at any motions except walking/standing.

didn’t man to rate that. hand on touchpad accident. :v: and…

what means doesn’t look good? first of all… i dunno if anybody got this yet… the gravity vector. z. turn the bones z-down on their local axis. it looks wrong but it’s the physical rotation. don’t ask… just do it. and… you might tweak you jiggle settings. the stiffness and damping and mass.

for the leg motion: the ‘leg thru skirt’ jumping? you could add a parent constraint. parent the upper skirt bones to the leg. you maybe gotta setup the gravity vector above the knee or forward or use the angle constraints that makes them not fall thru the leg again tho. i dunno if this would work combined with rag physics models attached to the jiggles to make it actually not do so. i have this ‘experiment’ here but not ingame tested yet. just sfm… which is pretty dead rag physics. when i feel like it i’ll maybe compile your model. :smile:

Ah, really sorry for late reply, I didnt get any email from facepunch;; must be inside of weird folders

Can you explain me more of bone constraint? If it is what I know, skirt bone gonna be child bone of leg?
And what’s that medic’s QC is using? Really physics or not?

What you have is fine, the only real way you could make it more smooth / better looking is to add more bones to the skirt. Currently you have multiple sets of two bones (one starting at her hip, the other starting halfway through the skirt), whereas you can try to up that to three bones and see if that helps make things smoother.

Thx for reply, but its curremtly pretty smooth enough, and it won’t fix my skirt penetration;

yes… that’s the idea. the jiggle as a child of the leg. you might have to place it ‘correct’ or closer to the leg, so it is rotates on a nice axis with the leg, without glitching thru the lower body for example.

So I have to break connection between jigglebone and pelivis bone, and hook it to leg?
Oh then I can simply adjust stiffness of it!

Wait, is it possible to not mess up with skirt? her skirts start way above legbone…