Blender and UDK

Can anyone confirm that animated models exported from Blender into UDK via PSK/PSA work well ?

Any tips on getting static and animated content from Blender to UDK ?

Thanks.

Psa/psk is deprecated and no longer supported by udk, what you have to use is FBX, my recconendation is that you pass your blender exports through autodesk fbx converter, so the fbx version is more compatible with udk, blender uses a outdated fbx version, below the udk minimum version

I have been able to export static models to UDK by using the blender FBX exporter (i had to scale the object so that it doesn’t appear like an ant though). I was able to import them into UDK fine with textures even though UDK complained about ‘old version’ of fbx. I did not have much luck exporting animated objects (skeletal meshes) however.

yes, you have to keep in mind that 1 blender unit = 1 unreal unit, but the default character is 90 units high
i use the fbx converter, becouse with animations and skeletal meshes, the outdated fbx of blender crashes UDK every minute

That sucks that PSA/PSK are removed :confused:

Ah i see. Thanks for the info vblanco. So, the workflow for exporting skeletal meshes is - export to fbx in blender -> use fbx converter to update it to the current fbx version. I will try it when i turn on windows system. I gave up my last export experiment when i failed to export animated mesh :slight_smile:

.psa/.psk wasn’t removed. It’s true that the UDK mesh pipeline has been changed to FBX 2012 some time ago, however the older formats are still working, similar to .ase for static meshes. In fact .psa has a major advantage over .fbx since it lets you pack all anim sequences into one file (.fbx requires one file per sequence).
Blender works fine with UDK for both, skeletal and static meshes.

Besides, you won’t get any issues when using an older fbx version (file sizes are larger though). Just disable that message on import.

As far as I know, 1 unreal unit means 2cm, so 1 blender unit (1m) means 50 unreal unit. So, you need to scale your model 50 times if you don’t want your model looks very tiny.

From my experience, you need few tricks to get your model work as skeletal mesh in UDK. This is few of them:

  • Unreal unit = 2cm = 1/50 Blender unit
  • Your rig must have one main root bone
  • Animation consists scale deform doesn’t work well in UDK
  • If using rigify, create new armature that consist only deform bones and socket bones, constraint it to rigify deform bones, and bake action.
  • Export your model with rig that only consists deform bones and socket bones to prevent headaches :smiley:
  • Don’t object parent your model to your rig, only use modifier, this can help prevent change of model axis
  • Edge split doen’t work well either (edit: It actually works, my bad)
  • You can export only your animation by export only your armature that consists animation to FBX. To import this in UDK, in animset editor, choose File->Import FBX animation
  • Shape keys won’t work too, Blender FBX exporter haven’t supported this (edit: my bad, it actually works, here’s the tutorial.)
  • Don’t forget to to uncheck Anim Rotation Only option in UDK Animset editor, UDK won’t read your translate animation if it’s checked.

I learned these based on trial and error experience few month ago. Hope that helps.
Feel free to correct me if I’m wrong.

I can confim that shape keys DO work

I am reading UDN documentation and nowhere it says PSK/PSA formats were dropped.

I don’t understand why bother with cm when you can use abstract units and 1 unit in game will be 1 unit in Blender. That’s true for all idTech engines for example and Source.

I wonder how do you achieve that, if you have bones-helpers and IK bones (my rig has deforming bones + bones that drive those).

Moved from “General Forums > Blender and CG Discussions” to “Support > Other Software”

A way to think about UDK scale is 16 UDK units are roughly 1 Foot. If an average character is 6 feet then 16 units(1 foot) x 6 = 96 units.
Your best workflow would be to set blender to it’s internal unit and not metric or imperial. Then you can set its grid size to 16 sub units for total accuracy, what I would like to do is set your grid scale to 8 and your subdivisions to 8. If you create a cube in blender it will make it 16 units by default with that grid layout. The best way to understand your size and if it will be correct before exporting to UDK is to use your Right side panel in the 3d view . If your object is selected and is in object mode that panel will tell you how many units in X,Y,Z your object is by looking at its dimension stats.

  • remember to apply any scale or rotation before exporting or animating

