Havok 6 - Uninitialized bone in pose

Havok 6 - Uninitialized bone in pose

jbrindle's picture

Hi. after converting from havok 5.5.0 to havok 6.0.0 I have run into this problem.

When I try to call SampleAndCombineAnimations for an hkaPose I get an assert:

HAVOK: .\Rig\hkaPose.cpp(148): [0x5A3281F6] Assert : ! isFlagOn(b, F_BONE_MODEL_DIRTY)
Trying to access uninitialized bone in pose

I'm not sure, but it may be related to the way I'm getting the data in the pose, which has changed in havok 6.0.0.

In 5.5.0 I used to use the writeAccessFloatSlotValues, writeAccessPoseLocalSpace, writeAccessPoseModelSpace funcions.

In 6.0.0 I now use accessUnsyncedPoseModelSpace and the corresponding "unsynched" functions.

I'm not quite sure how the synched/unsynched works which may be causing my problem. I tried calling syncAll before calling SampleAndcombineAnimations but I get the same assert.

Is there something new in 6.0.0 that I'm not aware of? Do I have to initialize the bones in the poses somehow, or am I trying to access them in the incorrect way.

Any help would be much appreciated.

Thanks!

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
sean.thurston's picture

Hi jbrindle,

The constructor for the skeleton does not initialize the bones. I was wondering if you could try calling hkaPose::setToReferencePose() somewhere before the sampleAndCombineAnimations call. This should initialize all the bones and hopefully make things right again.

If that doesn't do it, can you put up a callstack of the assert?

Hopefully this helps.

Thanks,
Sean

Developer Support Engineer Havok www.havok.com
jbrindle's picture
Quoting - sean.thurston

Hi jbrindle,

The constructor for the skeleton does not initialize the bones. I was wondering if you could try calling hkaPose::setToReferencePose() somewhere before the sampleAndCombineAnimations call. This should initialize all the bones and hopefully make things right again.

If that doesn't do it, can you put up a callstack of the assert?

Hopefully this helps.

Thanks,
Sean

Using setToReferencePose after creating the pose works great and fixed the problem.

I found I have to use accessSyncedPoseLocalSpace though. If I use accessUnsyncedPoseLocalSpace, the data is garbage, which I assume is because it hasn't been "synched" yet. For now I'll keep using synched data.

What is the difference between synched or unsynched, and in what cases would one be better than the other?

sean.thurston's picture

Hi jbrindle,

I'm glad that fixed the problem. The difference between synced and unsynced is that synced calls syncLocalSpace first. The caller of the unsynced method is expected to set all the transforms. You should only be writing to with the unsynced version, not reading from it. It might help to know that accessUnsyncedPoseLocalSpace used to be called writeAccessPoseLocalSpace(). Depending on when you are looking at the data, this could be the reason that you see garbage.

I hope this answers your questions.

Thanks,
Sean

Developer Support Engineer Havok www.havok.com

Login to leave a comment.