Skeleton Constraints - "Lock Translations"

havokjasong
Total Points:
1,410
Status Points:
910
Brown Belt
July 14, 2009 12:39 PM PDT
Rate
 
#4 Reply to #3
Hi jbrindle,

It looks like you are attempting what we call "animation retargetting." We are actually rolling out this feature in future versions of Havok (Check out these YouTube videos of it: http://www.youtube.com/results?search_query=animation+retargetting&search_type=&aq=f). You have a pretty simple case, though, which perhaps we can get working for you.

First off, you can lock the bones automatically from the Content Tools in the Create Mapping Filter (not sure if this is in the 6.0 content tools). This essentially calls hkaSkeletonUtils::lockTranslations. Note that this method does not lock the root bone from translating. By just calling this function, I would expect your translated skeleton would skill appear at the location of the source skeleton. Is this the case?

Let me also say, that bone locking is typically used in terms of enforcing ragdoll/animation skeleton coherance. When you have a ragdoll that is mapped to an extreme animation, or you want to map from a ragdoll back to an animation skeleton, you often want to have locked translations. This prevents the ragdoll/animation skeletons from having bones that get translated in undesireable ways. I have not seen people use it for this purpose. I actually haven't seen people use these methods directly.

The assert you are getting deals with the way hkaPose attempts to lazily keep it's representation up-to-date. For performance reasons, it doesn't keep everything up to date until needed. It's complaining, at the end of the enforce call, that there is no valid representation that is up to date. There are lots of hkaPose methods which will set dirty flags on individual bones, or the pose as a whole, for model & local space respectively. Now, I'm not sure why you are hitting this assert. I'd have to know more about the other calls to hkaPose you make prior to the enforce call.

Can you give me some more surrounding code? I would suspect what you would want to do is simply:

hkaPose pose (animatedSkeleton->getSkeleton());
animatedSkeleton->sampleAndCombineAnimations( pose.accessUnsyncedPoseLocalSpace().begin(), pose.getFloatSlotValues().begin() );
pose.enforceSkeletonConstraintsLocalSpace();


You might try using the hkaSkeletonUtils version of these calls (hkaSkeletonUtils::enforcePose/SkeletonConstraintsLocal/ModelSpace). We use these methods at the end of calls to hkaSkeletonMapper::mapPose() and they won't have the asserts you are hitting. But it might also just mask the problem.

So maybe you can post some surrounding code. I'll also try to dig in a little more on this end.

Jason G.

--------
Jason Gorski
Developer Support Engineer
Havok™
2008 Emmy Award Winner
"Turning Creative Aspirations into Technical Realities™"
www.havok.com


Intel Software Network Forums Statistics

8472 users have contributed to 31603 threads and 100652 posts to date.
In the past 24 hours, we have 31 new thread(s) 115 new posts(s), and 163 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member Edwin B. Ramayya