Jump to content

Sex Animation Modding Walkthrough CK3


Recommended Posts

CK3 Animating Walkthrough

PLEASE NOTE: In response to a question from joemann in this thread I wrote an other long thing providing updated information based on what I've figured out over the last couple months. I wanted this to be more visible, so I'm editing this post by pasting what I said under the heading "UPDATE 5/12" at the bottom of this post. I'm also attaching the screenshots/blender file here.

 

To start you will need to download Blender 2.90 and install (I think this might be a problem since I can only find the most recent version 2.92). If you can only find 2.92, that's fine just don't use it for scale animations (which means height).

Next you will need to download io_pdx_mesh-master from github
If you have Blender 2.90 Download 0.72, if you have Blender 2.92 download 0.8
You don't need to unzip it
https://github.com/ross-g/io_pdx_mesh

 

Open Blender and install the paradox importer/exporter add on
To do this go to "Edit" then "Preferences" then "Add-ons" then "Install"
This will open up a file explorer window, just select the zipped importer/exporter file

Once installed look at the top right hand corner of the screen for an arrow, 


just to the right of the green circle with a Y on it
Select the arrow to open the toolbox
You should see PDX Blender Tools there

Select "Load mesh" under Import and find a suitable base model
Such as can be found in mod\char_body_overhaul\gfx\models\portraits\female_body
At this point you can animate like normal (there should be tutorials available online
 

To export your animation back into the game make sure that you are in "Layout"
and have the rig selected, select "Save animation" name it whatever you want
Save it in the specific model's folder (male head/body, female head/body)

You will need to add the animation to that model's Asset folder 
Note that it needs to be added twice, once as an animation, once as a state
Format below
animation = { id = "body_sex"            type = "female_body_sex.anim" }
state = {    name = "sex"            animation = "body_sex" chance = 100 looping = no next_state = "sex" }
 

From there you need to add it to a file in the animations folder
gfx\portraits\portrait_animations

Now it can be referenced in code elsewhere to be pulled like any other animation
 

Tips
 

I've never been able to figure out the right type of keyframe to insert to start
So I just create a pose, save that as an animation and then load that animation
Basically this causes the Paradox exporter to set the right type of Keyframe
From there you can just select "insert keyframe" whenever you want to
 

The Paradox models uses a rig with bones that aren't connected to each other
So for the most part you want to rotate bones not move them
There are a few exceptions such moving bones in the face to create expressions
Most notably using body_root to move the entire model
 

Avoid moving bn_r_clavicle or bn_l_clavicle
These bones move the model's neck line. 
If you line up the movements between the neck and body it should be fine,
But why make your life hard?
 

Before exporting your animation into a .anim file that can be used in game save a version as .blend
The exporter will create a keyframe for every frame
Making it much harder to edit an animation that has been imported back from a .anim file
 

Sex Animation Specific Stuff
 

To start with you will want to have multiple body models animated simultaneously
This allows you to have some perspective on how they will look together
This means you want them to have independent rigs
The exporter by default will try to place any model on any rig existing in Blender
So to avoid this issue simply select the body and rig that you have already imported
Copy both to the clipboard
Then delete them
Import the second model/rig combo that you want to animate
Paste the original model/rig back in from the clip board
This will allow you to animate both models simultaneously
 

On a similar note after saving your animation as a .blend you will need to delete extra models before exporting
By only retaining the model/rig you want to export you avoid confusing the importer/exporter
 

The bones I've added have specific uses related to sex animations
The penis bone (lol) has the most obvious use, 
The breast bones allow you to jiggle and move the breasts as you want
This allows you to create animations where the breasts are less unnaturally stiff
Same with the butt
The vagina bones are there so that if the vagina is in frame you can have it open
The stomach bone was mainly added so that you can animate fat people having sex
I noticed when testing out animations with various body shapes it was impossible to move the stomach out of the way for fat characters
 

On a similar note, keep in mind that any animation you create will probably need to work for a variety of character shapes
So for example having a character grab another character's shoulder might result in clipping for more muscular characters
This is why the game has multiple versions of animations for fat characters/dwarfs
Eventually we will probably want to expand on this concept to include muscles/butt/breast sizes
I'm working on a mod that will allow these to be referenced as triggers
 

Perspective
 

In game animations are from the perspective of a camera, 
Usually the camera positions are defined in reference to one of bones
Since we are animating using multiple models this isn't possible 
(otherwise you couldn't get the animations to work together)
This is why the cameras used to have multiple models interact are given a set position
position = cylindrical{ 260 0 0 }
So this is 260 m in front of the origin from the perspective of your model
And it is set to be looking straight at the origin
This was selected so that you have a good frame of reference to work off of
So when creating your animation just remember the perspective from which the animation will viewed is along the green line staring at the origin

UPDATE 5/12

All the game's animations are separated into head and body in order for the game to read it you need to have a separate head animation and body animation. And the rig that you save needs to match what is being used by the body models. This means that when you export an animation it needs to use female head or male head (found in the steam files) for the heads and male body or female body for the body. As far as I can tell this is true when ever you export the animation. The game will render the head and body separately with head_root attached to bn_sp_thorasic (note this means you should never move head_root in an animation because the two will no longer be connected.

All the other shapes (which are in the blendshapes folder) can't be used to animate because they don't have rigs attached. There is a way around this but I'll get to that below.

Similarly to the head and bodies, the animations also need to be separated by sex. In order to export I will select all the objects except the one I want to export, copy them (just ctrl+c there are a few different types of copying in blender) and delete them, leaving me with only the one object I want to export (note you need to keep both the model, and the rig). Then I just paste the objects I just deleted and repeat this process with each.

The positions are stored via keyframes relative to the object's location, this isn't necessarily intuitive (it took me a sec to figure out) but this means that you should not move the models in object mode, only in pose mode. So even though you export the male body and female body separately they will line up in game (or male-male female-female male-female-female etc). Though at the risk of getting sidetracked (I have tendency to text wall) I have to note that since height itself is an animation it fucks with the alignment I fixed this by creating a new additive animation that fixes the alignment.

This means that in the original animation I had to animate the head and body separately which is annoying as fuck. I had two bodies fucking and two floating heads and I had to guess what they would look like when combined. This is why blow jobs were basically impossible. But I figured out how to combine them in blender by placing the head on bn_sp_thorasic and using join (under object), by joining the head to the body and the two rigs together you create one model that can be animated. I also parent head_root to bn_sp_thorasic, bn_r_h_clavicle to bn_r_clavical, and bn_l_clavicle to bn_h_l_clavicle. I want avoid overexplaining because this is already too long, ask if you want to know more about parenting and bones, I will do so happily but I'm attaching a file where this has been done already.

So using that attached file you can animate with the heads on the bodies. Plus I've also loaded all of my blendshapes onto the bodies, which is necessary since you need to see what the erection will look like to properly animate fucking. I've attached a screenshot showing where the shapes are located (easier than explaining). They aren't labelled or anything but just click the box to apply the blendshape, until you figure out which is which by default all the values are set to 1, but you will probably want to lower that number so that they are less extreme, anything from 0 to 1 works.

Ok so fast forwarding, you've animated two people fucking and want to export it. Make sure you are on frame 1 and don't move from there for this whole process. Definitely save as a blender file before starting this process so you don't lose your work. You can't export using these models, but you can transfer the animation to models that you can export. So you need to import a new model using the copy/paste trick from earlier. Should look like my screenshot of a headless model standing over two people fucking. Select the rig you want copy from and go to pose mode, make sure every bone every key frame channel is selected, to do this click select then all from the bar at the top of the screen and select then all from the bar at the bottom of the screen. I've attached screenshots so you know what bars I'm talking about. All the bones should be blue and all the keyframe channels should be yellow (screenshots attached). Now on the bottom bar click key, then copy keyframes.

Click on rig of your headless model and click select then all an the top bar, all the bones should be blue again. This model doesn't have any key frames so you need to add them. To do this right click, select insert keyframes, this will open up the insert keyframe menu. Select the location, rotation, and scale option. Once the headless model has keyframes, you can paste in your keyframes. Select key then paste keyframes. After this you can delete all the rigs and models except for the headless one standing over everything (you can reload your blender file again later). Now you finally have an animation you can export into the game. You can repeat this process for the head and body. 

This probably sounds super complicated but it doesn't take long once you get it, and its much easier to be able to animate with the head on the body, and being able to see eyes as well. 

There is one final point, if you don't move bn_r_clavicle (or bn_l_clavicle) you can ignore this but I've found it really helps to be able to move it. In order to avoid the neck seam issue you need to align bn_h_r_clavicle to r_clavicle (and the left versions). This only applies when you are creating an exportable head animation. After pasting your keyframes into your disembodied head. Select bn_r_clavicle in the (in the combined head/body rig not the disembodied head) and only bn_r_clavicle. There should only be the one key frame channel selected and make sure all the keyframes are yellow again. Click key the copy keyframes. Going to your disembodied head rig find bn_h_r_clavicle, select only bn_h_r_clavicle. On the bottom bar click key then delete keyframes, then right click insert keyframes then location, rotation, and scale (this clears the channel). Now click key then paste keyframes. Repeat the process for bn_l_clavicle/bn_h_l_clavicle. This process just ensures that the head and body line up to avoid creating a messed up seam.

CK3 Animating Walkthrough Sex Modding.txt

new model import.PNG

Shape key location.PNG

top_bar.PNG

yellow keyframes.PNG

blue bones.PNG

bottom bar.PNG

exportable model.PNG

inserted keyframes.PNG

animation_setup.blend

Link to comment
  • 1 month later...

I am trying my hand at making an animation in blender. Thanks for this walkthrough but since I am new at this I have some more questions:

 

Rather than starting from scratch, I used the doggy file I found in another post. This is a blender file, so easy to upload. However it comes without the heads.

 

I uploaded a male and a female head (muscular) but what do I do with them? They don't seem to have a rig attached to them. Is there a way to attach them to the bodies so that they follow the rest of the animation? Or do you need to position them for each and every frame? Once the animation or pose is finished I can export the animation into the game using the pdx exporter. However, I started with only one animation file, do I now stay with one file that I copy into four different folders (female_body, female_head, male _body, male head) giving it a different name for each folder? Or is there a way to "split" the animation in four parts ( female_body, female_head, etc ).

 

I tried the first solution but the error log indicated that the animation had a few vertices to many. I am supposing that the heads were taken into account in one part of the equation, but were missing elsewhere. These are probably stupid questions but that is how I feel right now ?

 

 

 

 

Link to comment
4 hours ago, joemann said:

I am trying my hand at making an animation in blender. Thanks for this walkthrough but since I am new at this I have some more questions:

 

Rather than starting from scratch, I used the doggy file I found in another post. This is a blender file, so easy to upload. However it comes without the heads.

 

I uploaded a male and a female head (muscular) but what do I do with them? They don't seem to have a rig attached to them. Is there a way to attach them to the bodies so that they follow the rest of the animation? Or do you need to position them for each and every frame? Once the animation or pose is finished I can export the animation into the game using the pdx exporter. However, I started with only one animation file, do I now stay with one file that I copy into four different folders (female_body, female_head, male _body, male head) giving it a different name for each folder? Or is there a way to "split" the animation in four parts ( female_body, female_head, etc ).

 

I tried the first solution but the error log indicated that the animation had a few vertices to many. I am supposing that the heads were taken into account in one part of the equation, but were missing elsewhere. These are probably stupid questions but that is how I feel right now ?

 

 

 

 

All very good questions, you've hit on a few of the key issues I've been working through. I know these things conceptually but they might be difficult to explain so I'm sorry if any of it is confusing. 

All the game's animations are separated into head and body in order for the game to read it you need to have a separate head animation and body animation. And the rig that you save needs to match what is being used by the body models. This means that when you export an animation it needs to use female head or male head (found in the steam files) for the heads and male body or female body for the body. As far as I can tell this is true when ever you export the animation. The game will render the head and body separately with head_root attached to bn_sp_thorasic (note this means you should never move head_root in an animation because the two will no longer be connected.

All the other shapes (which are in the blendshapes folder) can't be used to animate because they don't have rigs attached. There is a way around this but I'll get to that below.

Similarly to the head and bodies, the animations also need to be separated by sex. In order to export I will select all the objects except the one I want to export, copy them (just ctrl+c there are a few different types of copying in blender) and delete them, leaving me with only the one object I want to export (note you need to keep both the model, and the rig). Then I just paste the objects I just deleted and repeat this process with each.

The positions are stored via keyframes relative to the object's location, this isn't necessarily intuitive (it took me a sec to figure out) but this means that you should not move the models in object mode, only in pose mode. So even though you export the male body and female body separately they will line up in game (or male-male female-female male-female-female etc). Though at the risk of getting sidetracked (I have tendency to text wall) I have to note that since height itself is an animation it fucks with the alignment I fixed this by creating a new additive animation that fixes the alignment.

This means that in the original animation I had to animate the head and body separately which is annoying as fuck. I had two bodies fucking and two floating heads and I had to guess what they would look like when combined. This is why blow jobs were basically impossible. But I figured out how to combine them in blender by placing the head on bn_sp_thorasic and using join (under object), by joining the head to the body and the two rigs together you create one model that can be animated. I also parent head_root to bn_sp_thorasic, bn_r_h_clavicle to bn_r_clavical, and bn_l_clavicle to bn_h_l_clavicle. I want avoid overexplaining because this is already too long, ask if you want to know more about parenting and bones, I will do so happily but I'm attaching a file where this has been done already.

So using that attached file you can animate with the heads on the bodies. Plus I've also loaded all of my blendshapes onto the bodies, which is necessary since you need to see what the erection will look like to properly animate fucking. I've attached a screenshot showing where the shapes are located (easier than explaining). They aren't labelled or anything but just click the box to apply the blendshape, until you figure out which is which by default all the values are set to 1, but you will probably want to lower that number so that they are less extreme, anything from 0 to 1 works.

Ok so fast forwarding, you've animated two people fucking and want to export it. Make sure you are on frame 1 and don't move from there for this whole process. Definitely save as a blender file before starting this process so you don't lose your work. You can't export using these models, but you can transfer the animation to models that you can export. So you need to import a new model using the copy/paste trick from earlier. Should look like my screenshot of a headless model standing over two people fucking. Select the rig you want copy from and go to pose mode, make sure every bone every key frame channel is selected, to do this click select then all from the bar at the top of the screen and select then all from the bar at the bottom of the screen. I've attached screenshots so you know what bars I'm talking about. All the bones should be blue and all the keyframe channels should be yellow (screenshots attached). Now on the bottom bar click key, then copy keyframes.

Click on rig of your headless model and click select then all an the top bar, all the bones should be blue again. This model doesn't have any key frames so you need to add them. To do this right click, select insert keyframes, this will open up the insert keyframe menu. Select the location, rotation, and scale option. Once the headless model has keyframes, you can paste in your keyframes. Select key then paste keyframes. After this you can delete all the rigs and models except for the headless one standing over everything (you can reload your blender file again later). Now you finally have an animation you can export into the game. You can repeat this process for the head and body. 

This probably sounds super complicated but it doesn't take long once you get it, and its much easier to be able to animate with the head on the body, and being able to see eyes as well. 

There is one final point, if you don't move bn_r_clavicle (or bn_l_clavicle) you can ignore this but I've found it really helps to be able to move it. In order to avoid the neck seam issue you need to align bn_h_r_clavicle to r_clavicle (and the left versions). This only applies when you are creating an exportable head animation. After pasting your keyframes into your disembodied head. Select bn_r_clavicle in the (in the combined head/body rig not the disembodied head) and only bn_r_clavicle. There should only be the one key frame channel selected and make sure all the keyframes are yellow again. Click key the copy keyframes. Going to your disembodied head rig find bn_h_r_clavicle, select only bn_h_r_clavicle. On the bottom bar click key then delete keyframes, then right click insert keyframes then location, rotation, and scale (this clears the channel). Now click key then paste keyframes. Repeat the process for bn_l_clavicle/bn_h_l_clavicle. This process just ensures that the head and body line up to avoid creating a messed up seam.

inserted keyframes.PNG

new model import.PNG

Shape key location.PNG

top_bar.PNG

yellow keyframes.PNG

blue bones.PNG

bottom bar.PNG

exportable model.PNG

animation_setup.blend

Link to comment

A big thanks. I have been fooling around with this all day and starting to make some progress, but your explanations are a big help. It will take me some time to learn to make decent animations but for now I'm just focusing on the basics.

Link to comment

Very nice writeup, even a blender ape like me might be able to do something with this. Suppose there's no workaround when it comes to head and body being separate meshes? That seems rather limiting.

 

Quote

The stomach bone was mainly added so that you can animate fat people having sex

 

Yeah later on in the game with longevity etc. you get characters looking like zeppelins with heads. Not sure I want to animate that and why consolamentum is such a good tenet.

Link to comment

I have started working with this. Started making a pose, the setup worked really well. Saved the pose as a blender file ( in pose mode in the animation screen) Then tried to set the first keyframe. First the female rig ( this seemed to have worked), then tried the  male rig suddenly it snapped back to the start setup (with the two interlocked characters). So no problem I thought, I'll just reload the saved blend file. But this was also the start setup and not the pose I had saved. So I must have done something wrong ( I'm still loosing myself in the zillion blender options). Anybody have an idea?

Link to comment
1 hour ago, joemann said:

I have started working with this. Started making a pose, the setup worked really well. Saved the pose as a blender file ( in pose mode in the animation screen) Then tried to set the first keyframe. First the female rig ( this seemed to have worked), then tried the  male rig suddenly it snapped back to the start setup (with the two interlocked characters). So no problem I thought, I'll just reload the saved blend file. But this was also the start setup and not the pose I had saved. So I must have done something wrong ( I'm still loosing myself in the zillion blender options). Anybody have an idea?

