diff options
| author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-30 21:58:44 +0700 |
|---|---|---|
| committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2021-10-30 21:58:44 +0700 |
| commit | e6bf5c413943a443067803312cacce76463ca7d7 (patch) | |
| tree | cc80ebc93e2603835fb8b34341689ab1996ee179 /src/GameDraw.cpp | |
| parent | 2434442736a40ef449c043fb60fc6d298d65e9a6 (diff) | |
| download | blackshades-e6bf5c413943a443067803312cacce76463ca7d7.tar.gz | |
Reorder joints
The following Python script was used for data conversion:
from glob import iglob
from pprint import pprint
with open('data/joints.tsv') as f:
joint_keys = f.readline().strip()
joint_values = [line.strip().split('\t') for line in f]
mapping = {str(i): v[0] for i, v in enumerate(joint_values)}
mapping['-1'] = '-1'
with open('data/joints.tsv', 'w') as f:
print(joint_keys, file=f)
for *rest, parent in sorted(joint_values, key=lambda v: int(v[0])):
print(*rest, mapping[parent], sep='\t', file=f)
with open('data/muscles.tsv') as f:
muscle_keys = f.readline().strip()
muscle_values = [line.strip().split('\t') for line in f]
with open('data/muscles.tsv', 'w') as f:
print(muscle_keys, file=f)
for *rest, parent1, parent2 in muscle_values:
print(*rest, mapping[parent1], mapping[parent2], sep='\t', file=f)
order = [i for i, v in sorted(enumerate(joint_values),
key=lambda p: int(p[1][0]))]
for path in iglob('data/animations/*/frames/*'):
with open(path) as f:
anim_keys = f.readline().strip()
anim_values = [line.strip() for line in f]
with open(path, 'w') as f:
print(anim_keys, file=f)
for i in order: print(anim_values[i], file=f)
Diffstat (limited to 'src/GameDraw.cpp')
0 files changed, 0 insertions, 0 deletions
