File size: 79,118 Bytes
d8ab1df |
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 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 |
UsdSkel module — pxr-usd-api 105.1 documentation
pxr-usd-api
»
Modules »
UsdSkel module
# UsdSkel module
Summary: The UsdSkel module defines schemas and API that form a basis for interchanging skeletally-skinned meshes and joint animations.
Classes:
AnimMapper
AnimQuery
Class providing efficient queries of primitives that provide skel animation.
Animation
Describes a skel animation, where joint animation is stored in a vectorized form.
Binding
Helper object that describes the binding of a skeleton to a set of skinnable objects.
BindingAPI
Provides API for authoring and extracting all the skinning-related data that lives in the"geometry hierarchy"of prims and models that want to be skeletally deformed.
BlendShape
Describes a target blend shape, possibly containing inbetween shapes.
BlendShapeQuery
Helper class used to resolve blend shape weights, including inbetweens.
Cache
Thread-safe cache for accessing query objects for evaluating skeletal data.
InbetweenShape
Schema wrapper for UsdAttribute for authoring and introspecting attributes that serve as inbetween shapes of a UsdSkelBlendShape.
PackedJointAnimation
Deprecated.
Root
Boundable prim type used to identify a scope beneath which skeletally- posed primitives are defined.
Skeleton
Describes a skeleton.
SkeletonQuery
Primary interface to reading bound skeleton data.
SkinningQuery
Object used for querying resolved bindings for skinning.
Tokens
Topology
Object holding information describing skeleton topology.
class pxr.UsdSkel.AnimMapper
Methods:
IsIdentity()
Returns true if this is an identity map.
IsNull()
Returns true if this is a null mapping.
IsSparse()
Returns true if this is a sparse mapping.
Remap(source, target, elementSize, defaultValue)
Typed remapping of data in an arbitrary, stl-like container.
RemapTransforms(source, target, elementSize)
Convenience method for the common task of remapping transform arrays.
IsIdentity() → bool
Returns true if this is an identity map.
The source and target orders of an identity map are identical.
IsNull() → bool
Returns true if this is a null mapping.
No source elements of a null map are mapped to the target.
IsSparse() → bool
Returns true if this is a sparse mapping.
A sparse mapping means that not all target values will be overridden
by source values, when mapped with Remap().
Remap(source, target, elementSize, defaultValue) → bool
Typed remapping of data in an arbitrary, stl-like container.
The source array provides a run of elementSize for each path
in the em sourceOrder. These elements are remapped and copied over
the target array. Prior to remapping, the target array is
resized to the size of the em targetOrder (as given at mapper
construction time) multiplied by the elementSize . New element
created in the array are initialized to defaultValue , if
provided.
Parameters
source (Container) –
target (Container) –
elementSize (int) –
defaultValue (Container.value_type) –
Remap(source, target, elementSize, defaultValue) -> bool
Type-erased remapping of data from source into target .
The source array provides a run of elementSize elements for
each path in the em sourceOrder. These elements are remapped and
copied over the target array. Prior to remapping, the target
array is resized to the size of the em targetOrder (as given at
mapper construction time) multiplied by the elementSize . New
elements created in the array are initialized to defaultValue , if
provided. Remapping is supported for registered Sdf array value types
only.
Parameters
source (VtValue) –
target (VtValue) –
elementSize (int) –
defaultValue (VtValue) –
RemapTransforms(source, target, elementSize) → bool
Convenience method for the common task of remapping transform arrays.
This performs the same operation as Remap(), but sets the matrix
identity as the default value.
Parameters
source (VtArray[Matrix4]) –
target (VtArray[Matrix4]) –
elementSize (int) –
class pxr.UsdSkel.AnimQuery
Class providing efficient queries of primitives that provide skel
animation.
Methods:
BlendShapeWeightsMightBeTimeVarying()
Return true if it possible, but not certain, that the blend shape weights computed through this animation query change over time, false otherwise.
ComputeBlendShapeWeights(weights, time)
param weights
ComputeJointLocalTransformComponents(...)
Compute translation,rotation,scale components of the joint transforms in joint-local space.
ComputeJointLocalTransforms(xforms, time)
Compute joint transforms in joint-local space.
GetBlendShapeOrder()
Returns an array of tokens describing the ordering of blend shape channels in the animation.
GetBlendShapeWeightTimeSamples(attrs)
Get the time samples at which values contributing to blend shape weights have been set.
GetBlendShapeWeightTimeSamplesInInterval(...)
Get the time samples at which values contributing to blend shape weights are set, over interval .
GetJointOrder()
Returns an array of tokens describing the ordering of joints in the animation.
GetJointTransformTimeSamples(times)
Get the time samples at which values contributing to joint transforms are set.
GetJointTransformTimeSamplesInInterval(...)
Get the time samples at which values contributing to joint transforms are set, over interval .
GetPrim()
Return the primitive this anim query reads from.
JointTransformsMightBeTimeVarying()
Return true if it possible, but not certain, that joint transforms computed through this animation query change over time, false otherwise.
BlendShapeWeightsMightBeTimeVarying() → bool
Return true if it possible, but not certain, that the blend shape
weights computed through this animation query change over time, false
otherwise.
UsdAttribute::ValueMightBeTimeVayring
ComputeBlendShapeWeights(weights, time) → bool
Parameters
weights (FloatArray) –
time (TimeCode) –
ComputeJointLocalTransformComponents(translations, rotations, scales, time) → bool
Compute translation,rotation,scale components of the joint transforms
in joint-local space.
This is provided to facilitate direct streaming of animation data in a
form that can efficiently be processed for animation blending.
Parameters
translations (Vec3fArray) –
rotations (QuatfArray) –
scales (Vec3hArray) –
time (TimeCode) –
ComputeJointLocalTransforms(xforms, time) → bool
Compute joint transforms in joint-local space.
Transforms are returned in the order specified by the joint ordering
of the animation primitive itself.
Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
GetBlendShapeOrder() → TokenArray
Returns an array of tokens describing the ordering of blend shape
channels in the animation.
GetBlendShapeWeightTimeSamples(attrs) → bool
Get the time samples at which values contributing to blend shape
weights have been set.
UsdAttribute::GetTimeSamples
Parameters
attrs (list[float]) –
GetBlendShapeWeightTimeSamplesInInterval(interval, times) → bool
Get the time samples at which values contributing to blend shape
weights are set, over interval .
UsdAttribute::GetTimeSamplesInInterval
Parameters
interval (Interval) –
times (list[float]) –
GetJointOrder() → TokenArray
Returns an array of tokens describing the ordering of joints in the
animation.
UsdSkelSkeleton::GetJointOrder
GetJointTransformTimeSamples(times) → bool
Get the time samples at which values contributing to joint transforms
are set.
This only computes the time samples for sampling transforms in joint-
local space, and does not include time samples affecting the root
transformation.
UsdAttribute::GetTimeSamples
Parameters
times (list[float]) –
GetJointTransformTimeSamplesInInterval(interval, times) → bool
Get the time samples at which values contributing to joint transforms
are set, over interval .
This only computes the time samples for sampling transforms in joint-
local space, and does not include time samples affecting the root
transformation.
UsdAttribute::GetTimeSamplesInInterval
Parameters
interval (Interval) –
times (list[float]) –
GetPrim() → Prim
Return the primitive this anim query reads from.
JointTransformsMightBeTimeVarying() → bool
Return true if it possible, but not certain, that joint transforms
computed through this animation query change over time, false
otherwise.
UsdAttribute::ValueMightBeTimeVayring
class pxr.UsdSkel.Animation
Describes a skel animation, where joint animation is stored in a
vectorized form.
See the extended Skel Animation documentation for more information.
Methods:
CreateBlendShapeWeightsAttr(defaultValue, ...)
See GetBlendShapeWeightsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateBlendShapesAttr(defaultValue, ...)
See GetBlendShapesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointsAttr(defaultValue, writeSparsely)
See GetJointsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateRotationsAttr(defaultValue, writeSparsely)
See GetRotationsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateScalesAttr(defaultValue, writeSparsely)
See GetScalesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateTranslationsAttr(defaultValue, ...)
See GetTranslationsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> Animation
Get
classmethod Get(stage, path) -> Animation
GetBlendShapeWeightsAttr()
Array of weight values for each blend shape.
GetBlendShapesAttr()
Array of tokens identifying which blend shapes this animation's data applies to.
GetJointsAttr()
Array of tokens identifying which joints this animation's data applies to.
GetRotationsAttr()
Joint-local unit quaternion rotations of all affected joints, in 32-bit precision.
GetScalesAttr()
Joint-local scales of all affected joints, in 16 bit precision.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetTransforms(xforms, time)
Convenience method for querying resolved transforms at time .
GetTranslationsAttr()
Joint-local translations of all affected joints.
SetTransforms(xforms, time)
Convenience method for setting an array of transforms.
CreateBlendShapeWeightsAttr(defaultValue, writeSparsely) → Attribute
See GetBlendShapeWeightsAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateBlendShapesAttr(defaultValue, writeSparsely) → Attribute
See GetBlendShapesAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateJointsAttr(defaultValue, writeSparsely) → Attribute
See GetJointsAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateRotationsAttr(defaultValue, writeSparsely) → Attribute
See GetRotationsAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateScalesAttr(defaultValue, writeSparsely) → Attribute
See GetScalesAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateTranslationsAttr(defaultValue, writeSparsely) → Attribute
See GetTranslationsAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
static Define()
classmethod Define(stage, path) -> Animation
Attempt to ensure a UsdPrim adhering to this schema at path is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at path is already defined on
this stage, return that prim. Otherwise author an SdfPrimSpec with
specifier == SdfSpecifierDef and this schema’s prim type name for
the prim at path at the current EditTarget. Author SdfPrimSpec s
with specifier == SdfSpecifierDef and empty typeName at the
current EditTarget for any nonexistent, or existing but not Defined
ancestors.
The given path must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case path cannot map to the current UsdEditTarget ‘s
namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
stage (Stage) –
path (Path) –
static Get()
classmethod Get(stage, path) -> Animation
Return a UsdSkelAnimation holding the prim adhering to this schema at
path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdSkelAnimation(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetBlendShapeWeightsAttr() → Attribute
Array of weight values for each blend shape.
Each weight value is associated with the corresponding blend shape
identified within the blendShapes token array, and therefore must
have the same length as *blendShapes.
Declaration
float[] blendShapeWeights
C++ Type
VtArray<float>
Usd Type
SdfValueTypeNames->FloatArray
GetBlendShapesAttr() → Attribute
Array of tokens identifying which blend shapes this animation’s data
applies to.
The tokens for blendShapes correspond to the tokens set in the
skel:blendShapes binding property of the UsdSkelBindingAPI.
Declaration
uniform token[] blendShapes
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
GetJointsAttr() → Attribute
Array of tokens identifying which joints this animation’s data applies
to.
The tokens for joints correspond to the tokens of Skeleton primitives.
The order of the joints as listed here may vary from the order of
joints on the Skeleton itself.
Declaration
uniform token[] joints
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
GetRotationsAttr() → Attribute
Joint-local unit quaternion rotations of all affected joints, in
32-bit precision.
Array length should match the size of the joints attribute.
Declaration
quatf[] rotations
C++ Type
VtArray<GfQuatf>
Usd Type
SdfValueTypeNames->QuatfArray
GetScalesAttr() → Attribute
Joint-local scales of all affected joints, in 16 bit precision.
Array length should match the size of the joints attribute.
Declaration
half3[] scales
C++ Type
VtArray<GfVec3h>
Usd Type
SdfValueTypeNames->Half3Array
static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
includeInherited (bool) –
GetTransforms(xforms, time) → bool
Convenience method for querying resolved transforms at time .
Note that it is more efficient to query transforms through
UsdSkelAnimQuery or UsdSkelSkeletonQuery.
Parameters
xforms (Matrix4dArray) –
time (TimeCode) –
GetTranslationsAttr() → Attribute
Joint-local translations of all affected joints.
Array length should match the size of the joints attribute.
Declaration
float3[] translations
C++ Type
VtArray<GfVec3f>
Usd Type
SdfValueTypeNames->Float3Array
SetTransforms(xforms, time) → bool
Convenience method for setting an array of transforms.
The given transforms must be orthogonal.
Parameters
xforms (Matrix4dArray) –
time (TimeCode) –
class pxr.UsdSkel.Binding
Helper object that describes the binding of a skeleton to a set of
skinnable objects. The set of skinnable objects is given as
UsdSkelSkinningQuery prims, which can be used both to identify the
skinned prim as well compute skinning properties of the prim.
Methods:
GetSkeleton()
Returns the bound skeleton.
GetSkinningTargets()
Returns the set skinning targets.
GetSkeleton() → Skeleton
Returns the bound skeleton.
GetSkinningTargets() → VtArray[SkinningQuery]
Returns the set skinning targets.
class pxr.UsdSkel.BindingAPI
Provides API for authoring and extracting all the skinning-related
data that lives in the”geometry hierarchy”of prims and models that
want to be skeletally deformed.
See the extended UsdSkelBindingAPI schema documentation for more about
bindings and how they apply in a scene graph.
Methods:
Apply
classmethod Apply(prim) -> BindingAPI
CanApply
classmethod CanApply(prim, whyNot) -> bool
CreateAnimationSourceRel()
See GetAnimationSourceRel() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateBlendShapeTargetsRel()
See GetBlendShapeTargetsRel() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateBlendShapesAttr(defaultValue, ...)
See GetBlendShapesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateGeomBindTransformAttr(defaultValue, ...)
See GetGeomBindTransformAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointIndicesAttr(defaultValue, ...)
See GetJointIndicesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointIndicesPrimvar(constant, elementSize)
Convenience function to create the jointIndices primvar, optionally specifying elementSize.
CreateJointWeightsAttr(defaultValue, ...)
See GetJointWeightsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointWeightsPrimvar(constant, elementSize)
Convenience function to create the jointWeights primvar, optionally specifying elementSize.
CreateJointsAttr(defaultValue, writeSparsely)
See GetJointsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateSkeletonRel()
See GetSkeletonRel() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateSkinningBlendWeightPrimvar
CreateSkinningBlendWeightsAttr(defaultValue, ...)
See GetSkinningBlendWeightsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateSkinningMethodAttr(defaultValue, ...)
See GetSkinningMethodAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Get
classmethod Get(stage, path) -> BindingAPI
GetAnimationSource(prim)
Convenience method to query the animation source bound on this prim.
GetAnimationSourceRel()
Animation source to be bound to Skeleton primitives at or beneath the location at which this property is defined.
GetBlendShapeTargetsRel()
Ordered list of all target blend shapes.
GetBlendShapesAttr()
An array of tokens defining the order onto which blend shape weights from an animation source map onto the skel:blendShapeTargets rel of a binding site.
GetGeomBindTransformAttr()
Encodes the bind-time world space transforms of the prim.
GetInheritedAnimationSource()
Returns the animation source bound at this prim, or one of its ancestors.
GetInheritedSkeleton()
Returns the skeleton bound at this prim, or one of its ancestors.
GetJointIndicesAttr()
Indices into the joints attribute of the closest (in namespace) bound Skeleton that affect each point of a PointBased gprim.
GetJointIndicesPrimvar()
Convenience function to get the jointIndices attribute as a primvar.
GetJointWeightsAttr()
Weights for the joints that affect each point of a PointBased gprim.
GetJointWeightsPrimvar()
Convenience function to get the jointWeights attribute as a primvar.
GetJointsAttr()
An (optional) array of tokens defining the list of joints to which jointIndices apply.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
GetSkeleton(skel)
Convenience method to query the Skeleton bound on this prim.
GetSkeletonRel()
Skeleton to be bound to this prim and its descendents that possess a mapping and weighting to the joints of the identified Skeleton.
GetSkinningBlendWeightPrimvar
GetSkinningBlendWeightsAttr()
Weights for weighted blend skinning method.
GetSkinningMethodAttr()
Different calculation method for skinning.
SetRigidJointInfluence(jointIndex, weight)
Convenience method for defining joints influences that make a primitive rigidly deformed by a single joint.
ValidateJointIndices
classmethod ValidateJointIndices(indices, numJoints, reason) -> bool
static Apply()
classmethod Apply(prim) -> BindingAPI
Applies this single-apply API schema to the given prim .
This information is stored by adding”SkelBindingAPI”to the token-
valued, listOp metadata apiSchemas on the prim.
A valid UsdSkelBindingAPI object is returned upon success. An invalid
(or empty) UsdSkelBindingAPI object is returned upon failure. See
UsdPrim::ApplyAPI() for conditions resulting in failure.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
prim (Prim) –
static CanApply()
classmethod CanApply(prim, whyNot) -> bool
Returns true if this single-apply API schema can be applied to the
given prim .
If this schema can not be a applied to the prim, this returns false
and, if provided, populates whyNot with the reason it can not be
applied.
Note that if CanApply returns false, that does not necessarily imply
that calling Apply will fail. Callers are expected to call CanApply
before calling Apply if they want to ensure that it is valid to apply
a schema.
UsdPrim::GetAppliedSchemas()
UsdPrim::HasAPI()
UsdPrim::CanApplyAPI()
UsdPrim::ApplyAPI()
UsdPrim::RemoveAPI()
Parameters
prim (Prim) –
whyNot (str) –
CreateAnimationSourceRel() → Relationship
See GetAnimationSourceRel() , and also Create vs Get Property Methods
for when to use Get vs Create.
CreateBlendShapeTargetsRel() → Relationship
See GetBlendShapeTargetsRel() , and also Create vs Get Property
Methods for when to use Get vs Create.
CreateBlendShapesAttr(defaultValue, writeSparsely) → Attribute
See GetBlendShapesAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateGeomBindTransformAttr(defaultValue, writeSparsely) → Attribute
See GetGeomBindTransformAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateJointIndicesAttr(defaultValue, writeSparsely) → Attribute
See GetJointIndicesAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateJointIndicesPrimvar(constant, elementSize) → Primvar
Convenience function to create the jointIndices primvar, optionally
specifying elementSize.
If constant is true, the resulting primvar is configured
with’constant’interpolation, and describes a rigid deformation.
Otherwise, the primvar is configured with’vertex’interpolation, and
describes joint influences that vary per point.
CreateJointIndicesAttr() , GetJointIndicesPrimvar()
Parameters
constant (bool) –
elementSize (int) –
CreateJointWeightsAttr(defaultValue, writeSparsely) → Attribute
See GetJointWeightsAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateJointWeightsPrimvar(constant, elementSize) → Primvar
Convenience function to create the jointWeights primvar, optionally
specifying elementSize.
If constant is true, the resulting primvar is configured
with’constant’interpolation, and describes a rigid deformation.
Otherwise, the primvar is configured with’vertex’interpolation, and
describes joint influences that vary per point.
CreateJointWeightsAttr() , GetJointWeightsPrimvar()
Parameters
constant (bool) –
elementSize (int) –
CreateJointsAttr(defaultValue, writeSparsely) → Attribute
See GetJointsAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateSkeletonRel() → Relationship
See GetSkeletonRel() , and also Create vs Get Property Methods for
when to use Get vs Create.
CreateSkinningBlendWeightPrimvar()
CreateSkinningBlendWeightsAttr(defaultValue, writeSparsely) → Attribute
See GetSkinningBlendWeightsAttr() , and also Create vs Get Property
Methods for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateSkinningMethodAttr(defaultValue, writeSparsely) → Attribute
See GetSkinningMethodAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
static Get()
classmethod Get(stage, path) -> BindingAPI
Return a UsdSkelBindingAPI holding the prim adhering to this schema at
path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdSkelBindingAPI(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetAnimationSource(prim) → bool
Convenience method to query the animation source bound on this prim.
Returns true if an animation source binding is defined, and sets
prim to the target prim. The resulting primitive may still be
invalid, if the prim has been explicitly unbound.
This does not resolved inherited animation source bindings.
Parameters
prim (Prim) –
GetAnimationSourceRel() → Relationship
Animation source to be bound to Skeleton primitives at or beneath the
location at which this property is defined.
GetBlendShapeTargetsRel() → Relationship
Ordered list of all target blend shapes.
This property is not inherited hierarchically, and is expected to be
authored directly on the skinnable primitive to which the the blend
shapes apply.
GetBlendShapesAttr() → Attribute
An array of tokens defining the order onto which blend shape weights
from an animation source map onto the skel:blendShapeTargets rel of
a binding site.
If authored, the number of elements must be equal to the number of
targets in the blendShapeTargets rel. This property is not inherited
hierarchically, and is expected to be authored directly on the
skinnable primitive to which the blend shapes apply.
Declaration
uniform token[] skel:blendShapes
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
GetGeomBindTransformAttr() → Attribute
Encodes the bind-time world space transforms of the prim.
If the transform is identical for a group of gprims that share a
common ancestor, the transform may be authored on the ancestor,
to”inherit”down to all the leaf gprims. If this transform is unset, an
identity transform is used instead.
Declaration
matrix4d primvars:skel:geomBindTransform
C++ Type
GfMatrix4d
Usd Type
SdfValueTypeNames->Matrix4d
GetInheritedAnimationSource() → Prim
Returns the animation source bound at this prim, or one of its
ancestors.
GetInheritedSkeleton() → Skeleton
Returns the skeleton bound at this prim, or one of its ancestors.
GetJointIndicesAttr() → Attribute
Indices into the joints attribute of the closest (in namespace)
bound Skeleton that affect each point of a PointBased gprim.
The primvar can have either constant or vertex interpolation. This
primvar’s elementSize will determine how many joint influences apply
to each point. Indices must point be valid. Null influences should be
defined by setting values in jointWeights to zero. See UsdGeomPrimvar
for more information on interpolation and elementSize.
Declaration
int[] primvars:skel:jointIndices
C++ Type
VtArray<int>
Usd Type
SdfValueTypeNames->IntArray
GetJointIndicesPrimvar() → Primvar
Convenience function to get the jointIndices attribute as a primvar.
GetJointIndicesAttr, GetInheritedJointWeightsPrimvar
GetJointWeightsAttr() → Attribute
Weights for the joints that affect each point of a PointBased gprim.
The primvar can have either constant or vertex interpolation. This
primvar’s elementSize will determine how many joints influences
apply to each point. The length, interpolation, and elementSize of
jointWeights must match that of jointIndices. See UsdGeomPrimvar
for more information on interpolation and elementSize.
Declaration
float[] primvars:skel:jointWeights
C++ Type
VtArray<float>
Usd Type
SdfValueTypeNames->FloatArray
GetJointWeightsPrimvar() → Primvar
Convenience function to get the jointWeights attribute as a primvar.
GetJointWeightsAttr, GetInheritedJointWeightsPrimvar
GetJointsAttr() → Attribute
An (optional) array of tokens defining the list of joints to which
jointIndices apply.
If not defined, jointIndices applies to the ordered list of joints
defined in the bound Skeleton’s joints attribute. If undefined on a
primitive, the primitive inherits the value of the nearest ancestor
prim, if any.
Declaration
uniform token[] skel:joints
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
includeInherited (bool) –
GetSkeleton(skel) → bool
Convenience method to query the Skeleton bound on this prim.
Returns true if a Skeleton binding is defined, and sets skel to
the target skel. The resulting Skeleton may still be invalid, if the
Skeleton has been explicitly unbound.
This does not resolved inherited skeleton bindings.
Parameters
skel (Skeleton) –
GetSkeletonRel() → Relationship
Skeleton to be bound to this prim and its descendents that possess a
mapping and weighting to the joints of the identified Skeleton.
GetSkinningBlendWeightPrimvar()
GetSkinningBlendWeightsAttr() → Attribute
Weights for weighted blend skinning method.
The primvar can have either constant or vertex interpolation.
Constant interpolation means every vertex share the same single blend
weight. Vertex interpolation means every vertex has their own blend
weight. The element size should match the vertices count in this case.
C++ Type: VtArray<float> Usd Type: SdfValueTypeNames->FloatArray
Variability: SdfVariabilityUniform Fallback Value: No Fallback
GetSkinningMethodAttr() → Attribute
Different calculation method for skinning.
LBS, DQ, and blendWeight
C++ Type: TfToken Usd Type: SdfValueTypeNames->Token Variability:
SdfVariabilityUniform Fallback Value: ClassicLinear Allowed Values :
[ClassicLinear, DualQuaternion, WeightedBlend]
SetRigidJointInfluence(jointIndex, weight) → bool
Convenience method for defining joints influences that make a
primitive rigidly deformed by a single joint.
Parameters
jointIndex (int) –
weight (float) –
static ValidateJointIndices()
classmethod ValidateJointIndices(indices, numJoints, reason) -> bool
Validate an array of joint indices.
This ensures that all indices are the in the range [0, numJoints).
Returns true if the indices are valid, or false otherwise. If invalid
and reason is non-null, an error message describing the first
validation error will be set.
Parameters
indices (TfSpan[int]) –
numJoints (int) –
reason (str) –
class pxr.UsdSkel.BlendShape
Describes a target blend shape, possibly containing inbetween shapes.
See the extended Blend Shape Schema documentation for information.
Methods:
CreateInbetween(name)
Author scene description to create an attribute on this prim that will be recognized as an Inbetween (i.e.
CreateNormalOffsetsAttr(defaultValue, ...)
See GetNormalOffsetsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateOffsetsAttr(defaultValue, writeSparsely)
See GetOffsetsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreatePointIndicesAttr(defaultValue, ...)
See GetPointIndicesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> BlendShape
Get
classmethod Get(stage, path) -> BlendShape
GetAuthoredInbetweens()
Like GetInbetweens() , but exclude inbetwens that have no authored scene / description.
GetInbetween(name)
Return the Inbetween corresponding to the attribute named name , which will be valid if an Inbetween attribute definition already exists.
GetInbetweens()
Return valid UsdSkelInbetweenShape objects for all defined Inbetweens on this prim.
GetNormalOffsetsAttr()
Required property.
GetOffsetsAttr()
Required property.
GetPointIndicesAttr()
Optional property.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
HasInbetween(name)
Return true if there is a defined Inbetween named name on this prim.
ValidatePointIndices
classmethod ValidatePointIndices(indices, numPoints, reason) -> bool
CreateInbetween(name) → InbetweenShape
Author scene description to create an attribute on this prim that will
be recognized as an Inbetween (i.e.
will present as a valid UsdSkelInbetweenShape).
The name of the created attribute or may or may not be the specified
attrName , due to the possible need to apply property namespacing.
Creation may fail and return an invalid Inbetwen if attrName
contains a reserved keyword.
an invalid UsdSkelInbetweenShape if we failed to create a valid
attribute, a valid UsdSkelInbetweenShape otherwise. It is not an error
to create over an existing, compatible attribute.
UsdSkelInbetweenShape::IsInbetween()
Parameters
name (str) –
CreateNormalOffsetsAttr(defaultValue, writeSparsely) → Attribute
See GetNormalOffsetsAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateOffsetsAttr(defaultValue, writeSparsely) → Attribute
See GetOffsetsAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreatePointIndicesAttr(defaultValue, writeSparsely) → Attribute
See GetPointIndicesAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
static Define()
classmethod Define(stage, path) -> BlendShape
Attempt to ensure a UsdPrim adhering to this schema at path is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at path is already defined on
this stage, return that prim. Otherwise author an SdfPrimSpec with
specifier == SdfSpecifierDef and this schema’s prim type name for
the prim at path at the current EditTarget. Author SdfPrimSpec s
with specifier == SdfSpecifierDef and empty typeName at the
current EditTarget for any nonexistent, or existing but not Defined
ancestors.
The given path must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case path cannot map to the current UsdEditTarget ‘s
namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
stage (Stage) –
path (Path) –
static Get()
classmethod Get(stage, path) -> BlendShape
Return a UsdSkelBlendShape holding the prim adhering to this schema at
path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdSkelBlendShape(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetAuthoredInbetweens() → list[InbetweenShape]
Like GetInbetweens() , but exclude inbetwens that have no authored
scene / description.
GetInbetween(name) → InbetweenShape
Return the Inbetween corresponding to the attribute named name ,
which will be valid if an Inbetween attribute definition already
exists.
Name lookup will account for Inbetween namespacing, which means that
this method will succeed in some cases where UsdSkelInbetweenShape
(prim->GetAttribute(name)) will not, unless name has the proper
namespace prefix.
HasInbetween()
Parameters
name (str) –
GetInbetweens() → list[InbetweenShape]
Return valid UsdSkelInbetweenShape objects for all defined Inbetweens
on this prim.
GetNormalOffsetsAttr() → Attribute
Required property.
Normal offsets which, when added to the base pose, provides the
normals of the target shape.
Declaration
uniform vector3f[] normalOffsets
C++ Type
VtArray<GfVec3f>
Usd Type
SdfValueTypeNames->Vector3fArray
Variability
SdfVariabilityUniform
GetOffsetsAttr() → Attribute
Required property.
Position offsets which, when added to the base pose, provides the
target shape.
Declaration
uniform vector3f[] offsets
C++ Type
VtArray<GfVec3f>
Usd Type
SdfValueTypeNames->Vector3fArray
Variability
SdfVariabilityUniform
GetPointIndicesAttr() → Attribute
Optional property.
Indices into the original mesh that correspond to the values in
offsets and of any inbetween shapes. If authored, the number of
elements must be equal to the number of elements in the offsets
array.
Declaration
uniform int[] pointIndices
C++ Type
VtArray<int>
Usd Type
SdfValueTypeNames->IntArray
Variability
SdfVariabilityUniform
static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
includeInherited (bool) –
HasInbetween(name) → bool
Return true if there is a defined Inbetween named name on this
prim.
Name lookup will account for Inbetween namespacing.
GetInbetween()
Parameters
name (str) –
static ValidatePointIndices()
classmethod ValidatePointIndices(indices, numPoints, reason) -> bool
Validates a set of point indices for a given point count.
This ensures that all point indices are in the range [0, numPoints).
Returns true if the indices are valid, or false otherwise. If invalid
and reason is non-null, an error message describing the first
validation error will be set.
Parameters
indices (TfSpan[int]) –
numPoints (int) –
reason (str) –
class pxr.UsdSkel.BlendShapeQuery
Helper class used to resolve blend shape weights, including
inbetweens.
Methods:
ComputeBlendShapePointIndices()
Compute an array holding the point indices of all shapes.
ComputeDeformedPoints(subShapeWeights, ...)
Deform points using the resolved sub-shapes given by subShapeWeights , blendShapeIndices and subShapeIndices .
ComputeSubShapePointOffsets()
Compute an array holding the point offsets of all sub-shapes.
ComputeSubShapeWeights(weights, ...)
Compute the resolved weights for all sub-shapes bound to this prim.
GetBlendShape(blendShapeIndex)
Returns the blend shape corresponding to blendShapeIndex .
GetBlendShapeIndex(subShapeIndex)
Returns the blend shape index corresponding to the i'th sub-shape.
GetInbetween(subShapeIndex)
Returns the inbetween shape corresponding to sub-shape i , if any.
GetNumBlendShapes()
GetNumSubShapes()
ComputeBlendShapePointIndices() → list[IntArray]
Compute an array holding the point indices of all shapes.
This is indexed by the blendShapeIndices returned by
ComputeSubShapes(). Since the pointIndices property of blend shapes
is optional, some of the arrays may be empty.
ComputeDeformedPoints(subShapeWeights, blendShapeIndices, subShapeIndices, blendShapePointIndices, subShapePointOffsets, points) → bool
Deform points using the resolved sub-shapes given by
subShapeWeights , blendShapeIndices and subShapeIndices .
The blendShapePointIndices and blendShapePointOffsets arrays
both provide the pre-computed point offsets and indices of each sub-
shape, as computed by ComputeBlendShapePointIndices() and
ComputeSubShapePointOffsets() .
Parameters
subShapeWeights (TfSpan[float]) –
blendShapeIndices (TfSpan[unsigned]) –
subShapeIndices (TfSpan[unsigned]) –
blendShapePointIndices (list[IntArray]) –
subShapePointOffsets (list[Vec3fArray]) –
points (TfSpan[Vec3f]) –
ComputeSubShapePointOffsets() → list[Vec3fArray]
Compute an array holding the point offsets of all sub-shapes.
This includes offsets of both primary shapes those stored directly on
a BlendShape primitive as well as those of inbetween shapes. This is
indexed by the subShapeIndices returned by ComputeSubShapeWeights()
.
ComputeSubShapeWeights(weights, subShapeWeights, blendShapeIndices, subShapeIndices) → bool
Compute the resolved weights for all sub-shapes bound to this prim.
The weights values are initial weight values, ordered according to
the skel:blendShapeTargets relationship of the prim this query is
associated with. If there are any inbetween shapes, a new set of
weights is computed, providing weighting of the relevant inbetweens.
All computed arrays shared the same size. Elements of the same index
identify which sub-shape of which blend shape a given weight value is
mapped to.
Parameters
weights (TfSpan[float]) –
subShapeWeights (FloatArray) –
blendShapeIndices (UIntArray) –
subShapeIndices (UIntArray) –
GetBlendShape(blendShapeIndex) → BlendShape
Returns the blend shape corresponding to blendShapeIndex .
Parameters
blendShapeIndex (int) –
GetBlendShapeIndex(subShapeIndex) → int
Returns the blend shape index corresponding to the i'th sub-shape.
Parameters
subShapeIndex (int) –
GetInbetween(subShapeIndex) → InbetweenShape
Returns the inbetween shape corresponding to sub-shape i , if any.
Parameters
subShapeIndex (int) –
GetNumBlendShapes() → int
GetNumSubShapes() → int
class pxr.UsdSkel.Cache
Thread-safe cache for accessing query objects for evaluating skeletal
data.
This provides caching of major structural components, such as skeletal
topology. In a streaming context, this cache is intended to persist.
Methods:
Clear()
ComputeSkelBinding(skelRoot, skel, binding, ...)
Compute the bindings corresponding to a single skeleton, bound beneath skelRoot , as discovered through a traversal using predicate .
ComputeSkelBindings(skelRoot, bindings, ...)
Compute the set of skeleton bindings beneath skelRoot , as discovered through a traversal using predicate .
GetAnimQuery(anim)
Get an anim query corresponding to anim .
GetSkelQuery(skel)
Get a skel query for computing properties of skel .
GetSkinningQuery(prim)
Get a skinning query at prim .
Populate(root, predicate)
Populate the cache for the skeletal data beneath prim root , as traversed using predicate .
Clear() → None
ComputeSkelBinding(skelRoot, skel, binding, predicate) → bool
Compute the bindings corresponding to a single skeleton, bound beneath
skelRoot , as discovered through a traversal using predicate .
Skinnable prims are only discoverable by this method if Populate() has
already been called for skelRoot , with an equivalent predicate.
Parameters
skelRoot (Root) –
skel (Skeleton) –
binding (Binding) –
predicate (_PrimFlagsPredicate) –
ComputeSkelBindings(skelRoot, bindings, predicate) → bool
Compute the set of skeleton bindings beneath skelRoot , as
discovered through a traversal using predicate .
Skinnable prims are only discoverable by this method if Populate() has
already been called for skelRoot , with an equivalent predicate.
Parameters
skelRoot (Root) –
bindings (list[Binding]) –
predicate (_PrimFlagsPredicate) –
GetAnimQuery(anim) → AnimQuery
Get an anim query corresponding to anim .
This does not require Populate() to be called on the cache.
Parameters
anim (Animation) –
GetAnimQuery(prim) -> AnimQuery
This is an overloaded member function, provided for convenience. It
differs from the above function only in what argument(s) it accepts.
Deprecated
Parameters
prim (Prim) –
GetSkelQuery(skel) → SkeletonQuery
Get a skel query for computing properties of skel .
This does not require Populate() to be called on the cache.
Parameters
skel (Skeleton) –
GetSkinningQuery(prim) → SkinningQuery
Get a skinning query at prim .
Skinning queries are defined at any skinnable prims (I.e., boundable
prims with fully defined joint influences).
The caller must first Populate() the cache with the skel root
containing prim , with a predicate that will visit prim , in
order for a skinning query to be discoverable.
Parameters
prim (Prim) –
Populate(root, predicate) → bool
Populate the cache for the skeletal data beneath prim root , as
traversed using predicate .
Population resolves inherited skel bindings set using the
UsdSkelBindingAPI, making resolved bindings available through
GetSkinningQuery() , ComputeSkelBdining() and ComputeSkelBindings() .
Parameters
root (Root) –
predicate (_PrimFlagsPredicate) –
class pxr.UsdSkel.InbetweenShape
Schema wrapper for UsdAttribute for authoring and introspecting
attributes that serve as inbetween shapes of a UsdSkelBlendShape.
Inbetween shapes allow an explicit shape to be specified when the
blendshape to which it’s bound is evaluated at a certain weight. For
example, rather than performing piecewise linear interpolation between
a primary shape and the rest shape at weight 0.5, an inbetween shape
could be defined at the weight. For weight values greater than 0.5, a
shape would then be resolved by linearly interpolating between the
inbetween shape and the primary shape, while for weight values less
than or equal to 0.5, the shape is resolved by linearly interpolating
between the inbetween shape and the primary shape.
Methods:
CreateNormalOffsetsAttr(defaultValue)
Returns the existing normal offsets attribute if the shape has normal offsets, or creates a new one.
GetAttr()
Explicit UsdAttribute extractor.
GetNormalOffsets(offsets)
Get the normal offsets authored for this shape.
GetNormalOffsetsAttr()
Returns a valid normal offsets attribute if the shape has normal offsets.
GetOffsets(offsets)
Get the point offsets corresponding to this shape.
GetWeight(weight)
Return the location at which the shape is applied.
HasAuthoredWeight()
Has a weight value been explicitly authored on this shape?
IsDefined()
Return true if the wrapped UsdAttribute::IsDefined() , and in addition the attribute is identified as an Inbetween.
IsInbetween
classmethod IsInbetween(attr) -> bool
SetNormalOffsets(offsets)
Set the normal offsets authored for this shape.
SetOffsets(offsets)
Set the point offsets corresponding to this shape.
SetWeight(weight)
Set the location at which the shape is applied.
CreateNormalOffsetsAttr(defaultValue) → Attribute
Returns the existing normal offsets attribute if the shape has normal
offsets, or creates a new one.
Parameters
defaultValue (VtValue) –
GetAttr() → Attribute
Explicit UsdAttribute extractor.
GetNormalOffsets(offsets) → bool
Get the normal offsets authored for this shape.
Normal offsets are optional, and may be left unspecified.
Parameters
offsets (Vec3fArray) –
GetNormalOffsetsAttr() → Attribute
Returns a valid normal offsets attribute if the shape has normal
offsets.
Returns an invalid attribute otherwise.
GetOffsets(offsets) → bool
Get the point offsets corresponding to this shape.
Parameters
offsets (Vec3fArray) –
GetWeight(weight) → bool
Return the location at which the shape is applied.
Parameters
weight (float) –
HasAuthoredWeight() → bool
Has a weight value been explicitly authored on this shape?
GetWeight()
IsDefined() → bool
Return true if the wrapped UsdAttribute::IsDefined() , and in addition
the attribute is identified as an Inbetween.
static IsInbetween()
classmethod IsInbetween(attr) -> bool
Test whether a given UsdAttribute represents a valid Inbetween, which
implies that creating a UsdSkelInbetweenShape from the attribute will
succeed.
Succes implies that attr.IsDefined() is true.
Parameters
attr (Attribute) –
SetNormalOffsets(offsets) → bool
Set the normal offsets authored for this shape.
Parameters
offsets (Vec3fArray) –
SetOffsets(offsets) → bool
Set the point offsets corresponding to this shape.
Parameters
offsets (Vec3fArray) –
SetWeight(weight) → bool
Set the location at which the shape is applied.
Parameters
weight (float) –
class pxr.UsdSkel.PackedJointAnimation
Deprecated. Please use SkelAnimation instead.
Methods:
Define
classmethod Define(stage, path) -> PackedJointAnimation
Get
classmethod Get(stage, path) -> PackedJointAnimation
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Define()
classmethod Define(stage, path) -> PackedJointAnimation
Attempt to ensure a UsdPrim adhering to this schema at path is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at path is already defined on
this stage, return that prim. Otherwise author an SdfPrimSpec with
specifier == SdfSpecifierDef and this schema’s prim type name for
the prim at path at the current EditTarget. Author SdfPrimSpec s
with specifier == SdfSpecifierDef and empty typeName at the
current EditTarget for any nonexistent, or existing but not Defined
ancestors.
The given path must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case path cannot map to the current UsdEditTarget ‘s
namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
stage (Stage) –
path (Path) –
static Get()
classmethod Get(stage, path) -> PackedJointAnimation
Return a UsdSkelPackedJointAnimation holding the prim adhering to this
schema at path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdSkelPackedJointAnimation(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
includeInherited (bool) –
class pxr.UsdSkel.Root
Boundable prim type used to identify a scope beneath which skeletally-
posed primitives are defined.
A SkelRoot must be defined at or above a skinned primitive for any
skinning behaviors in UsdSkel.
See the extended Skel Root Schema documentation for more information.
Methods:
Define
classmethod Define(stage, path) -> Root
Find
classmethod Find(prim) -> Root
Get
classmethod Get(stage, path) -> Root
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
static Define()
classmethod Define(stage, path) -> Root
Attempt to ensure a UsdPrim adhering to this schema at path is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at path is already defined on
this stage, return that prim. Otherwise author an SdfPrimSpec with
specifier == SdfSpecifierDef and this schema’s prim type name for
the prim at path at the current EditTarget. Author SdfPrimSpec s
with specifier == SdfSpecifierDef and empty typeName at the
current EditTarget for any nonexistent, or existing but not Defined
ancestors.
The given path must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case path cannot map to the current UsdEditTarget ‘s
namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
stage (Stage) –
path (Path) –
static Find()
classmethod Find(prim) -> Root
Returns the skel root at or above prim , or an invalid schema
object if no ancestor prim is defined as a skel root.
Parameters
prim (Prim) –
static Get()
classmethod Get(stage, path) -> Root
Return a UsdSkelRoot holding the prim adhering to this schema at
path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdSkelRoot(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
includeInherited (bool) –
class pxr.UsdSkel.Skeleton
Describes a skeleton.
See the extended Skeleton Schema documentation for more information.
Methods:
CreateBindTransformsAttr(defaultValue, ...)
See GetBindTransformsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointNamesAttr(defaultValue, writeSparsely)
See GetJointNamesAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateJointsAttr(defaultValue, writeSparsely)
See GetJointsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
CreateRestTransformsAttr(defaultValue, ...)
See GetRestTransformsAttr() , and also Create vs Get Property Methods for when to use Get vs Create.
Define
classmethod Define(stage, path) -> Skeleton
Get
classmethod Get(stage, path) -> Skeleton
GetBindTransformsAttr()
Specifies the bind-pose transforms of each joint in world space, in the ordering imposed by joints.
GetJointNamesAttr()
If authored, provides a unique name per joint.
GetJointsAttr()
An array of path tokens identifying the set of joints that make up the skeleton, and their order.
GetRestTransformsAttr()
Specifies the rest-pose transforms of each joint in local space, in the ordering imposed by joints.
GetSchemaAttributeNames
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
CreateBindTransformsAttr(defaultValue, writeSparsely) → Attribute
See GetBindTransformsAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateJointNamesAttr(defaultValue, writeSparsely) → Attribute
See GetJointNamesAttr() , and also Create vs Get Property Methods for
when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateJointsAttr(defaultValue, writeSparsely) → Attribute
See GetJointsAttr() , and also Create vs Get Property Methods for when
to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
CreateRestTransformsAttr(defaultValue, writeSparsely) → Attribute
See GetRestTransformsAttr() , and also Create vs Get Property Methods
for when to use Get vs Create.
If specified, author defaultValue as the attribute’s default,
sparsely (when it makes sense to do so) if writeSparsely is
true - the default for writeSparsely is false .
Parameters
defaultValue (VtValue) –
writeSparsely (bool) –
static Define()
classmethod Define(stage, path) -> Skeleton
Attempt to ensure a UsdPrim adhering to this schema at path is
defined (according to UsdPrim::IsDefined() ) on this stage.
If a prim adhering to this schema at path is already defined on
this stage, return that prim. Otherwise author an SdfPrimSpec with
specifier == SdfSpecifierDef and this schema’s prim type name for
the prim at path at the current EditTarget. Author SdfPrimSpec s
with specifier == SdfSpecifierDef and empty typeName at the
current EditTarget for any nonexistent, or existing but not Defined
ancestors.
The given path must be an absolute prim path that does not contain
any variant selections.
If it is impossible to author any of the necessary PrimSpecs, (for
example, in case path cannot map to the current UsdEditTarget ‘s
namespace) issue an error and return an invalid UsdPrim.
Note that this method may return a defined prim whose typeName does
not specify this schema class, in case a stronger typeName opinion
overrides the opinion at the current EditTarget.
Parameters
stage (Stage) –
path (Path) –
static Get()
classmethod Get(stage, path) -> Skeleton
Return a UsdSkelSkeleton holding the prim adhering to this schema at
path on stage .
If no prim exists at path on stage , or if the prim at that
path does not adhere to this schema, return an invalid schema object.
This is shorthand for the following:
UsdSkelSkeleton(stage->GetPrimAtPath(path));
Parameters
stage (Stage) –
path (Path) –
GetBindTransformsAttr() → Attribute
Specifies the bind-pose transforms of each joint in world space,
in the ordering imposed by joints.
Declaration
uniform matrix4d[] bindTransforms
C++ Type
VtArray<GfMatrix4d>
Usd Type
SdfValueTypeNames->Matrix4dArray
Variability
SdfVariabilityUniform
GetJointNamesAttr() → Attribute
If authored, provides a unique name per joint.
This may be optionally set to provide better names when translating to
DCC apps that require unique joint names.
Declaration
uniform token[] jointNames
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
GetJointsAttr() → Attribute
An array of path tokens identifying the set of joints that make up the
skeleton, and their order.
Each token in the array must be valid when parsed as an SdfPath. The
parent-child relationships of the corresponding paths determine the
parent-child relationships of each joint. It is not required that the
name at the end of each path be unique, but rather only that the paths
themselves be unique.
Declaration
uniform token[] joints
C++ Type
VtArray<TfToken>
Usd Type
SdfValueTypeNames->TokenArray
Variability
SdfVariabilityUniform
GetRestTransformsAttr() → Attribute
Specifies the rest-pose transforms of each joint in local space,
in the ordering imposed by joints.
This provides fallback values for joint transforms when a Skeleton
either has no bound animation source, or when that animation source
only contains animation for a subset of a Skeleton’s joints.
Declaration
uniform matrix4d[] restTransforms
C++ Type
VtArray<GfMatrix4d>
Usd Type
SdfValueTypeNames->Matrix4dArray
Variability
SdfVariabilityUniform
static GetSchemaAttributeNames()
classmethod GetSchemaAttributeNames(includeInherited) -> list[TfToken]
Return a vector of names of all pre-declared attributes for this
schema class and all its ancestor classes.
Does not include attributes that may be authored by custom/extended
methods of the schemas involved.
Parameters
includeInherited (bool) –
class pxr.UsdSkel.SkeletonQuery
Primary interface to reading bound skeleton data. This is used to
query properties such as resolved transforms and animation bindings,
as bound through the UsdSkelBindingAPI.
A UsdSkelSkeletonQuery can not be constructed directly, and instead
must be constructed through a UsdSkelCache instance. This is done as
follows:
// Global cache, intended to persist.
UsdSkelCache skelCache;
// Populate the cache for a skel root.
skelCache.Populate(UsdSkelRoot(skelRootPrim));
if (UsdSkelSkeletonQuery skelQuery = skelCache.GetSkelQuery(skelPrim)) {
\.\.\.
}
Methods:
ComputeJointLocalTransforms(xforms, time, atRest)
Compute joint transforms in joint-local space, at time .
ComputeJointRestRelativeTransforms(xforms, time)
Compute joint transforms which, when concatenated against the rest pose, produce joint transforms in joint-local space.
ComputeJointSkelTransforms(xforms, time, atRest)
Compute joint transforms in skeleton space, at time .
ComputeJointWorldTransforms(xforms, xfCache, ...)
Compute joint transforms in world space, at whatever time is configured on xfCache .
ComputeSkinningTransforms(xforms, time)
Compute transforms representing the change in transformation of a joint from its rest pose, in skeleton space.
GetAnimQuery()
Returns the animation query that provides animation for the bound skeleton instance, if any.
GetJointOrder()
Returns an array of joint paths, given as tokens, describing the order and parent-child relationships of joints in the skeleton.
GetJointWorldBindTransforms(xforms)
Returns the world space joint transforms at bind time.
GetMapper()
Returns a mapper for remapping from the bound animation, if any, to the Skeleton.
GetPrim()
Returns the underlying Skeleton primitive corresponding to the bound skeleton instance, if any.
GetSkeleton()
Returns the bound skeleton instance, if any.
GetTopology()
Returns the topology of the bound skeleton instance, if any.
HasBindPose()
Returns true if the size of the array returned by skeleton::GetBindTransformsAttr() matches the number of joints in the skeleton.
HasRestPose()
Returns true if the size of the array returned by skeleton::GetRestTransformsAttr() matches the number of joints in the skeleton.
ComputeJointLocalTransforms(xforms, time, atRest) → bool
Compute joint transforms in joint-local space, at time .
This returns transforms in joint order of the skeleton. If atRest
is false and an animation source is bound, local transforms defined by
the animation are mapped into the skeleton’s joint order. Any
transforms not defined by the animation source use the transforms from
the rest pose as a fallback value. If valid transforms cannot be
computed for the animation source, the xforms are instead set to
the rest transforms.
Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
atRest (bool) –
ComputeJointRestRelativeTransforms(xforms, time) → bool
Compute joint transforms which, when concatenated against the rest
pose, produce joint transforms in joint-local space.
More specifically, this computes restRelativeTransform in:
restRelativeTransform \* restTransform = jointLocalTransform
Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
ComputeJointSkelTransforms(xforms, time, atRest) → bool
Compute joint transforms in skeleton space, at time .
This concatenates joint transforms as computed from
ComputeJointLocalTransforms() . If atRest is true, any bound
animation source is ignored, and transforms are computed from the rest
pose. The skeleton-space transforms of the rest pose are cached
internally.
Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
atRest (bool) –
ComputeJointWorldTransforms(xforms, xfCache, atRest) → bool
Compute joint transforms in world space, at whatever time is
configured on xfCache .
This is equivalent to computing skel-space joint transforms with
CmoputeJointSkelTransforms(), and then concatenating all transforms by
the local-to-world transform of the Skeleton prim. If atRest is
true, any bound animation source is ignored, and transforms are
computed from the rest pose.
Parameters
xforms (VtArray[Matrix4]) –
xfCache (XformCache) –
atRest (bool) –
ComputeSkinningTransforms(xforms, time) → bool
Compute transforms representing the change in transformation of a
joint from its rest pose, in skeleton space.
I.e.,
inverse(bindTransform)\*jointTransform
These are the transforms usually required for skinning.
Parameters
xforms (VtArray[Matrix4]) –
time (TimeCode) –
GetAnimQuery() → AnimQuery
Returns the animation query that provides animation for the bound
skeleton instance, if any.
GetJointOrder() → TokenArray
Returns an array of joint paths, given as tokens, describing the order
and parent-child relationships of joints in the skeleton.
UsdSkelSkeleton::GetJointOrder
GetJointWorldBindTransforms(xforms) → bool
Returns the world space joint transforms at bind time.
Parameters
xforms (VtArray[Matrix4]) –
GetMapper() → AnimMapper
Returns a mapper for remapping from the bound animation, if any, to
the Skeleton.
GetPrim() → Prim
Returns the underlying Skeleton primitive corresponding to the bound
skeleton instance, if any.
GetSkeleton() → Skeleton
Returns the bound skeleton instance, if any.
GetTopology() → Topology
Returns the topology of the bound skeleton instance, if any.
HasBindPose() → bool
Returns true if the size of the array returned by
skeleton::GetBindTransformsAttr() matches the number of joints in the
skeleton.
HasRestPose() → bool
Returns true if the size of the array returned by
skeleton::GetRestTransformsAttr() matches the number of joints in the
skeleton.
class pxr.UsdSkel.SkinningQuery
Object used for querying resolved bindings for skinning.
Methods:
ComputeExtentsPadding(skelRestXforms, boundable)
Helper for computing an approximate padding for use in extents computations.
ComputeJointInfluences(indices, weights, time)
Convenience method for computing joint influences.
ComputeSkinnedPoints(xforms, points, time)
Compute skinned points using linear blend skinning.
ComputeSkinnedTransform(xforms, xform, time)
Compute a skinning transform using linear blend skinning.
ComputeVaryingJointInfluences(numPoints, ...)
Convenience method for computing joint influence, where constant influences are expanded to hold values per point.
GetBlendShapeMapper()
Return the mapper for remapping blend shapes from the order of the bound SkelAnimation to the local blend shape order of this prim.
GetBlendShapeOrder(blendShapes)
Get the blend shapes for this skinning site, if any.
GetBlendShapeTargetsRel()
GetBlendShapesAttr()
GetGeomBindTransform(time)
param time
GetGeomBindTransformAttr()
GetInterpolation()
GetJointIndicesPrimvar()
GetJointMapper()
Return a mapper for remapping from the joint order of the skeleton to the local joint order of this prim, if any.
GetJointOrder(jointOrder)
Get the custom joint order for this skinning site, if any.
GetJointWeightsPrimvar()
GetMapper()
Deprecated
GetNumInfluencesPerComponent()
Returns the number of influences encoded for each component.
GetPrim()
GetSkinningBlendWeightsPrimvar()
GetSkinningMethodAttr()
GetTimeSamples(times)
Populate times with the union of time samples for all properties that affect skinning, independent of joint transforms and any other prim-specific properties (such as points).
GetTimeSamplesInInterval(interval, times)
Populate times with the union of time samples within interval , for all properties that affect skinning, independent of joint transforms and any other prim-specific properties (such as points).
HasBlendShapes()
Returns true if there are blend shapes associated with this prim.
HasJointInfluences()
Returns true if joint influence data is associated with this prim.
IsRigidlyDeformed()
Returns true if the held prim has the same joint influences across all points, or false otherwise.
ComputeExtentsPadding(skelRestXforms, boundable) → float
Helper for computing an approximate padding for use in extents
computations.
The padding is computed as the difference between the pivots of the
skelRestXforms skeleton space joint transforms at rest and the
extents of the skinned primitive. This is intended to provide a
suitable, constant metric for padding joint extents as computed by
UsdSkelComputeJointsExtent.
Parameters
skelRestXforms (VtArray[Matrix4]) –
boundable (Boundable) –
ComputeJointInfluences(indices, weights, time) → bool
Convenience method for computing joint influences.
In addition to querying influences, this will also perform validation
of the basic form of the weight data although the array contents is
not validated.
Parameters
indices (IntArray) –
weights (FloatArray) –
time (TimeCode) –
ComputeSkinnedPoints(xforms, points, time) → bool
Compute skinned points using linear blend skinning.
Both xforms and points are given in skeleton space, using
the joint order of the bound skeleton. Joint influences and the
(optional) binding transform are computed at time time (which will
typically be unvarying).
UsdSkelSkeletonQuery::ComputeSkinningTransforms
Parameters
xforms (VtArray[Matrix4]) –
points (Vec3fArray) –
time (TimeCode) –
ComputeSkinnedTransform(xforms, xform, time) → bool
Compute a skinning transform using linear blend skinning.
The xforms are given in skeleton space, using the joint order of
the bound skeleton. Joint influences and the (optional) binding
transform are computed at time time (which will typically be
unvarying). If this skinning query holds non-constant joint
influences, no transform will be computed, and the function will
return false.
UsdSkelSkeletonQuery::ComputeSkinningTransforms
Parameters
xforms (VtArray[Matrix4]) –
xform (Matrix4) –
time (TimeCode) –
ComputeVaryingJointInfluences(numPoints, indices, weights, time) → bool
Convenience method for computing joint influence, where constant
influences are expanded to hold values per point.
In addition to querying influences, this will also perform validation
of the basic form of the weight data although the array contents is
not validated.
Parameters
numPoints (int) –
indices (IntArray) –
weights (FloatArray) –
time (TimeCode) –
GetBlendShapeMapper() → AnimMapper
Return the mapper for remapping blend shapes from the order of the
bound SkelAnimation to the local blend shape order of this prim.
Returns a null reference if the underlying prim has no blend shapes.
The mapper maps data from the order given by the blendShapes order
on the SkelAnimation to the order given by the skel:blendShapes
property, as set through the UsdSkelBindingAPI.
GetBlendShapeOrder(blendShapes) → bool
Get the blend shapes for this skinning site, if any.
Parameters
blendShapes (TokenArray) –
GetBlendShapeTargetsRel() → Relationship
GetBlendShapesAttr() → Attribute
GetGeomBindTransform(time) → Matrix4d
Parameters
time (TimeCode) –
GetGeomBindTransformAttr() → Attribute
GetInterpolation() → str
GetJointIndicesPrimvar() → Primvar
GetJointMapper() → AnimMapper
Return a mapper for remapping from the joint order of the skeleton to
the local joint order of this prim, if any.
Returns a null pointer if the prim has no custom joint orer. The
mapper maps data from the order given by the joints order on the
Skeleton to the order given by the skel:joints property, as
optionally set through the UsdSkelBindingAPI.
GetJointOrder(jointOrder) → bool
Get the custom joint order for this skinning site, if any.
Parameters
jointOrder (TokenArray) –
GetJointWeightsPrimvar() → Primvar
GetMapper() → AnimMapper
Deprecated
Use GetJointMapper.
GetNumInfluencesPerComponent() → int
Returns the number of influences encoded for each component.
If the prim defines rigid joint influences, then this returns the
number of influences that map to every point. Otherwise, this provides
the number of influences per point.
IsRigidlyDeformed
GetPrim() → Prim
GetSkinningBlendWeightsPrimvar() → Primvar
GetSkinningMethodAttr() → Attribute
GetTimeSamples(times) → bool
Populate times with the union of time samples for all properties
that affect skinning, independent of joint transforms and any other
prim-specific properties (such as points).
UsdAttribute::GetTimeSamples
Parameters
times (list[float]) –
GetTimeSamplesInInterval(interval, times) → bool
Populate times with the union of time samples within interval
, for all properties that affect skinning, independent of joint
transforms and any other prim-specific properties (such as points).
UsdAttribute::GetTimeSamplesInInterval
Parameters
interval (Interval) –
times (list[float]) –
HasBlendShapes() → bool
Returns true if there are blend shapes associated with this prim.
HasJointInfluences() → bool
Returns true if joint influence data is associated with this prim.
IsRigidlyDeformed() → bool
Returns true if the held prim has the same joint influences across all
points, or false otherwise.
class pxr.UsdSkel.Tokens
Attributes:
bindTransforms
blendShapeWeights
blendShapes
classicLinear
dualQuaternion
jointNames
joints
normalOffsets
offsets
pointIndices
primvarsSkelGeomBindTransform
primvarsSkelJointIndices
primvarsSkelJointWeights
primvarsSkelSkinningBlendWeights
restTransforms
rotations
scales
skelAnimationSource
skelBlendShapeTargets
skelBlendShapes
skelJoints
skelSkeleton
skelSkinningMethod
translations
weight
weightedBlend
bindTransforms = 'bindTransforms'
blendShapeWeights = 'blendShapeWeights'
blendShapes = 'blendShapes'
classicLinear = 'ClassicLinear'
dualQuaternion = 'DualQuaternion'
jointNames = 'jointNames'
joints = 'joints'
normalOffsets = 'normalOffsets'
offsets = 'offsets'
pointIndices = 'pointIndices'
primvarsSkelGeomBindTransform = 'primvars:skel:geomBindTransform'
primvarsSkelJointIndices = 'primvars:skel:jointIndices'
primvarsSkelJointWeights = 'primvars:skel:jointWeights'
primvarsSkelSkinningBlendWeights = 'primvars:skel:skinningBlendWeights'
restTransforms = 'restTransforms'
rotations = 'rotations'
scales = 'scales'
skelAnimationSource = 'skel:animationSource'
skelBlendShapeTargets = 'skel:blendShapeTargets'
skelBlendShapes = 'skel:blendShapes'
skelJoints = 'skel:joints'
skelSkeleton = 'skel:skeleton'
skelSkinningMethod = 'skel:skinningMethod'
translations = 'translations'
weight = 'weight'
weightedBlend = 'WeightedBlend'
class pxr.UsdSkel.Topology
Object holding information describing skeleton topology. This provides
the hierarchical information needed to reason about joint
relationships in a manner suitable to computations.
Methods:
GetNumJoints()
GetParent(index)
Returns the parent joint of the index'th joint, Returns -1 for joints with no parent (roots).
GetParentIndices()
IsRoot(index)
Returns true if the index'th joint is a root joint.
Validate(reason)
Validate the topology.
GetNumJoints() → int
GetParent(index) → int
Returns the parent joint of the index'th joint, Returns -1 for
joints with no parent (roots).
Parameters
index (int) –
GetParentIndices() → IntArray
IsRoot(index) → bool
Returns true if the index'th joint is a root joint.
Parameters
index (int) –
Validate(reason) → bool
Validate the topology.
If validation is unsuccessful, a reason why will be written to
reason , if provided.
Parameters
reason (str) –
© Copyright 2019-2023, NVIDIA.
Last updated on Nov 14, 2023.
|