Yeah this sounds like a thing I ran into at first. When making a pose you have to be very careful about inserting the key frames (also ctrl+z/ctrl+shift+z is your friend). Every time you rotate a bone you need to click insert key frame to save it. If you take any action without inserting the key frame the whole thing reverts back to what it was before. 
 

You can rotate multiple bones without inserting the key frame on any of them, but as soon as you take certain actions it snaps back. But you can also insert keyframes in multiple bones at once. Think of it like before you insert you are fucking around to see if some things works. Inserting key frames is you telling blender that you want to save what you did to the bones selected and get rid of the rest.

Link to comment
3 hours ago, MyPersonalHarem said:

Very nice writeup, even a blender ape like me might be able to do something with this. Suppose there's no workaround when it comes to head and body being separate meshes? That seems rather limiting.

 

 

Yeah later on in the game with longevity etc. you get characters looking like zeppelins with heads. Not sure I want to animate that and why consolamentum is such a good tenet.

Yeah it's limiting in a few ways, I have some work arounds for some things (like being able to animate in blender with heads on, but other things as well), so I might have something if you are specific. I've considered trying to combine the head and body entities, but it would be a huge undertaking and I'm not totally sure it would work. Like I'm a relative blender novice as well, just started in January. Like the various seams in the character models look bad and are annoying, but I feel like they have to have purpose? I'm guessing it has to do with applying textures and diffuses as dds files in a way that can wrap a flat image around a 3d model. I've had no luck with textures and diffuses, and I'm guessing combining them would mean needing new textures and diffuses, if its possible at all. But even best case scenario it would be an ungodly amount of work. But there are definitely some things you just can't do as a result.

