2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 13:44:56 +00:00

Implement hecl package

This commit is contained in:
Jack Andersen
2017-10-24 21:46:32 -10:00
parent a5b7a7b96c
commit b7208bfc5f
14 changed files with 374 additions and 198 deletions

View File

@@ -374,6 +374,19 @@ def get_subtype_names(writebuf):
writebuf(struct.pack('I', len(subtype.name)))
writebuf(subtype.name.encode())
# Access subtype's contained overlay names
def get_subtype_overlay_names(writebuf, subtypeName):
sact_data = bpy.context.scene.hecl_sact_data
for sub_idx in range(len(sact_data.subtypes)):
subtype = sact_data.subtypes[sub_idx]
if subtype.name == subtypeName:
writebuf(struct.pack('I', len(subtype.overlays)))
for overlay in subtype.overlays:
writebuf(struct.pack('I', len(overlay.name)))
writebuf(overlay.name.encode())
return
writebuf(struct.pack('I', 0))
# Access actor's contained action names
def get_action_names(writebuf):
sact_data = bpy.context.scene.hecl_sact_data
@@ -383,7 +396,6 @@ def get_action_names(writebuf):
writebuf(struct.pack('I', len(action.name)))
writebuf(action.name.encode())
# Panel draw
def draw(layout, context):
SACTSubtype.draw(layout.box(), context)

View File

@@ -392,6 +392,11 @@ def dataout_loop():
writepipestr(b'OK')
hecl.sact.get_subtype_names(writepipebuf)
elif cmdargs[0] == 'GETSUBTYPEOVERLAYNAMES':
subtypeName = cmdargs[1]
writepipestr(b'OK')
hecl.sact.get_subtype_overlay_names(writepipebuf, subtypeName)
elif cmdargs[0] == 'GETACTIONNAMES':
writepipestr(b'OK')
hecl.sact.get_action_names(writepipebuf)