-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathbones.py
More file actions
31 lines (27 loc) · 709 Bytes
/
bones.py
File metadata and controls
31 lines (27 loc) · 709 Bytes
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
from mu import Mu
import sys
def dump_skin(obj):
smr = obj.skinned_mesh_renderer
print(smr.materials);
print(smr.bones)
print(smr.center);
print(smr.size);
print(smr.quality);
print(smr.updateWhenOffscreen);
mesh = smr.mesh
for b in mesh.boneWeights:
print(b.indices, b.weights, sum(b.weights))
def check_obj(obj):
if hasattr(obj, "skinned_mesh_renderer"):
print("skin on ", obj.transform.name)
dump_skin(obj)
for o in obj.children:
check_obj(o)
def find_skins(fname):
mu = Mu()
if not mu.read(fname):
print("could not read: " + fname)
raise
check_obj(mu.obj)
for f in sys.argv[1:]:
find_skins(f)