|
8 | 8 | from ...utils import MetarigError, make_mechanism_name, org |
9 | 9 | from ...utils import create_limb_widget, connected_children_names |
10 | 10 | from ...utils import align_bone_y_axis, align_bone_x_axis, align_bone_z_axis |
| 11 | +from ...utils import layout_layer_selection_ui |
11 | 12 | from rna_prop_ui import rna_idprop_ui_prop_get |
12 | 13 | from ..widgets import create_ikarrow_widget, create_gear_widget |
13 | 14 | from ..widgets import create_foot_widget, create_ballsocket_widget |
@@ -1302,46 +1303,8 @@ def parameters_ui(layout, params): |
1302 | 1303 | r = layout.row() |
1303 | 1304 | r.prop(params, "bbones") |
1304 | 1305 |
|
1305 | | - bone_layers = bpy.context.active_pose_bone.bone.layers[:] |
1306 | | - |
1307 | | - for layer in ['fk', 'tweak']: |
1308 | | - r = layout.row() |
1309 | | - r.prop(params, layer + "_extra_layers") |
1310 | | - r.active = params.tweak_extra_layers |
1311 | | - |
1312 | | - col = r.column(align=True) |
1313 | | - row = col.row(align=True) |
1314 | | - |
1315 | | - for i in range(8): |
1316 | | - icon = "NONE" |
1317 | | - if bone_layers[i]: |
1318 | | - icon = "LAYER_ACTIVE" |
1319 | | - row.prop(params, layer + "_layers", index=i, toggle=True, text="", icon=icon) |
1320 | | - |
1321 | | - row = col.row(align=True) |
1322 | | - |
1323 | | - for i in range(16, 24): |
1324 | | - icon = "NONE" |
1325 | | - if bone_layers[i]: |
1326 | | - icon = "LAYER_ACTIVE" |
1327 | | - row.prop(params, layer + "_layers", index=i, toggle=True, text="", icon=icon) |
1328 | | - |
1329 | | - col = r.column(align=True) |
1330 | | - row = col.row(align=True) |
1331 | | - |
1332 | | - for i in range(8, 16): |
1333 | | - icon = "NONE" |
1334 | | - if bone_layers[i]: |
1335 | | - icon = "LAYER_ACTIVE" |
1336 | | - row.prop(params, layer + "_layers", index=i, toggle=True, text="", icon=icon) |
1337 | | - |
1338 | | - row = col.row(align=True) |
1339 | | - |
1340 | | - for i in range(24, 32): |
1341 | | - icon = "NONE" |
1342 | | - if bone_layers[i]: |
1343 | | - icon = "LAYER_ACTIVE" |
1344 | | - row.prop(params, layer + "_layers", index=i, toggle=True, text="", icon=icon) |
| 1306 | + layout_layer_selection_ui(layout, params, "fk_extra_layers", "fk_layers") |
| 1307 | + layout_layer_selection_ui(layout, params, "tweak_extra_layers", "tweak_layers") |
1345 | 1308 |
|
1346 | 1309 |
|
1347 | 1310 | def create_sample(obj): |
|
0 commit comments