This commit is contained in:
Aaron Kimbre 2022-05-20 11:52:04 -05:00
parent 7500be5d71
commit e00544c98f

View File

@ -304,14 +304,14 @@ def split_ugc(path):
for rigid in rigids:
rigids_parts[i].extend(rigid.attrib['boneRefs'].split(','))
i += 1
# print(rigids_parts)
print(rigids_parts)
groups = orig_lxfml.findall('.//Group')
# print(len(groups))
groups_parts = []
for group in groups:
groups_parts.append(group.attrib['partRefs'].split(','))
# print(groups_parts)
print(groups_parts)
# our output
models = []
@ -366,11 +366,9 @@ def split_ugc(path):
filename = 0
for xml in output_xmls:
rigidsystems = xml.findall('.//RigidSystem')
rigids_parts = {}
i = 0
for rigidsytem in rigidsystems:
rigids = rigidsytem.findall('.//Rigid')
rigids = xml.findall('.//Rigid')
bricks = xml.findall('.//Bone')
transformation = list(map(float, rigids[0].attrib['transformation'].split(',')))
print(f"x: {transformation[-3]}")
@ -383,10 +381,12 @@ def split_ugc(path):
old_transform[-3] = old_transform[-3] - transformation[-3]
new_transform = ','.join(map(str, old_transform))
brick.set("transformation", new_transform)
# only do it once
break
f = open(f"{filename}.bin", "ab")
out = ET.tostring(xml).replace(b"\n", b"").replace(b" ", b"")
f.write(zlib.compress(out))
f.close()
f = open(f"{filename}.lxfml", "ab")
out = ET.tostring(xml).replace(b"\n", b"").replace(b" ", b"")
f.write(out)
f.close()
filename += 1