@@ -331,19 +331,38 @@ def fk2ik_arm(obj, fk, ik):
331
331
match_pose_scale(hand, handi)
332
332
else:
333
333
# Upper arm position
334
- match_pose_translation(uarm, uarmi)
335
- match_pose_rotation(uarm, uarmi)
336
- match_pose_scale(uarm, uarmi)
334
+ mat = get_pose_matrix_in_other_space(uarmi.matrix, uarm)
335
+ set_pose_translation(uarm, mat.copy())
336
+ set_pose_rotation(uarm, mat.copy())
337
+ set_pose_scale(uarm, mat.copy())
338
+ bpy.ops.object.mode_set(mode='OBJECT')
339
+ bpy.ops.object.mode_set(mode='POSE')
340
+ # match_pose_translation(uarm, uarmi)
341
+ # match_pose_rotation(uarm, uarmi)
342
+ # match_pose_scale(uarm, uarmi)
337
343
338
344
# Forearm position
339
- #match_pose_translation(hand, handi)
340
- match_pose_rotation(farm, farmi)
341
- match_pose_scale(farm, farmi)
345
+ mat = get_pose_matrix_in_other_space(farmi.matrix, farm)
346
+ set_pose_translation(farm, mat.copy())
347
+ set_pose_rotation(farm, mat.copy())
348
+ set_pose_scale(farm, mat.copy())
349
+ bpy.ops.object.mode_set(mode='OBJECT')
350
+ bpy.ops.object.mode_set(mode='POSE')
351
+ #match_pose_translation(farm, farmi)
352
+ # match_pose_rotation(farm, farmi)
353
+ # match_pose_scale(farm, farmi)
342
354
343
355
# Hand position
344
- match_pose_translation(hand, handi)
345
- match_pose_rotation(hand, handi)
346
- match_pose_scale(hand, handi)
356
+ mat = get_pose_matrix_in_other_space(handi.matrix, hand)
357
+ set_pose_translation(hand, mat.copy())
358
+ set_pose_rotation(hand, mat.copy())
359
+ set_pose_scale(hand, mat.copy())
360
+ bpy.ops.object.mode_set(mode='OBJECT')
361
+ bpy.ops.object.mode_set(mode='POSE')
362
+
363
+ # match_pose_translation(hand, handi)
364
+ # match_pose_rotation(hand, handi)
365
+ # match_pose_scale(hand, handi)
347
366
348
367
349
368
def ik2fk_arm(obj, fk, ik):
@@ -380,16 +399,24 @@ def ik2fk_arm(obj, fk, ik):
380
399
381
400
else:
382
401
# Hand position
383
- match_pose_translation(handi, hand)
384
- match_pose_rotation(handi, hand)
385
- match_pose_scale(handi, hand)
402
+ mat = get_pose_matrix_in_other_space(hand.matrix, handi)
403
+ set_pose_translation(handi, mat.copy())
404
+ set_pose_rotation(handi, mat.copy())
405
+ set_pose_scale(handi, mat.copy())
406
+ # match_pose_translation(handi, hand)
407
+ # match_pose_rotation(handi, hand)
408
+ # match_pose_scale(handi, hand)
386
409
387
410
# Upper Arm position
388
- match_pose_translation(uarmi, uarm)
389
- match_pose_rotation(uarmi, uarm)
390
- match_pose_scale(uarmi, uarm)
411
+ mat = get_pose_matrix_in_other_space(farm.matrix, farmi)
412
+ set_pose_translation(farmi, mat.copy())
413
+ set_pose_rotation(farmi, mat.copy())
414
+ set_pose_scale(farmi, mat.copy())
415
+ # match_pose_translation(uarmi, uarm)
416
+ # match_pose_rotation(uarmi, uarm)
417
+ # match_pose_scale(uarmi, uarm)
391
418
# Rotation Correction
392
- correct_rotation(uarmi, uarm)
419
+ # correct_rotation(uarmi, uarm)
393
420
394
421
def fk2ik_leg(obj, fk, ik):
395
422
""" Matches the fk bones in a leg rig to the ik bones.
0 commit comments