S&box Wiki

Revision Difference

Citizen_Model#544631

<cat>Dev.Model</cat> <title>Citizen</title> ![CitizenModel](https://files.facepunch.com/Taylor/1b2911b1/CitizenV2_comparison.gif) # Download All source files of the Citizen model now come with the game. Find them right in the game folder, under addons/citizen/models/citizen All source files of the Citizen model now come with the game. Find them right in the game folder, under "addons/citizen/models/citizen". These files are effectively always synced straight with the official sources! # Creating a new player model...? Before you do anything with the sources, ask yourself: do you just want to add a new model on top of the existing animations (like in Gmod), or do you want to add new animations and effectively "fork" the model? If all you want to do is replace the meshes, your gamemode should simply hide the meshes of citizen.vmdl, and bonemerge your new model on top of that skeleton. That way, when animation & other updates are introduced to citizen.vmdl, you won't lose sync. # Scale Note that the model is provided in centimeters; we've elected to let the engine take care of scaling it down into inches. The conversion takes place using the global ScaleAndMirror modifier in ModelDoc. (We're NOT doing it at the import level, though that would have probably been better...) So if you want to fit something onto the character as it exists in-game (compiled and all that), it needs to be scaled by a factor of x0.3937. (no other decimals after that) # Importing If you need a guide on importing the model through modeldoc, go ahead and follow the [Importing a new model](https://wiki.facepunch.com/sbox/Importing_a_new_model) guide. If you simply want to make stuff outside of modeldoc, simply just import the .fbx file to the 3D modelling program of your choice. # Helpers * arm_upper_twist_* (from shoulder to biceps) * arm_elbow_helper_* (better deformation for extreme bend angles on the elbow) * arm_lower_twist_* (from forearm to wrist) * leg_upper_twist_* (from pelvis to thigh) * leg_knee_helper_* (better deformation for extreme bend angles on the kneecap) * leg_lower_twist_* (from calf to foot) Animation data does not need to be exported for these (it will in fact be discarded), they are procedural helpers driven entirely by constraints configured in ModelDoc. # IK bones These bones are used to drive IK constraints in-engine. They need animated data. * root_IK * hand_*_IK_target * foot_*_IK_target root_IK is the parent to all *_IK_target bones. This is because this data needs to be kept in a different space that won't be affected by any layers, weightlists, etc. that we're doing, otherwise we can't restore the positions through IK afterwards! Think of them as a way to keep the pos/rot data of hands and feet intact relative to the root motion of the character. root_IK is, in the control rig, constrained to follow X and Y of the pelvis, but with Z (height) forced to 0. The hand IK target bones are pos/rot constrained to their respective hand bones in the control rig, same for the feet. Additionally, there are these two special IK bones, which are an attempt at reproducing the "ikrule touch" feature from Source 1. * hand_L_to_R_ikrule (child of right hand, constrained to the left hand) * hand_R_to_L_ikrule (child of left hand, constrained to the right hand) These are used as a way to keep the position and orientation of hands the same relative to each other even after applying layers, weightlists etc. and they are pos/rot constrained in the control rig.