Exporting Rigs & Anims
So we got Jackie out, can we make him move?
Summary
Created by @Simarilius Published October 15 2022 Last documented update: December 29 2023
This guide will show you how to add animations to a previously exported character. It assumes that you successfully completed Exporting Characters to Blender.
It uses the following versions:
Cyberpunk 2077 game version 2.1
Blender >= 3.6 (stable) or 4.0
Optional: If you want to get your hands dirty, check this github repository for a selection of Python scripts for Blender. Most users won't need this.
Exporting to Blender
So exported characters are cool, but how do we get them out of that annoying A-pose?
We need the rig, and maybe some animations:
the main body rig
the head/face rig
We're going to export them, bind everything, and attach the head to the body. (recapitate?!?)
Finding the body rig
You can look it up in the body's entity file. Find it by file name, or right-click on Jackie's body mesh and select "find files using this", then doing the same again on the .app
file.
Open up the .ent file and check the components
array for an entAnimatedComponent
(usually nameddeformations
), which lists the rig:
You will need this for the body mesh export. Additionally, you need to find the head rig — read the next section for how.
Copy the path under rig
and put it somewhere where you can find it later.
Finding the head rig
The head rig is in the same folder as the head mesh.
Naming conventions:
You will need this for the head mesh export.
Right-click on the .rig
file and select Copy relative path
. Put this with the body rig path.
Re-exporting the meshes
We now need to re-export the meshes we want to use.
In the first step of the guide, you should have exported them the default setting withMaterials
. That should have created material.json files and images, as the export we will use now won't do that.
The body mesh
In the Export Tool, select the body mesh and adjust its export options. (In Wolvenkit < 8.8, double-click it).
Filter by name: paste the file names (or paths) that you saved in the previous step into the empty row at the top of
Available
on the leftSelect the rig by name (the same one as in the .ent file)
Move it into the
Available
listClick on
Finish
to apply your changes
The head mesh
Repeat the process above, but use the name of the head mesh rather than the body.
Importing into Blender
Delete the head and body component that you've imported the first time around: we're going to do a reimport. With the Cyberpunk GLTF plugin (File > Import > Cyberpunk GLTF), import both of your files into Blender — the process works exactly like it did the first time, just that there's extra data now.
If the WithRig
has worked, you should notice that rather than the mass of unorganised huge bones, you now have a skeleton structure that kinda makes sense.
I normally change the bone display settings of that armature from Octahedral
to Stick
, as that prevents bones from completely hiding the mesh:
Most characters bring in full bodies; however, Jackie is not one of them. CDPR modelled only his chest and hands, since the rest of his body was never planned to be visible.
Merging the skeletons
Now, we hook up everything by merging all rigs into one.
You can do this either by script or by hand. This guide assumes you will select Option B, using the most recent script from this github repository.
Rename the head's armature to
HeadArmature
Rename the body's armature to
BodyArmature
Switch to the "Scripting" perspective and create a new empty script
Copy the script from github and paste it into the document
Optional, if you skipped step 1 and 2 because you like making things complicated: At the top of the script, find ~line 5
head = bpy.data.objects['HeadArmature']
, and put the names of your armatures from theSceneCollection
tab
Click on the
BodyArmature
in the 3d viewportRun the script
The rigs should merge; the head meshes should be without an armature parent now.
Hopefully it looks something like below, with all the bones selected and just the one green dude in the outliner:
Parenting the other meshes to the armature
If you have a lot of meshes, you might want to skip this step.
For each submesh item, repeat the following steps:
Select it in object mode
Set the
Armature Modifier
in the Modifiers tab toBodyArmature
This should snap the item to the body and it will follow with correct weights when animated.
Animations
To find animations compatible with the character you just exported, open up their .ent
file and expand the resolvedDependencies
:
Alternatively, search for .anim
in the asset browser.
As of December 2023, facial animations and lipsync (folders lipsync
and animations\facial
) are not supported yet. (We're working on it, though!)
Add the animation you've chosen to your WKit project and export it . If you want to use this animation for editing, you need to check Include Root Motion
in the export settings.
You will end up with a new .glb file, which you can import into Blender.
Now let's apply it:
Select the
BodyArmature
Switch to the
Animation
perspectiveIn the panel at the bottom, change the dropdown on the left from
Dope Sheet
toAction Editor
In the dropdown in the middle, select one of the animations you just imported.
Click the "play" button
You can keep importing more anim files and the list just grows.
Anyway, cheers Chooms, hope this has been helpful, have fun!
Troubleshooting/reporting:
As of December 2023, facial animations and lipsync (folders lipsync
and animations\facial
) are not supported yet. We're working on it, but if one of these exploded on you, you'll just have to wait.
Most of the animations seem to work flawlessly. Occasionally the process gos screwy somewhere and the model freaks out when you attach the anims. In that case, please open an issue on github or tell us about it on Discord in #blender-add-on
.
Please include your .blend file and the full relative path to the animation that was giving you trouble in your report.
Last updated