So paradox still hasn't fixed the late game Wall-e effect? That was like the first thing I figured out how to mod in my game, so its a bit nostalgic haha. My physical attributes mod includes the fix, but it's a small thing so I haven't separated it or anything. The problem is feasting. Every time you feast it adds to a variable that increases your target weight, every time you hunt it decreases your weight (by a smaller amount). But you can only hunt once every few years to get that -4 weight, but when you have a huge empire you (and your vassals) get invited to attend feasts constantly and the variable stacks, and never goes away. Like you know how you attended that party in college and are now permanently fatter as a result lol. My physical attributes mod clears the variable after it increases your weight once so that it doesn't stack.

But yeah, not generally something I'm trying to spend time animating either, (though no judgement for people that are). Just trying to figure out how to make it look good enough that if you happen to see an animation with a fat person fucking it isn't immersion breakingly bad. You would be surprised how much even a little fat fucks with your animations. I'm trying to work on a blowjob animation now, and if the guy is even a little chubby her head ends up entering his stomach lol. Trying to use that bone to create additive animations to fix that (just as an example). Similar issues with pregnancy too.

Link to comment

I'm (slowly) starting to get the hang of it. One thing I noticed is that the characters don't have a pelvic bone, so it is almost impossible to get a thrusting movement. Is there a work around for this ( a combination of bone rotations I have not yet been able to figure out) ?

Link to comment
41 minutes ago, joemann said:

I'm (slowly) starting to get the hang of it. One thing I noticed is that the characters don't have a pelvic bone, so it is almost impossible to get a thrusting movement. Is there a work around for this ( a combination of bone rotations I have not yet been able to figure out) ?

Yeah this is really annoying to do, the problem is the area that would be the pelvis bone is body_root which is parented to every bone. I played around with changing the bone relationships but it basically made it so that you couldn't turn the models anymore. Its annoying but its actually easier than it seems at first (when I first tried it I thought I would never be able to do it). You have to move body root to where you want it to go and then also rotate bn_sp_lumbar, bn_r_hip, and bn_l_hip. I'll generally focus on the feet (or maybe the knees depending what's on the ground) and just imagine a point of contact with the floor. If you are able to make your feet not move it's going to look like a thrusting motion. 

One of the things I'm thinking of looking into is figuring out if I can use the blender floor function to make this easier. Here's a blend file for reference (its not ready but tbh its the most complete one I have).

sex_new_missionary.blend

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use