Gildor's Forums

Author Topic: UE2 bone connections  (Read 4169 times)
Veskya
Newbie
*
Posts: 3


View Profile
UE2 bone connections
« on: November 26, 2012, 02:24 »

I'm working on an importer for psk files into blender, it pretty much works so far but im wondering about how UE2 handles bone connections. When connecting the bones from their position to their parent this leads to some bones pointing in the wrong direction as seen in the screenshot. Bip01_R_Thigh goes from its position towards its parent in the center of the model, however it should actually be going from its position downwards to Bip01_R_Calf.

UE Viewer and also the ingame skeleton viewer show this the same way but i assume this is not how it works internally for the animations since the bones are pointing in the wrong direction like this. From what i saw the ActorX Importer gets those bones correctly and there was no connection to the parent bone here, although i may be wrong there since 3ds max runs rather bad in virtual box.
Fixing this for my uses in the import script isnt much of an issue but i wonder how does the unreal engine handle this internally? Does it not connect the bones to their parents or is there some other dark magic being used? ^^

Logged
Gildor
Administrator
Hero Member
*****
Posts: 7975



View Profile WWW
Re: UE2 bone connections
« Reply #1 on: November 26, 2012, 09:02 »

Perhaps you need to mirror the mesh - I don't know which coordinate system is used in Blender. Check all bones.
By the way, did you seen other psk importers for Blender?
Logged
Veskya
Newbie
*
Posts: 3


View Profile
Re: UE2 bone connections
« Reply #2 on: November 26, 2012, 23:27 »

The coordinate system should be fine, as shown in the screenshot UE Viewer does exactly the same thing and in the game its displayed the same way. But the correct way would be for that thigh bone to be pointing downwards along the leg and not towards its parent. In ActorX Importer you are pointing the bones towards their children which would be the correct way here as well. I'm just wondering if UE2 actually uses connections to the parent bones like this (point from bone position towards parent position) or if it does it the ActorX way by pointing the bone towards its child and leaving the space between parent and thigh in this case unconnected.

There is one other psk importer from "DarkNet" which comes with blender by default afaik, but it calculates the bone positions wrong (armature comes out completely messed up) and does not import the weights either so its rather useless for me Smiley
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7975



View Profile WWW
Re: UE2 bone connections
« Reply #3 on: November 27, 2012, 08:06 »

The coordinate system should be fine, as shown in the screenshot UE Viewer does exactly the same thing and in the game its displayed the same way. But the correct way would be for that thigh bone to be pointing downwards along the leg and not towards its parent. In ActorX Importer you are pointing the bones towards their children which would be the correct way here as well. I'm just wondering if UE2 actually uses connections to the parent bones like this (point from bone position towards parent position) or if it does it the ActorX way by pointing the bone towards its child and leaving the space between parent and thigh in this case unconnected.
"Bone" is just a transformation matrix. Child bone's matrices are multiplied by parent bone matrix. Check ActorX Importer code for more details.
Quote
There is one other psk importer from "DarkNet" which comes with blender by default afaik, but it calculates the bone positions wrong (armature comes out completely messed up) and does not import the weights either so its rather useless for me Smiley
http://www.gildor.org/projects/umodel/faq#exporter
Is there importer for Blender?
Logged
Veskya
Newbie
*
Posts: 3


View Profile
Re: UE2 bone connections
« Reply #4 on: November 27, 2012, 22:48 »

Does UE2 not use any kind of directional information for a bone? The coordinates i got right, its just the direction im asking about. In UE Viewer the bones point from their position towards their parents but this doesnt seem to be correct if you would want to move the bone. For displaying the skeleton it's fine this way but i'm just wondering if there is more to this other than a way to display the skeleton like this or if UE2 actually uses the these kind of directions (i  guess it doesnt).

As for the importer scripts, one of those links is kinda dead as the interesting posts were deleted from the thread. The other one is the mentioned DarkNet script Smiley
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7975



View Profile WWW
Re: UE2 bone connections
« Reply #5 on: November 28, 2012, 08:00 »

The bone has no "direction". So I'm displaying not bones itself, but bone connections.
Logged
VendorX
Guest
Re: UE2 bone connections
« Reply #6 on: December 02, 2012, 22:22 »

@Veskya: Your problem is Blender it self... UE is  using just bone (his local position and orientation), but Blender is using BoneHead and BoneTail to display the same bone - where BoneTail is positioned by Orientation*Length. Problem came when Bone hasn't children and Orientation is F*up. Anyways, don't bother about BoneTail (set BoneLenght to 0.1) because every exporter will looking for BoneHead  position and orientation. BoneTail doesn't exist in UE.
Once I wanted to fix this problem by giving for DarkNet solution, but... I ended up with writing my own psk importer.
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS