2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 17:04:55 +00:00

Add collision mesh cooking to BlenderConnection

This commit is contained in:
Jack Andersen
2016-08-10 11:54:30 -10:00
parent 73cb100174
commit 2b1e246ae9
5 changed files with 212 additions and 6 deletions

View File

@@ -182,6 +182,16 @@ def dataout_loop():
writepipeline(b'OK')
hecl.hmdl.cook(writepipebuf, bpy.data.objects[meshName], cmdargs[2], maxSkinBanks)
elif cmdargs[0] == 'MESHCOMPILENAMECOLLISION':
meshName = cmdargs[1]
if meshName not in bpy.data.objects:
writepipeline(('mesh %s not found' % meshName).encode())
continue
writepipeline(b'OK')
hecl.hmdl.cookcol(writepipebuf, bpy.data.objects[meshName])
elif cmdargs[0] == 'MESHCOMPILEALL':
maxSkinBanks = int(cmdargs[2])
maxOctantLength = float(cmdargs[3])
@@ -238,7 +248,6 @@ def dataout_loop():
for c in r:
writepipebuf(struct.pack('f', c))
# Main exception handling
try:
# Command loop