There is no general “UDK scale”. If you want to create models for a certain game there is a scale given of course, otherwise it’s up to you (or everyone else creating an own game) to define a scale. There are limits given by the engine so you can only lower the scale to a certain extent before precision errors become noticeable though.
What people most often refer to is the UT3 scale which is in fact 1UU=2cm, GoW uses 1UU=1inch but for many UE3 licensees its 1UU=1cm (see UDN).
If you just want to test your assets with the UDK UT3 content keep in mind that the default char is 96UU*1.075 tall.

Personally I just changed my startup file to have a dummy model of the game chars size and a grid with 256 lines and 8 subdivisions.

My bad, you’re right. I haven’t tested it for quite sometimes, so I don’t know if it’s work today. Thank you for your correction.
This is video that show how to export shape keys from Blender to UDK.

Lol, my bad, again, I don’t know that Blender FBX exporter has scale option. :stuck_out_tongue:
About Blender/UDK scaling, it’s explained in depth in mAlkAv!An post. And don’t forget to uncheck Anim Rotation Only option in UDK Animset editor.

In my case, I have 2 rigs, rigify and export rig. Export rig only contains deform bones and socket bones. Export rig get animation data from bake action. To bake action, you need to constraint all your export bones to rigify deform bones, and use operator bake action.

The reason I do this way because I don’t bother with IK or other helper bone (except socket bones) inside UDK. I just need to use animation data baked from my real rig. If you still need the IK bones, actually I haven’t tried it yet, maybe someone else know something.

Right, that makes sense. I tried it for idTech 4, but either I am doing something wrong, or exported is jacked up, but after I export baked anims I end up with missing frames and jerky animation in idTech 4. So I gave up on that idea.

Do you use 2 Armatures in the scene? (one with IK and control bones and one with deform bones)

Yes, I’m using 2 armatures.



This is my setup, on left are rigify with face rig and socket bones. On the right, my export bones that only contains deform bones and socket bones.
To export animation, copy transform constraint all export-rig bones to rigify deform bones and socket bones. To help constraint the bones I created simple script. First, select all export-rig bones and run this script.

import bpy

amt_target_obj = bpy.data.objects['rigify'] #Rigify armature
amt_target = amt_target_obj.data

amt_obj = bpy.context.object
amt = amt_obj.data

#You need to select bones in pose mode
bones = bpy.context.selected_pose_bones

for bone in bones:
    #Set active bone
    amt.bones.active = bone.bone
    
    if any(b for b in amt_target.bones if b.name == bone.name):
    
        #Clear constraint if it's there
        if len(bone.constraints) > 0:
            bpy.ops.pose.constraints_clear()
        
        #Add Copy Transform Constraint to active pose bone
        bpy.ops.pose.constraint_add(type="COPY_TRANSFORMS")
        
        #Add constraint target based by rig source object
        bone.constraints["Copy Transforms"].target = amt_target_obj
        bone.constraints["Copy Transforms"].subtarget = bone.name

This script check bones with same name and constraint them. So, export rig bone names need to have same names with rigify deform bones.

After all export-rig bones had copy transform constraint, to copy animation from rigify to export rig, select all your export-bone rig and use bake action operator.


Check clear constraint and click ok, this will create new action baked from your rigify animation.
Don’t forget to export only selected object, you don’t want to export original rigify rig.

Screenshot of imported model with animset in UDK.


I had exported many characters to UDK by using this techniques. There’s no problem so far (actually, now I already switched to Unity :D, but techniques remain the same)
Hope that helps :slight_smile:

Thanks!

I did the same exact thing. And my anim played nice in Blender, choppy and broken in idTech 4. So I assume that would be exporter’s issue.

Another question is how to do bake all Actions at once? I have all kind of anims for a single character and baking each action at a time is royal pita :confused:

It seems to be so, I haven’t try idTech4 yet. Anyway, what game engine are you using today beside UDK?

Maybe you need to create python script to batch bake them. :eyebrowlift:
I haven’t tried it yet too.

I don’t use UDK yet. I am just exploring options :slight_smile: The key reason why I’d use UDK is Steamworks. Than’t about it.

I only used Darkplaces engine and idTech 4 engine. Currently adopting Doom 3 BFG engine to replace idTech 4, but the workflow is almost exactly the same.