Well I'm still struggling with triple chain IK/FK switch/match HDA function... IK chain works fine just get and set world space positions of target objects, but newest s**tstorm is in the field of world space FK rotations... what method should I use to compensate for the pre-transform in Z position of the child bone (lower arm) i.e. parent bone length? If I use setWorldTransform() with rotation matrix extracted from corresponding IK bone it overwrites pre-transform of the FK bone to zero and my FK chain falls apart. I tried to use buildTransform() to create new matrix from elements of pre-transform translation and IK bone rotations - same thing happens. Maybe the better question would be how to prevent overwriting of pre-transform?
EDIT: Well as it turns out you MUST NOT extract rotations to vector3 value with hou.node.WorldTransform().extractRotate().('srt') and apply it on children bones (what I did)... because when you create the matrix out of that vector3 value with hou.hmath.buildRotate that matrix will destroy/overwrite your much needed bone's pre transform... You must pass "raw" i.e. "complete" matrix4 from WorldTransform(). However you can use this "extract->create->pass" method if bones (for example FK_upper_arm and IK_upper_arm) share the same parent (i.e. null, i.e. space)... ha ha... very funny... Craziest thing is when you MMB on nodes in question after the script/function did it's work, their world transforms/rotations are not even close, but their local transforms/rotations are exactly the same... sigh..
Compensating parent bone lenght/pre-transform?
1153 0 0- kriegmesser74
- Member
- 41 posts
- Joined: May 2021
- Offline
-
- Quick Links