|
2 | 2 | import bpy |
3 | 3 | from bpy.types import Operator |
4 | 4 | from bpy.types import Context |
5 | | -from .utils import dprint, is_pose_mode, get_fcurves, toggle_rotation_locks, jump_next_frame |
| 5 | +from .utils import ( |
| 6 | + dprint, |
| 7 | + is_pose_mode, |
| 8 | + get_fcurves, |
| 9 | + get_rotation_locks, |
| 10 | + toggle_rotation_locks, |
| 11 | + jump_next_frame, |
| 12 | +) |
6 | 13 |
|
7 | 14 |
|
8 | 15 | class CRM_OT_convert_rotation_mode(Operator): |
@@ -53,13 +60,8 @@ def execute(self, context): |
53 | 60 | f" # Target Rmode will be {CRM_Properties.targetRmode}" |
54 | 61 | ) |
55 | 62 |
|
56 | | - # self.locks = [] |
57 | | - self.locks.append(current_bone.lock_rotation[0]) |
58 | | - self.locks.append(current_bone.lock_rotation[1]) |
59 | | - self.locks.append(current_bone.lock_rotation[2]) |
60 | | - self.locks.append(current_bone.lock_rotation_w) |
61 | | - self.locks.append(current_bone.lock_rotations_4d) |
62 | | - toggle_rotation_locks('OFF', current_bone) |
| 63 | + locks = get_rotation_locks(current_bone) |
| 64 | + toggle_rotation_locks(current_bone, 'OFF') |
63 | 65 | dprint(" | # Backed up and unlocked rotations") |
64 | 66 |
|
65 | 67 | original_rmode = current_bone.rotation_mode |
@@ -128,7 +130,7 @@ def execute(self, context): |
128 | 130 | break |
129 | 131 |
|
130 | 132 | if CRM_Properties.preserveLocks: |
131 | | - toggle_rotation_locks('ON', current_bone) |
| 133 | + toggle_rotation_locks(current_bone, 'ON', locks) |
132 | 134 | dprint(" | # Reverted rotation locks") |
133 | 135 |
|
134 | 136 | dprint( |
|
0 commit comments