|
29 | 29 | #include <momentum/io/shape/blend_shape_io.h> |
30 | 30 | #include <momentum/math/mesh.h> |
31 | 31 | #include <momentum/math/mppca.h> |
| 32 | +#include <momentum/test/character/character_helpers.h> |
32 | 33 |
|
33 | 34 | #include <pybind11/eigen.h> |
34 | 35 | #include <pybind11/numpy.h> |
@@ -2134,4 +2135,29 @@ Computes vertex normals for a triangle mesh given its positions. |
2134 | 2135 | )", |
2135 | 2136 | py::arg("vertex_positions"), |
2136 | 2137 | py::arg("triangles")); |
| 2138 | + |
| 2139 | + // createTestCharacter() |
| 2140 | + m.def( |
| 2141 | + "test_character", |
| 2142 | + &momentum::createTestCharacter<float>, |
| 2143 | + R"(Create a simple 3-joint test character. This is useful for writing confidence tests that |
| 2144 | +execute quickly and don't rely on outside files. |
| 2145 | +
|
| 2146 | +The mesh is made by a few vertices on the line segment from (1,0,0) to (1,1,0) and a few dummy |
| 2147 | +faces. The skeleton has three joints: root at (0,0,0), joint1 parented by root, at world-space |
| 2148 | +(0,1,0), and joint2 parented by joint1, at world-space (0,2,0). |
| 2149 | +The character has only one parameter limit: min-max type [-0.1, 0.1] for root. |
| 2150 | +
|
| 2151 | +:parameter numJoints: The number of joints in the resulting character. |
| 2152 | +:return: A simple character with 3 joints and 10 model parameters. |
| 2153 | + )", |
| 2154 | + py::arg("num_joints") = 3); |
| 2155 | + |
| 2156 | + // createTestPosePrior() |
| 2157 | + m.def( |
| 2158 | + "create_test_mppca", |
| 2159 | + &momentum::createDefaultPosePrior<float>, |
| 2160 | + R"(Create a pose prior that acts on the simple 3-joint test character. |
| 2161 | +
|
| 2162 | +:return: A simple pose prior.)"); |
2137 | 2163 | } |
0 commit comments