Skip to content

Commit 9622d37

Browse files
committed
revert 1b5177c snapping functions partial fix
1 parent 8f3688a commit 9622d37

File tree

1 file changed

+16
-43
lines changed

1 file changed

+16
-43
lines changed

rig_ui_template.py

Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -331,38 +331,19 @@ def fk2ik_arm(obj, fk, ik):
331331
match_pose_scale(hand, handi)
332332
else:
333333
# Upper arm position
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)
334+
match_pose_translation(uarm, uarmi)
335+
match_pose_rotation(uarm, uarmi)
336+
match_pose_scale(uarm, uarmi)
343337
344338
# Forearm position
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)
339+
#match_pose_translation(hand, handi)
340+
match_pose_rotation(farm, farmi)
341+
match_pose_scale(farm, farmi)
354342
355343
# Hand position
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)
344+
match_pose_translation(hand, handi)
345+
match_pose_rotation(hand, handi)
346+
match_pose_scale(hand, handi)
366347
367348
368349
def ik2fk_arm(obj, fk, ik):
@@ -399,24 +380,16 @@ def ik2fk_arm(obj, fk, ik):
399380
400381
else:
401382
# Hand position
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)
383+
match_pose_translation(handi, hand)
384+
match_pose_rotation(handi, hand)
385+
match_pose_scale(handi, hand)
409386
410387
# Upper Arm position
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)
388+
match_pose_translation(uarmi, uarm)
389+
match_pose_rotation(uarmi, uarm)
390+
match_pose_scale(uarmi, uarm)
418391
# Rotation Correction
419-
# correct_rotation(uarmi, uarm)
392+
correct_rotation(uarmi, uarm)
420393
421394
def fk2ik_leg(obj, fk, ik):
422395
""" Matches the fk bones in a leg rig to the ik bones.

0 commit comments

Comments
 (0)