Source Filmmaker

Source Filmmaker

Not enough ratings
Using TF2 "empty" models to shortcut animating Portal 2 Piston bones
By Disko24x7
NOTE - This guide is really, REALLY old, and the method described in this guide... well... sucks (especially given how much time it takes to set-up).
A better solution would be to decompile the models that don't have constrained, self-moving pistons and edit their .qc files to add those constraints. Portal 2's models for Atlas & P-Body (the co-op bots) use constraints to pose their pistons (hence why their pistons move by themselves when the user moves their arms/legs), so applying something like that to the GLaDOS, Personality Core and Wheatley-in-GLaDOS'-body models should be viable.

Best part is, if one person applies that fix, they can release their recompiled model(s) to the Workshop so other people can use them with piston constraints... it's just gonna take time, elbow grease and a LOT of trial and error to get it working (but it'd be worth it).


If you still want to read this guide, feel free, but be aware that this method absolutely sucks and there is a faaaar better solution to this problem:





In this guide, I'll explain to you how to use the TF2 model "Empty" to automatically pose the pistons on Personality Core/GLaDOS' models so you don't have to worry about animating them (except for GLaDOS, you still have to animate the Base of her neck pistons, apologies).
   
Award
Favorite
Favorited
Unfavorite
A few things before we begin;
First off, you don't have to follow this tutorial unless you really want to, you can get a session with all the pistons "pre-rigged" here; http://gtm.steamproxy.vip/sharedfiles/filedetails/?id=498451931, but if you have the patience, or want to make it yourself, keep reading.

Please do note that I'll be telling you how to do this with a Personality Core, so if you want to do this with GLaDOS, read the stuff in brackets after a certain instruction, e.g. "...personality_sphere1 (glados_animation1)...".
Also, a quick heads up, the instructions for applying this to a Personality Sphere also apply to applying this to the Wheatley-in-GLaDOS-Chasis model, which uses mostly the same bones from both the GLaDOS and Personality Sphere model.


Okay, now we can begin.
Setting up
Start up a new session in SFM, choose a map (in this case, I'm using the iconic 'stage.bsp') and create a "personality_sphere.mdl" or "personality_sphere_skins.mdl" ("glados_animation.mdl" for glados, and "glados_wheatley_newbody.mdl" or "glados_wheatley_boss.mdl" for wheatley in the glados chasis).

Look for "empty.mdl" in 'tf', it should be an invisible model with no visible collision or wireframe, and bring it into your scene. Copy and paste the empty model six times (five times for GLaDOS) and number them from "01" to "06" ("A" to "E" for GLaDOS). Feel free to name them if you wish, I've named them "PS_Pistonparent*number*" in this example.

You should now have something like this;



Now here comes the long and tedious part;
Parenting stuff to stuff (the boring bit)
Open up Personality_sphere1's "Unknown" (GLaDOS' "Unknown") section of bones and open up each of the empty's "Body" section of bones to access their "rootTransform". Now parent the rootTransform of each empty model to their respectively numbered "eyeball_pistons_frontjoint" (or "headPiston_*letter*_tip" for GLaDOS) bone(s) in the personality core model. Once all of them are parented to their respective bones, drag the "Zero" slider for each rootTransform so its position at the same place as the piston's tips.

The empty models should be positioned as so (ignore if you are doing GLaDOS);

If its not showing like above, then try again. If it worked then simply unparent each empty model and now parent the empty's rootTransform to the piston tip's bones. And finally make the "eyeball_eye" bone (or "glados_export_head_tip" for GLaDOS) the parent of each empty model.


Now, when you move the "eyeball_eye" bone, the emptys will follow and, hence, the piston's tips will follow too. Brilliant!
Going one step further...
NOTE: THIS DOESN'T WORK WITH GLADOS, AS IT ENDS UP WITH AWKWARDLY POSITIONED PISTONS. ANIMATE THE PISTON BASES BY HAND INSTEAD.


Create another Empty model and it doesn't matter if you give it a name this time. Parent it to the eyeball_eye bone, Zero it, and parent it's rotation to "eyeball_pistons_backjoint*number*" (you can do this by dragging the rootTransform of the empty onto the bone's "rot", this'll make the rotation of the eye apply to the pistons).



And that should be it! Enjoy your automatically self-positioning pistons.

Please let me know if there are any problems with either this tutorial or with the pistons. If you wish to credit me for this solution, feel free, but to be honest I don't care if you do or not.


Thanks for reading.



--Ben24x7--
5 Comments
J 21 Jul, 2023 @ 1:21pm 
Also, you need to highlight both of the piston bits to get them to work correctly iirc
J 21 Jul, 2023 @ 1:21pm 
There are DAG scripts that you could use (I remember using them to automate piston animation, but I don't remember what script(s) they were.)
Disko24x7  [author] 10 Aug, 2020 @ 2:47am 
Sorry, this may not fix your issue, but also sorry about any confusion this guide has caused.

I wrote it as an after-thought, and didn't double check to make sure it's easy-to-understand/easy-to-follow (in retrospect, it was stupid to refer to the empty models as "PS_Pistonparent", as it's a pain to type repeatedly)
Disko24x7  [author] 10 Aug, 2020 @ 2:47am 
@FazbearFan426 - Not 100% sure what you are doing wrong, but here's a few suggestions:

1. Check if the PS_Pistonparent models are parented TO the piston ends, rather than the piston ends being parented to the PS_Pistonparents (there should be lock icons beside every PS_Pistonparent model in the Animation Set Editor, indicating that each PS_Pistonparent is linked to the Sphere/GLaDOS model)

2. Make sure you are dragging the zero slider WHILE the parented RootTransform for each PS_Pistonparent is selected .
If you're dragging the zero slider while the Sphere's/GLaDOS' piston tips/ends are selected, then the piston tips will twist and stretch to 0,0,0 - the center of the map.
FazbearFan426 9 Aug, 2020 @ 8:46pm 
Every time I used the zero slider for each parented/locked empty/PS_Pistonparent model, it twists and stretches the front piston joint, I tried again and again over and over, but it doesn't work, [which makes me angry!!!]