1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768
|
# SPDX-FileCopyrightText: 2009-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
from bpy.types import Panel
from bpy.app.translations import contexts as i18n_contexts
class ObjectConstraintPanel:
bl_context = "constraint"
@classmethod
def poll(cls, context):
return (context.object)
class BoneConstraintPanel:
bl_context = "bone_constraint"
@classmethod
def poll(cls, context):
return (context.pose_bone)
class OBJECT_PT_constraints(ObjectConstraintPanel, Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Object Constraints"
bl_options = {'HIDE_HEADER'}
def draw(self, _context):
layout = self.layout
layout.operator_menu_enum("object.constraint_add", "type", text="Add Object Constraint")
layout.template_constraints(use_bone_constraints=False)
class BONE_PT_constraints(BoneConstraintPanel, Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = "Bone Constraints"
bl_options = {'HIDE_HEADER'}
def draw(self, _context):
layout = self.layout
layout.operator_menu_enum("pose.constraint_add", "type", text="Add Bone Constraint")
layout.template_constraints(use_bone_constraints=True)
# Parent class for constraint panels, with templates and drawing methods
# shared between the bone and object constraint panels
class ConstraintButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = ""
bl_options = {'INSTANCED', 'HEADER_LAYOUT_EXPAND'}
@staticmethod
def draw_influence(layout, con):
layout.separator()
if con.type in {'IK', 'SPLINE_IK'}:
# constraint.disable_keep_transform doesn't work well
# for these constraints.
layout.prop(con, "influence")
else:
row = layout.row(align=True)
row.prop(con, "influence")
row.operator("constraint.disable_keep_transform", text="", icon='CANCEL')
@staticmethod
def space_template(layout, con, target=True, owner=True, separator=True):
if target or owner:
if separator:
layout.separator()
if target:
layout.prop(con, "target_space", text="Target")
if owner:
layout.prop(con, "owner_space", text="Owner")
if con.target_space == 'CUSTOM' or con.owner_space == 'CUSTOM':
col = layout.column()
col.prop(con, "space_object")
if con.space_object and con.space_object.type == 'ARMATURE':
col.prop_search(con, "space_subtarget", con.space_object.data, "bones", text="Bone")
elif con.space_object and con.space_object.type in {'MESH', 'LATTICE'}:
col.prop_search(con, "space_subtarget", con.space_object, "vertex_groups", text="Vertex Group")
@staticmethod
def target_template(layout, con, subtargets=True):
col = layout.column()
col.prop(con, "target") # XXX: limiting settings for only `curves` or some type of object.
if con.target and subtargets:
if con.target.type == 'ARMATURE':
col.prop_search(con, "subtarget", con.target.data, "bones", text="Bone")
if con.subtarget and hasattr(con, "head_tail"):
row = col.row(align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "head_tail")
# XXX icon, and only when bone has segments?
sub.prop(con, "use_bbone_shape", text="", icon='IPO_BEZIER')
row.prop_decorator(con, "head_tail")
elif con.target.type in {'MESH', 'LATTICE'}:
col.prop_search(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
def get_constraint(self, _context):
con = self.custom_data
self.layout.context_pointer_set("constraint", con)
return con
def draw_header(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.template_constraint_header(con)
# Drawing methods for specific constraints. (Shared by object and bone constraint panels)
def draw_childof(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
row = layout.row(heading="Location")
row.use_property_decorate = False
row.prop(con, "use_location_x", text="X", toggle=True)
row.prop(con, "use_location_y", text="Y", toggle=True)
row.prop(con, "use_location_z", text="Z", toggle=True)
row.label(icon='BLANK1')
row = layout.row(heading="Rotation")
row.use_property_decorate = False
row.prop(con, "use_rotation_x", text="X", toggle=True)
row.prop(con, "use_rotation_y", text="Y", toggle=True)
row.prop(con, "use_rotation_z", text="Z", toggle=True)
row.label(icon='BLANK1')
row = layout.row(heading="Scale")
row.use_property_decorate = False
row.prop(con, "use_scale_x", text="X", toggle=True)
row.prop(con, "use_scale_y", text="Y", toggle=True)
row.prop(con, "use_scale_z", text="Z", toggle=True)
row.label(icon='BLANK1')
row = layout.row()
row.operator("constraint.childof_set_inverse")
row.operator("constraint.childof_clear_inverse")
self.draw_influence(layout, con)
def draw_trackto(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
layout.prop(con, "track_axis", expand=True)
layout.prop(con, "up_axis", text="Up", expand=True)
layout.prop(con, "use_target_z")
self.space_template(layout, con)
self.draw_influence(layout, con)
def draw_follow_path(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
if con.use_fixed_location:
layout.prop(con, "offset_factor", text="Offset Factor")
else:
layout.prop(con, "offset")
layout.prop(con, "forward_axis", expand=True)
layout.prop(con, "up_axis", expand=True)
col = layout.column()
col.prop(con, "use_fixed_location")
col.prop(con, "use_curve_radius")
col.prop(con, "use_curve_follow")
layout.operator("constraint.followpath_path_animate", text="Animate Path", icon='ANIM_DATA')
self.draw_influence(layout, con)
def draw_rot_limit(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
# Decorators and property split are really buggy with these properties
row = layout.row(heading="Limit X", align=True)
row.use_property_decorate = False
row.prop(con, "use_limit_x", text="")
sub = row.column(align=True)
sub.active = con.use_limit_x
sub.prop(con, "min_x", text="Min")
sub.prop(con, "max_x", text="Max")
row.label(icon='BLANK1')
row = layout.row(heading="Y", align=True)
row.use_property_decorate = False
row.prop(con, "use_limit_y", text="")
sub = row.column(align=True)
sub.active = con.use_limit_y
sub.prop(con, "min_y", text="Min")
sub.prop(con, "max_y", text="Max")
row.label(icon='BLANK1')
row = layout.row(heading="Z", align=True)
row.use_property_decorate = False
row.prop(con, "use_limit_z", text="")
sub = row.column(align=True)
sub.active = con.use_limit_z
sub.prop(con, "min_z", text="Min")
sub.prop(con, "max_z", text="Max")
row.label(icon='BLANK1')
layout.prop(con, "euler_order", text="Order")
layout.prop(con, "use_transform_limit")
layout.prop(con, "use_legacy_behavior")
self.space_template(layout, con, target=False, owner=True)
self.draw_influence(layout, con)
def draw_loc_limit(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
col = layout.column()
row = col.row(heading="Minimum X", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_min_x", text="")
subsub = sub.row(align=True)
subsub.active = con.use_min_x
subsub.prop(con, "min_x", text="")
row.prop_decorator(con, "min_x")
row = col.row(heading="Y", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_min_y", text="")
subsub = sub.row(align=True)
subsub.active = con.use_min_y
subsub.prop(con, "min_y", text="")
row.prop_decorator(con, "min_y")
row = col.row(heading="Z", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_min_z", text="")
subsub = sub.row(align=True)
subsub.active = con.use_min_z
subsub.prop(con, "min_z", text="")
row.prop_decorator(con, "min_z")
col.separator()
row = col.row(heading="Maximum X", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_max_x", text="")
subsub = sub.row(align=True)
subsub.active = con.use_max_x
subsub.prop(con, "max_x", text="")
row.prop_decorator(con, "max_x")
row = col.row(heading="Y", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_max_y", text="")
subsub = sub.row(align=True)
subsub.active = con.use_max_y
subsub.prop(con, "max_y", text="")
row.prop_decorator(con, "max_y")
row = col.row(heading="Z", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_max_z", text="")
subsub = sub.row(align=True)
subsub.active = con.use_max_z
subsub.prop(con, "max_z", text="")
row.prop_decorator(con, "max_z")
layout.prop(con, "use_transform_limit")
self.space_template(layout, con, target=False, owner=True)
self.draw_influence(layout, con)
def draw_size_limit(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
col = layout.column()
row = col.row(heading="Minimum X", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_min_x", text="")
subsub = sub.row(align=True)
subsub.active = con.use_min_x
subsub.prop(con, "min_x", text="")
row.prop_decorator(con, "min_x")
row = col.row(heading="Y", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_min_y", text="")
subsub = sub.row(align=True)
subsub.active = con.use_min_y
subsub.prop(con, "min_y", text="")
row.prop_decorator(con, "min_y")
row = col.row(heading="Z", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_min_z", text="")
subsub = sub.row(align=True)
subsub.active = con.use_min_z
subsub.prop(con, "min_z", text="")
row.prop_decorator(con, "min_z")
col.separator()
row = col.row(heading="Maximum X", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_max_x", text="")
subsub = sub.row(align=True)
subsub.active = con.use_max_x
subsub.prop(con, "max_x", text="")
row.prop_decorator(con, "max_x")
row = col.row(heading="Y", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_max_y", text="")
subsub = sub.row(align=True)
subsub.active = con.use_max_y
subsub.prop(con, "max_y", text="")
row.prop_decorator(con, "max_y")
row = col.row(heading="Z", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_max_z", text="")
subsub = sub.row(align=True)
subsub.active = con.use_max_z
subsub.prop(con, "max_z", text="")
row.prop_decorator(con, "max_z")
layout.prop(con, "use_transform_limit")
self.space_template(layout, con, target=False, owner=True)
self.draw_influence(layout, con)
def draw_rotate_like(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
layout.prop(con, "euler_order", text="Order")
row = layout.row(heading="Axis", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_x", text="X", toggle=True)
sub.prop(con, "use_y", text="Y", toggle=True)
sub.prop(con, "use_z", text="Z", toggle=True)
row.label(icon='BLANK1')
row = layout.row(heading="Invert", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "invert_x", text="X", toggle=True)
sub.prop(con, "invert_y", text="Y", toggle=True)
sub.prop(con, "invert_z", text="Z", toggle=True)
row.label(icon='BLANK1')
layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint)
self.space_template(layout, con)
self.draw_influence(layout, con)
def draw_locate_like(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
row = layout.row(heading="Axis", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_x", text="X", toggle=True)
sub.prop(con, "use_y", text="Y", toggle=True)
sub.prop(con, "use_z", text="Z", toggle=True)
row.label(icon='BLANK1')
row = layout.row(heading="Invert", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "invert_x", text="X", toggle=True)
sub.prop(con, "invert_y", text="Y", toggle=True)
sub.prop(con, "invert_z", text="Z", toggle=True)
row.label(icon='BLANK1')
layout.prop(con, "use_offset")
self.space_template(layout, con)
self.draw_influence(layout, con)
def draw_size_like(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
row = layout.row(heading="Axis", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_x", text="X", toggle=True)
sub.prop(con, "use_y", text="Y", toggle=True)
sub.prop(con, "use_z", text="Z", toggle=True)
row.label(icon='BLANK1')
col = layout.column()
col.prop(con, "power")
col.prop(con, "use_make_uniform")
col.prop(con, "use_offset")
row = col.row()
row.active = con.use_offset
row.prop(con, "use_add")
self.space_template(layout, con)
self.draw_influence(layout, con)
def draw_same_volume(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
layout.prop(con, "mode")
row = layout.row(heading="Free Axis")
row.prop(con, "free_axis", expand=True)
layout.prop(con, "volume")
self.space_template(layout, con, target=False, owner=True)
self.draw_influence(layout, con)
def draw_trans_like(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
layout.prop(con, "remove_target_shear")
layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint)
self.space_template(layout, con)
self.draw_influence(layout, con)
def draw_action(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
target_row = layout.row(align=True)
target_row.active = not con.use_eval_time
self.target_template(target_row, con)
row = layout.row(align=True, heading="Evaluation Time")
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_eval_time", text="")
subsub = sub.row(align=True)
subsub.active = con.use_eval_time
subsub.prop(con, "eval_time", text="")
row.prop_decorator(con, "eval_time")
layout.prop(con, "mix_mode", text="Mix", text_ctxt=i18n_contexts.constraint)
self.draw_influence(layout, con)
def draw_lock_track(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
layout.prop(con, "track_axis", expand=True)
layout.prop(con, "lock_axis", expand=True)
self.draw_influence(layout, con)
def draw_dist_limit(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
row = layout.row()
row.prop(con, "distance")
row.operator("constraint.limitdistance_reset", text="", icon='X')
layout.prop(con, "limit_mode", text="Clamp Region")
layout.prop(con, "use_transform_limit")
self.space_template(layout, con)
self.draw_influence(layout, con)
def draw_stretch_to(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
row = layout.row()
row.prop(con, "rest_length")
row.operator("constraint.stretchto_reset", text="", icon='X')
layout.separator()
col = layout.column()
col.prop(con, "bulge", text="Volume Variation")
row = col.row(heading="Volume Min", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_bulge_min", text="")
subsub = sub.row(align=True)
subsub.active = con.use_bulge_min
subsub.prop(con, "bulge_min", text="")
row.prop_decorator(con, "bulge_min")
row = col.row(heading="Max", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_bulge_max", text="")
subsub = sub.row(align=True)
subsub.active = con.use_bulge_max
subsub.prop(con, "bulge_max", text="")
row.prop_decorator(con, "bulge_max")
row = col.row()
row.active = con.use_bulge_min or con.use_bulge_max
row.prop(con, "bulge_smooth", text="Smooth")
layout.prop(con, "volume", expand=True)
layout.prop(con, "keep_axis", text="Rotation", expand=True)
self.draw_influence(layout, con)
def draw_min_max(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
layout.prop(con, "offset")
layout.prop(con, "floor_location", expand=True, text="Min/Max")
layout.prop(con, "use_rotation")
self.space_template(layout, con)
self.draw_influence(layout, con)
def draw_clamp_to(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
layout.prop(con, "main_axis", expand=True)
layout.prop(con, "use_cyclic")
self.draw_influence(layout, con)
def draw_transform(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
layout.prop(con, "use_motion_extrapolate", text="Extrapolate")
self.space_template(layout, con)
self.draw_influence(layout, con)
def draw_shrinkwrap(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con, False)
layout.prop(con, "distance")
layout.prop(con, "shrinkwrap_type", text="Mode")
layout.separator()
if con.shrinkwrap_type == 'PROJECT':
layout.prop(con, "project_axis", expand=True, text="Project Axis")
layout.prop(con, "project_axis_space", text="Space")
layout.prop(con, "project_limit", text="Distance")
layout.prop(con, "use_project_opposite")
layout.separator()
col = layout.column()
row = col.row()
row.prop(con, "cull_face", expand=True)
row = col.row()
row.active = con.use_project_opposite and con.cull_face != 'OFF'
row.prop(con, "use_invert_cull")
layout.separator()
if con.shrinkwrap_type in {'PROJECT', 'NEAREST_SURFACE', 'TARGET_PROJECT'}:
layout.prop(con, "wrap_mode", text="Snap Mode")
row = layout.row(heading="Align to Normal", align=True)
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_track_normal", text="")
subsub = sub.row(align=True)
subsub.active = con.use_track_normal
subsub.prop(con, "track_axis", text="")
row.prop_decorator(con, "track_axis")
self.draw_influence(layout, con)
def draw_damp_track(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
layout.prop(con, "track_axis", expand=True)
self.draw_influence(layout, con)
def draw_spline_ik(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
self.draw_influence(layout, con)
def draw_pivot(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
if con.target:
layout.prop(con, "offset", text="Pivot Offset")
else:
layout.prop(con, "use_relative_location")
if con.use_relative_location:
layout.prop(con, "offset", text="Pivot Point")
else:
layout.prop(con, "offset", text="Pivot Point")
col = layout.column()
col.prop(con, "rotation_range", text="Rotation Range")
self.draw_influence(layout, con)
def draw_follow_track(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
clip = None
if con.use_active_clip:
clip = context.scene.active_clip
else:
clip = con.clip
layout.prop(con, "use_active_clip")
layout.prop(con, "use_3d_position")
row = layout.row()
row.active = not con.use_3d_position
row.prop(con, "use_undistorted_position")
if not con.use_active_clip:
layout.prop(con, "clip")
layout.prop(con, "frame_method")
if clip:
tracking = clip.tracking
layout.prop_search(con, "object", tracking, "objects", icon='OBJECT_DATA')
tracking_object = tracking.objects.get(con.object, tracking.objects[0])
layout.prop_search(con, "track", tracking_object, "tracks", icon='ANIM_DATA')
layout.prop(con, "camera")
row = layout.row()
row.active = not con.use_3d_position
row.prop(con, "depth_object")
layout.operator("clip.constraint_to_fcurve")
self.draw_influence(layout, con)
def draw_camera_solver(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
layout.prop(con, "use_active_clip")
if not con.use_active_clip:
layout.prop(con, "clip")
layout.operator("clip.constraint_to_fcurve")
self.draw_influence(layout, con)
def draw_object_solver(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
clip = None
if con.use_active_clip:
clip = context.scene.active_clip
else:
clip = con.clip
layout.prop(con, "use_active_clip")
if not con.use_active_clip:
layout.prop(con, "clip")
if clip:
layout.prop_search(con, "object", clip.tracking, "objects", icon='OBJECT_DATA')
layout.prop(con, "camera")
row = layout.row()
row.operator("constraint.objectsolver_set_inverse")
row.operator("constraint.objectsolver_clear_inverse")
layout.operator("clip.constraint_to_fcurve")
self.draw_influence(layout, con)
def draw_transform_cache(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
layout.template_cache_file(con, "cache_file")
cache_file = con.cache_file
if cache_file is not None:
layout.prop_search(con, "object_path", cache_file, "object_paths")
self.draw_influence(layout, con)
def draw_python_constraint(self, _context):
layout = self.layout
layout.label(text="Blender 2.6 doesn't support Python constraints yet")
def draw_armature(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
col = layout.column()
col.prop(con, "use_deform_preserve_volume")
col.prop(con, "use_bone_envelopes")
if context.pose_bone:
col.prop(con, "use_current_location")
layout.operator("constraint.add_target", text="Add Target Bone")
layout.operator("constraint.normalize_target_weights")
self.draw_influence(layout, con)
if not con.targets:
layout.label(text="No target bones added", icon='ERROR')
def draw_kinematic(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
self.target_template(layout, con)
if context.object.pose.ik_solver == 'ITASC':
layout.prop(con, "ik_type")
# This button gives itself too much padding, so put it in a column with the subtarget
col = layout.column()
col.prop(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
col.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
col = layout.column()
if con.pole_target:
col.prop(con, "pole_angle")
col.prop(con, "use_tail")
col.prop(con, "use_stretch")
col.prop(con, "chain_count")
if con.ik_type == 'COPY_POSE':
layout.prop(con, "reference_axis", expand=True)
# Use separate rows and columns here to avoid an alignment issue with the lock buttons
loc_col = layout.column()
loc_col.prop(con, "use_location")
row = loc_col.row()
row.active = con.use_location
row.prop(con, "weight", text="Weight", slider=True)
row = loc_col.row(heading="Lock", align=True)
row.use_property_decorate = False
row.active = con.use_location
sub = row.row(align=True)
sub.prop(con, "lock_location_x", text="X", toggle=True)
sub.prop(con, "lock_location_y", text="Y", toggle=True)
sub.prop(con, "lock_location_z", text="Z", toggle=True)
row.label(icon='BLANK1')
rot_col = layout.column()
rot_col.prop(con, "use_rotation")
row = rot_col.row()
row.active = con.use_rotation
row.prop(con, "orient_weight", text="Weight", slider=True)
row = rot_col.row(heading="Lock", align=True)
row.use_property_decorate = False
row.active = con.use_rotation
sub = row.row(align=True)
sub.prop(con, "lock_rotation_x", text="X", toggle=True)
sub.prop(con, "lock_rotation_y", text="Y", toggle=True)
sub.prop(con, "lock_rotation_z", text="Z", toggle=True)
row.label(icon='BLANK1')
elif con.ik_type == 'DISTANCE':
layout.prop(con, "limit_mode")
col = layout.column()
col.prop(con, "weight", text="Weight", slider=True)
col.prop(con, "distance", text="Distance", slider=True)
else:
# Standard IK constraint
col = layout.column()
col.prop(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
col.prop_search(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
col = layout.column()
if con.pole_target:
col.prop(con, "pole_angle")
col.prop(con, "iterations")
col.prop(con, "chain_count")
col.prop(con, "use_tail")
col.prop(con, "use_stretch")
col = layout.column()
row = col.row(align=True, heading="Weight Position")
row.prop(con, "use_location", text="")
sub = row.row(align=True)
sub.active = con.use_location
sub.prop(con, "weight", text="", slider=True)
row = col.row(align=True, heading="Rotation")
row.prop(con, "use_rotation", text="")
sub = row.row(align=True)
sub.active = con.use_rotation
sub.prop(con, "orient_weight", text="", slider=True)
self.draw_influence(layout, con)
# Parent class for constraint sub-panels.
class ConstraintButtonsSubPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_label = ""
def get_constraint(self, _context):
con = self.custom_data
self.layout.context_pointer_set("constraint", con)
return con
def draw_transform_from(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.prop(con, "map_from", expand=True)
layout.use_property_split = True
layout.use_property_decorate = True
from_axes = [con.map_to_x_from, con.map_to_y_from, con.map_to_z_from]
if con.map_from == 'ROTATION':
layout.prop(con, "from_rotation_mode", text="Mode")
ext = "" if con.map_from == 'LOCATION' else "_rot" if con.map_from == 'ROTATION' else "_scale"
col = layout.column(align=True)
col.active = "X" in from_axes
col.prop(con, "from_min_x" + ext, text="X Min")
col.prop(con, "from_max_x" + ext, text="Max")
col = layout.column(align=True)
col.active = "Y" in from_axes
col.prop(con, "from_min_y" + ext, text="Y Min")
col.prop(con, "from_max_y" + ext, text="Max")
col = layout.column(align=True)
col.active = "Z" in from_axes
col.prop(con, "from_min_z" + ext, text="Z Min")
col.prop(con, "from_max_z" + ext, text="Max")
def draw_transform_to(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.prop(con, "map_to", expand=True)
layout.use_property_split = True
layout.use_property_decorate = True
if con.map_to == 'ROTATION':
layout.prop(con, "to_euler_order", text="Order")
ext = "" if con.map_to == 'LOCATION' else "_rot" if con.map_to == 'ROTATION' else "_scale"
col = layout.column(align=True)
col.prop(con, "map_to_x_from", expand=False, text="X Source Axis")
col.prop(con, "to_min_x" + ext, text="Min")
col.prop(con, "to_max_x" + ext, text="Max")
col = layout.column(align=True)
col.prop(con, "map_to_y_from", expand=False, text="Y Source Axis")
col.prop(con, "to_min_y" + ext, text="Min")
col.prop(con, "to_max_y" + ext, text="Max")
col = layout.column(align=True)
col.prop(con, "map_to_z_from", expand=False, text="Z Source Axis")
col.prop(con, "to_min_z" + ext, text="Min")
col.prop(con, "to_max_z" + ext, text="Max")
layout.prop(con, "mix_mode" + ext, text="Mix", text_ctxt=i18n_contexts.constraint)
def draw_armature_bones(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
for i, tgt in enumerate(con.targets):
has_target = tgt.target is not None
box = layout.box()
header = box.row()
header.use_property_split = False
split = header.split(factor=0.45, align=True)
split.prop(tgt, "target", text="")
row = split.row(align=True)
row.active = has_target
if has_target:
row.prop_search(tgt, "subtarget", tgt.target.data, "bones", text="")
else:
row.prop(tgt, "subtarget", text="", icon='BONE_DATA')
header.operator("constraint.remove_target", text="", icon='X').index = i
row = box.row()
row.active = has_target and tgt.subtarget != ""
row.prop(tgt, "weight", slider=True, text="Weight")
def draw_spline_ik_fitting(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
col = layout.column()
col.prop(con, "chain_count")
col.prop(con, "use_even_divisions")
col.prop(con, "use_chain_offset")
def draw_spline_ik_chain_scaling(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
layout.prop(con, "use_curve_radius")
layout.prop(con, "y_scale_mode")
layout.prop(con, "xz_scale_mode")
if con.xz_scale_mode in {'INVERSE_PRESERVE', 'VOLUME_PRESERVE'}:
layout.prop(con, "use_original_scale")
if con.xz_scale_mode == 'VOLUME_PRESERVE':
col = layout.column()
col.prop(con, "bulge", text="Volume Variation")
row = col.row(heading="Volume Min")
row.prop(con, "use_bulge_min", text="")
sub = row.row()
sub.active = con.use_bulge_min
sub.prop(con, "bulge_min", text="")
row = col.row(heading="Max")
row.prop(con, "use_bulge_max", text="")
sub = row.row()
sub.active = con.use_bulge_max
sub.prop(con, "bulge_max", text="")
row = layout.row()
row.active = con.use_bulge_min or con.use_bulge_max
row.prop(con, "bulge_smooth", text="Smooth")
def draw_action_target(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
col = layout.column()
col.active = not con.use_eval_time
col.prop(con, "transform_channel", text="Channel")
ConstraintButtonsPanel.space_template(col, con, target=True, owner=False, separator=False)
sub = col.column(align=True)
sub.prop(con, "min", text="Range Min")
sub.prop(con, "max", text="Max")
def draw_action_action(self, context):
layout = self.layout
con = self.get_constraint(context)
layout.use_property_split = True
layout.use_property_decorate = True
col = layout.column(align=True)
col.prop(con, "action")
if context.preferences.experimental.use_animation_baklava and con.action and con.action.is_action_layered:
col.context_pointer_set("animated_id", con.id_data)
col.template_search(
con, "action_slot",
con, "action_slots",
new="", # No use in making a new slot here.
unlink="anim.slot_unassign_from_constraint",
text="Slot",
)
layout.prop(con, "use_bone_object_action")
col = layout.column(align=True)
col.prop(con, "frame_start", text="Frame Start")
col.prop(con, "frame_end", text="End")
def draw_transform_cache_velocity(self, context):
self.draw_transform_cache_subpanel(
context, self.layout.template_cache_file_velocity
)
def draw_transform_cache_procedural(self, context):
self.draw_transform_cache_subpanel(
context, self.layout.template_cache_file_procedural
)
def draw_transform_cache_time(self, context):
self.draw_transform_cache_subpanel(
context, self.layout.template_cache_file_time_settings
)
def draw_transform_cache_layers(self, context):
self.draw_transform_cache_subpanel(
context, self.layout.template_cache_file_layers
)
def draw_transform_cache_subpanel(self, context, template_func):
con = self.get_constraint(context)
if con.cache_file is None:
return
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = True
template_func(con, "cache_file")
# Child Of Constraint
class OBJECT_PT_bChildOfConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_childof(context)
class BONE_PT_bChildOfConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_childof(context)
# Track To Constraint
class OBJECT_PT_bTrackToConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_trackto(context)
class BONE_PT_bTrackToConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_trackto(context)
# Follow Path Constraint
class OBJECT_PT_bFollowPathConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_follow_path(context)
class BONE_PT_bFollowPathConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_follow_path(context)
# Rotation Limit Constraint
class OBJECT_PT_bRotLimitConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_rot_limit(context)
class BONE_PT_bRotLimitConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_rot_limit(context)
# Location Limit Constraint
class OBJECT_PT_bLocLimitConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_loc_limit(context)
class BONE_PT_bLocLimitConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_loc_limit(context)
# Size Limit Constraint
class OBJECT_PT_bSizeLimitConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_size_limit(context)
class BONE_PT_bSizeLimitConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_size_limit(context)
# Rotate Like Constraint
class OBJECT_PT_bRotateLikeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_rotate_like(context)
class BONE_PT_bRotateLikeConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_rotate_like(context)
# Locate Like Constraint
class OBJECT_PT_bLocateLikeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_locate_like(context)
class BONE_PT_bLocateLikeConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_locate_like(context)
# Size Like Constraint
class OBJECT_PT_bSizeLikeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_size_like(context)
class BONE_PT_bSizeLikeConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_size_like(context)
# Same Volume Constraint
class OBJECT_PT_bSameVolumeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_same_volume(context)
class BONE_PT_bSameVolumeConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_same_volume(context)
# Trans Like Constraint
class OBJECT_PT_bTransLikeConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_trans_like(context)
class BONE_PT_bTransLikeConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_trans_like(context)
# Action Constraint
class OBJECT_PT_bActionConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_action(context)
class BONE_PT_bActionConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_action(context)
class OBJECT_PT_bActionConstraint_target(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bActionConstraint"
bl_label = "Target"
def draw(self, context):
self.draw_action_target(context)
class BONE_PT_bActionConstraint_target(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bActionConstraint"
bl_label = "Target"
def draw(self, context):
self.draw_action_target(context)
class OBJECT_PT_bActionConstraint_action(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bActionConstraint"
bl_label = "Action"
def draw(self, context):
self.draw_action_action(context)
class BONE_PT_bActionConstraint_action(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bActionConstraint"
bl_label = "Action"
def draw(self, context):
self.draw_action_action(context)
# Lock Track Constraint
class OBJECT_PT_bLockTrackConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_lock_track(context)
class BONE_PT_bLockTrackConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_lock_track(context)
# Distance Limit Constraint
class OBJECT_PT_bDistLimitConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_dist_limit(context)
class BONE_PT_bDistLimitConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_dist_limit(context)
# Stretch To Constraint
class OBJECT_PT_bStretchToConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_stretch_to(context)
class BONE_PT_bStretchToConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_stretch_to(context)
# Min Max Constraint
class OBJECT_PT_bMinMaxConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_min_max(context)
class BONE_PT_bMinMaxConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_min_max(context)
# Clamp To Constraint
class OBJECT_PT_bClampToConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_clamp_to(context)
class BONE_PT_bClampToConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_clamp_to(context)
# Transform Constraint
class OBJECT_PT_bTransformConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_transform(context)
class BONE_PT_bTransformConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_transform(context)
class OBJECT_PT_bTransformConstraint_source(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bTransformConstraint"
bl_label = "Map From"
def draw(self, context):
self.draw_transform_from(context)
class BONE_PT_bTransformConstraint_from(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bTransformConstraint"
bl_label = "Map From"
def draw(self, context):
self.draw_transform_from(context)
class OBJECT_PT_bTransformConstraint_destination(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bTransformConstraint"
bl_label = "Map To"
def draw(self, context):
self.draw_transform_to(context)
class BONE_PT_bTransformConstraint_to(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bTransformConstraint"
bl_label = "Map To"
def draw(self, context):
self.draw_transform_to(context)
# Shrink-wrap Constraint.
class OBJECT_PT_bShrinkwrapConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_shrinkwrap(context)
class BONE_PT_bShrinkwrapConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_shrinkwrap(context)
# Damp Track Constraint
class OBJECT_PT_bDampTrackConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_damp_track(context)
class BONE_PT_bDampTrackConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_damp_track(context)
# Spline IK Constraint
class BONE_PT_bSplineIKConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_spline_ik(context)
class BONE_PT_bSplineIKConstraint_fitting(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bSplineIKConstraint"
bl_label = "Fitting"
def draw(self, context):
self.draw_spline_ik_fitting(context)
class BONE_PT_bSplineIKConstraint_chain_scaling(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bSplineIKConstraint"
bl_label = "Chain Scaling"
def draw(self, context):
self.draw_spline_ik_chain_scaling(context)
# Pivot Constraint
class OBJECT_PT_bPivotConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_pivot(context)
class BONE_PT_bPivotConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_pivot(context)
# Follow Track Constraint
class OBJECT_PT_bFollowTrackConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_follow_track(context)
class BONE_PT_bFollowTrackConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_follow_track(context)
# Camera Solver Constraint
class OBJECT_PT_bCameraSolverConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_camera_solver(context)
class BONE_PT_bCameraSolverConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_camera_solver(context)
# Object Solver Constraint
class OBJECT_PT_bObjectSolverConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_object_solver(context)
class BONE_PT_bObjectSolverConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_object_solver(context)
# Transform Cache Constraint
class OBJECT_PT_bTransformCacheConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_transform_cache(context)
class BONE_PT_bTransformCacheConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_transform_cache(context)
class OBJECT_PT_bTransformCacheConstraint_velocity(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bTransformCacheConstraint"
bl_label = "Velocity"
def draw(self, context):
self.draw_transform_cache_velocity(context)
class BONE_PT_bTransformCacheConstraint_velocity(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bTransformCacheConstraint"
bl_label = "Velocity"
def draw(self, context):
self.draw_transform_cache_velocity(context)
class OBJECT_PT_bTransformCacheConstraint_layers(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bTransformCacheConstraint"
bl_label = "Override Layers"
def draw(self, context):
self.draw_transform_cache_layers(context)
class BONE_PT_bTransformCacheConstraint_layers(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bTransformCacheConstraint"
bl_label = "Override Layers"
def draw(self, context):
self.draw_transform_cache_layers(context)
class OBJECT_PT_bTransformCacheConstraint_procedural(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bTransformCacheConstraint"
bl_label = "Render Procedural"
def draw(self, context):
self.draw_transform_cache_procedural(context)
class BONE_PT_bTransformCacheConstraint_procedural(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bTransformCacheConstraint"
bl_label = "Render Procedural"
def draw(self, context):
self.draw_transform_cache_procedural(context)
class OBJECT_PT_bTransformCacheConstraint_time(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bTransformCacheConstraint"
bl_label = "Time"
def draw(self, context):
self.draw_transform_cache_time(context)
class BONE_PT_bTransformCacheConstraint_time(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bTransformCacheConstraint"
bl_label = "Time"
def draw(self, context):
self.draw_transform_cache_time(context)
# Python Constraint
class OBJECT_PT_bPythonConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_python_constraint(context)
class BONE_PT_bPythonConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_python_constraint(context)
# Armature Constraint
class OBJECT_PT_bArmatureConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_armature(context)
class BONE_PT_bArmatureConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_armature(context)
class OBJECT_PT_bArmatureConstraint_bones(ObjectConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "OBJECT_PT_bArmatureConstraint"
bl_label = "Bones"
def draw(self, context):
self.draw_armature_bones(context)
class BONE_PT_bArmatureConstraint_bones(BoneConstraintPanel, ConstraintButtonsSubPanel, Panel):
bl_parent_id = "BONE_PT_bArmatureConstraint"
bl_label = "Bones"
def draw(self, context):
self.draw_armature_bones(context)
# Inverse Kinematic Constraint
class OBJECT_PT_bKinematicConstraint(ObjectConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_kinematic(context)
class BONE_PT_bKinematicConstraint(BoneConstraintPanel, ConstraintButtonsPanel, Panel):
def draw(self, context):
self.draw_kinematic(context)
classes = (
# Object Panels
OBJECT_PT_constraints,
BONE_PT_constraints,
OBJECT_PT_bChildOfConstraint,
OBJECT_PT_bTrackToConstraint,
OBJECT_PT_bKinematicConstraint,
OBJECT_PT_bFollowPathConstraint,
OBJECT_PT_bRotLimitConstraint,
OBJECT_PT_bLocLimitConstraint,
OBJECT_PT_bSizeLimitConstraint,
OBJECT_PT_bRotateLikeConstraint,
OBJECT_PT_bLocateLikeConstraint,
OBJECT_PT_bSizeLikeConstraint,
OBJECT_PT_bSameVolumeConstraint,
OBJECT_PT_bTransLikeConstraint,
OBJECT_PT_bActionConstraint,
OBJECT_PT_bActionConstraint_target,
OBJECT_PT_bActionConstraint_action,
OBJECT_PT_bLockTrackConstraint,
OBJECT_PT_bDistLimitConstraint,
OBJECT_PT_bStretchToConstraint,
OBJECT_PT_bMinMaxConstraint,
OBJECT_PT_bClampToConstraint,
OBJECT_PT_bTransformConstraint,
OBJECT_PT_bTransformConstraint_source,
OBJECT_PT_bTransformConstraint_destination,
OBJECT_PT_bShrinkwrapConstraint,
OBJECT_PT_bDampTrackConstraint,
OBJECT_PT_bPivotConstraint,
OBJECT_PT_bFollowTrackConstraint,
OBJECT_PT_bCameraSolverConstraint,
OBJECT_PT_bObjectSolverConstraint,
OBJECT_PT_bTransformCacheConstraint,
OBJECT_PT_bTransformCacheConstraint_time,
OBJECT_PT_bTransformCacheConstraint_procedural,
OBJECT_PT_bTransformCacheConstraint_velocity,
OBJECT_PT_bTransformCacheConstraint_layers,
OBJECT_PT_bPythonConstraint,
OBJECT_PT_bArmatureConstraint,
OBJECT_PT_bArmatureConstraint_bones,
# Bone panels
BONE_PT_bChildOfConstraint,
BONE_PT_bTrackToConstraint,
BONE_PT_bKinematicConstraint,
BONE_PT_bFollowPathConstraint,
BONE_PT_bRotLimitConstraint,
BONE_PT_bLocLimitConstraint,
BONE_PT_bSizeLimitConstraint,
BONE_PT_bRotateLikeConstraint,
BONE_PT_bLocateLikeConstraint,
BONE_PT_bSizeLikeConstraint,
BONE_PT_bSameVolumeConstraint,
BONE_PT_bTransLikeConstraint,
BONE_PT_bActionConstraint,
BONE_PT_bActionConstraint_target,
BONE_PT_bActionConstraint_action,
BONE_PT_bLockTrackConstraint,
BONE_PT_bDistLimitConstraint,
BONE_PT_bStretchToConstraint,
BONE_PT_bMinMaxConstraint,
BONE_PT_bClampToConstraint,
BONE_PT_bTransformConstraint,
BONE_PT_bTransformConstraint_from,
BONE_PT_bTransformConstraint_to,
BONE_PT_bShrinkwrapConstraint,
BONE_PT_bDampTrackConstraint,
BONE_PT_bSplineIKConstraint,
BONE_PT_bSplineIKConstraint_fitting,
BONE_PT_bSplineIKConstraint_chain_scaling,
BONE_PT_bPivotConstraint,
BONE_PT_bFollowTrackConstraint,
BONE_PT_bCameraSolverConstraint,
BONE_PT_bObjectSolverConstraint,
BONE_PT_bTransformCacheConstraint,
BONE_PT_bTransformCacheConstraint_time,
BONE_PT_bTransformCacheConstraint_procedural,
BONE_PT_bTransformCacheConstraint_velocity,
BONE_PT_bTransformCacheConstraint_layers,
BONE_PT_bPythonConstraint,
BONE_PT_bArmatureConstraint,
BONE_PT_bArmatureConstraint_bones,
)
if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:
register_class(cls)
|