-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathiqe-merge-root.c
42 lines (34 loc) · 948 Bytes
/
iqe-merge-root.c
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
#include "iqe.c"
int
main(int argc, char **argv)
{
struct model *model;
if (argc != 2) {
fprintf(stderr, "usage: iqe-merge-root model.iqe\n");
return 1;
}
model = load_iqe_model(argv[1]);
delete_bone(model, "name");
delete_bone(model, "dummy01");
delete_bone(model, "dummy01popopo");
if (findbone(model, "bip01") > -1)
{
if (findbone(model, "unnamed") > -1)
merge_bones(model, "unnamed", "bip01");
if (findbone(model, "bip01_footsteps") > -1)
merge_bones(model, "bip01", "bip01_footsteps");
if (findbone(model, "bip01_pelvis") > -1)
merge_bones(model, "bip01", "bip01_pelvis");
delete_bone(model, "bip01");
}
if (findbone(model, "bip02") > -1)
{
if (findbone(model, "bip02_footsteps") > -1)
merge_bones(model, "bip02", "bip02_footsteps");
if (findbone(model, "bip02_pelvis") > -1)
merge_bones(model, "bip02", "bip02_pelvis");
delete_bone(model, "bip02");
}
save_iqe_model(model);
return 0;
}