[REL] Havok Animation Converter, Thread 2
Posted: Sun May 27, 2012 2:30 am
Okay, well, part of the problem with my conversions between my 2011 exports into the 2010 format is how the annotation tracks are stored: as I noted before, the annotation tracks are listed in an array of structs within object 3 in my 2011 exports, while the 2010 format has them as separate objects (4-102). However, besides this difference, the class is defined the same way, as containing one string for the track name, and one array of strucs containing one real (the time of the annotation) and one string (the annotation itself) Thus, I felt fairly confident that copying the data from the sruct in my 2011 export and pasting it into the object in the 2010 version would work.
Well, it didn't. Opening the 2010 HKX with the transplanted annotation data in the 2010 Havok Preview Tool works fine, right up until I scroll the animation up to the frame of the first annotation, at which point the tool gives me an error and wants to quit.
Part of the problem is, I can't find a single unpacked animation file from the BSA that contains any annotations: all the relevant objects read: "[object id="#0004" type="hkaAnnotationTrack"] [string name="trackName"][/string] [/object]" so I have no idea what this part of the file is supposed to look like. After I transplanted the data, mine looks like this:
Anyone see what the problem is?
EDIT: It may be relevant to note, if I toggle off "annotations" under the animation tab, the error does not occur and I can view the animation without a problem.
EDIT 2: So I decided to go ahead and try to save the files as packed 2010 HKXs and try them in game, see what happens. Well, they saved fine, and the CK ran them okay as well, but they functioned exactly the same in game as they were before I added the annotation tracks. Something's not right.
Well, it didn't. Opening the 2010 HKX with the transplanted annotation data in the 2010 Havok Preview Tool works fine, right up until I scroll the animation up to the frame of the first annotation, at which point the tool gives me an error and wants to quit.
Part of the problem is, I can't find a single unpacked animation file from the BSA that contains any annotations: all the relevant objects read: "[object id="#0004" type="hkaAnnotationTrack"] [string name="trackName"][/string] [/object]" so I have no idea what this part of the file is supposed to look like. After I transplanted the data, mine looks like this:
[object id="#0004" type="hkaAnnotationTrack"]
[string name="trackName">NPC Root"][/string]
[array name="annotations" size="10"]
[struct]
[real name="time"]x3e6eeeef [!-- 0.233333 --][/real]
[string name="text"]preHitFrame[/string]
[/struct]
[struct]
[real name="time"]x3e99999a [!-- 0.3 --][/real]
[string name="text"]weaponLeftSwing[/string]
[/struct]
[struct]
[real name="time"]x3eddddde [!-- 0.433333 --][/real]
[string name="text"]HitFrame[/string]
[/struct]
[struct]
[real name="time"]x3f2aaaab [!-- 0.666667 --][/real]
[string name="text"]weaponSwing[/string]
[/struct]
[struct]
[real name="time"]x3f444445 [!-- 0.766667 --][/real]
[string name="text"]HitFrame[/string]
[/struct]
[struct]
[real name="time"]x3f911111 [!-- 1.13333 --][/real]
[string name="text"]weaponSwing[/string]
[/struct]
[struct]
[real name="time"]x3f9dddde [!-- 1.23333 --][/real]
[string name="text"]HitFrame[/string]
[/struct]
[struct]
[real name="time"]x3fcccccd [!-- 1.6 --][/real]
[string name="text"]AttackWinStart[/string] [/struct]
[struct]
[real name="time"]x3feaaaab [!-- 1.83333 --][/real]
[string name="text"]attackStop[/string]
[/struct]
[struct]
[real name="time"]x3feaaaab [!-- 1.83333 --][/real]
[string name="text"]AttackWinEnd[/string]
[/struct]
[/array]
[/object]
[string name="trackName">NPC Root"][/string]
[array name="annotations" size="10"]
[struct]
[real name="time"]x3e6eeeef [!-- 0.233333 --][/real]
[string name="text"]preHitFrame[/string]
[/struct]
[struct]
[real name="time"]x3e99999a [!-- 0.3 --][/real]
[string name="text"]weaponLeftSwing[/string]
[/struct]
[struct]
[real name="time"]x3eddddde [!-- 0.433333 --][/real]
[string name="text"]HitFrame[/string]
[/struct]
[struct]
[real name="time"]x3f2aaaab [!-- 0.666667 --][/real]
[string name="text"]weaponSwing[/string]
[/struct]
[struct]
[real name="time"]x3f444445 [!-- 0.766667 --][/real]
[string name="text"]HitFrame[/string]
[/struct]
[struct]
[real name="time"]x3f911111 [!-- 1.13333 --][/real]
[string name="text"]weaponSwing[/string]
[/struct]
[struct]
[real name="time"]x3f9dddde [!-- 1.23333 --][/real]
[string name="text"]HitFrame[/string]
[/struct]
[struct]
[real name="time"]x3fcccccd [!-- 1.6 --][/real]
[string name="text"]AttackWinStart[/string] [/struct]
[struct]
[real name="time"]x3feaaaab [!-- 1.83333 --][/real]
[string name="text"]attackStop[/string]
[/struct]
[struct]
[real name="time"]x3feaaaab [!-- 1.83333 --][/real]
[string name="text"]AttackWinEnd[/string]
[/struct]
[/array]
[/object]
EDIT: It may be relevant to note, if I toggle off "annotations" under the animation tab, the error does not occur and I can view the animation without a problem.
EDIT 2: So I decided to go ahead and try to save the files as packed 2010 HKXs and try them in game, see what happens. Well, they saved fine, and the CK ran them okay as well, but they functioned exactly the same in game as they were before I added the annotation tracks. Something's not right.