|
43 | 43 |
|
44 | 44 |
|
45 | 45 | def add_markers(model): |
46 | | - """Add markers to the given model. |
| 46 | + """Add markers to the given model. |
47 | 47 |
|
48 | | - Args: |
49 | | - model: The model to add markers to. |
| 48 | + Args: |
| 49 | + model: The model to add markers to. |
50 | 50 |
|
51 | | - Returns: |
52 | | - None |
53 | | - """ |
54 | | - bodies = model.find_all("body") |
| 51 | + Returns: |
| 52 | + None |
| 53 | + """ |
| 54 | + bodies = model.find_all("body") |
55 | 55 |
|
56 | | - total_markers = 0 |
57 | | - for body in bodies: |
58 | | - for name, markers_pos in MARKERS_PER_BODY.items(): |
59 | | - if name in body.name and "anchor" not in body.name: |
60 | | - marker_idx = 0 |
61 | | - for pos in markers_pos: |
62 | | - if "_R" in body.name: |
63 | | - pos[1] *= -1 |
64 | | - body.add( |
65 | | - "site", |
66 | | - name="marker_" + body.name + "_" + str(marker_idx), |
67 | | - pos=pos, |
68 | | - dclass="marker", |
69 | | - ) |
| 56 | + total_markers = 0 |
| 57 | + for body in bodies: |
| 58 | + for name, markers_pos in MARKERS_PER_BODY.items(): |
| 59 | + if name in body.name and "anchor" not in body.name: |
| 60 | + marker_idx = 0 |
| 61 | + for pos in markers_pos: |
| 62 | + if "_R" in body.name: |
| 63 | + pos[1] *= -1 |
| 64 | + body.add( |
| 65 | + "site", |
| 66 | + name="marker_" + body.name + "_" + str(marker_idx), |
| 67 | + pos=pos, |
| 68 | + dclass="marker", |
| 69 | + ) |
70 | 70 |
|
71 | | - marker_idx += 1 |
72 | | - total_markers += 1 |
| 71 | + marker_idx += 1 |
| 72 | + total_markers += 1 |
73 | 73 |
|
74 | | - for i in range(total_markers): |
75 | | - marker_body = model.worldbody.add("body", name="marker_" + str(i), mocap=True) |
76 | | - marker_body.add("site", name="marker_" + str(i), dclass="mocap_marker") |
| 74 | + for i in range(total_markers): |
| 75 | + marker_body = model.worldbody.add( |
| 76 | + "body", name="marker_" + str(i), mocap=True) |
| 77 | + marker_body.add("site", name="marker_" + str(i), dclass="mocap_marker") |
0 commit comments