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

Create directory chains at a late point during extract

This commit is contained in:
Jack Andersen
2017-01-16 15:21:13 -10:00
parent e64168090c
commit aecaab27a4
10 changed files with 75 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
import bpy
import bpy, struct
def draw(layout, context):
if bpy.context.active_object:
@@ -63,24 +63,28 @@ def draw(layout, context):
row.prop(obj.data, 'retro_light_angle_linear', text='Linear')
row.prop(obj.data, 'retro_light_angle_quadratic', text='Quadratic')
def cook(path_out, version):
fout = open(path_out, 'wb')
fout.write(struct.pack('>IIIII'))
# Registration
def register():
frame_widget_types = [
('RETRO_BWIG', 'Base Widget', '', 0),
('RETRO_CAMR', 'Camera', '', 1),
('RETRO_ENRG', 'Energy Bar', '', 2),
('RETRO_GRUP', 'Group', '', 3),
('RETRO_HWIG', 'Head Widget', '', 4),
('RETRO_IMGP', 'Image Pane', '', 5),
('RETRO_LITE', 'Light', '', 6),
('RETRO_MODL', 'Model', '', 7),
('RETRO_METR', 'Meter', '', 8),
('RETRO_PANE', 'Pane', '', 9),
('RETRO_SLGP', 'Slider Group', '', 10),
('RETRO_TBGP', 'Table Group', '', 11),
('RETRO_TXPN', 'Text Pane', '', 12)]
bpy.types.Object.retro_widget_type = bpy.props.EnumProperty(items=frame_widget_types, name='Retro: FRME Widget Type', default='RETRO_BWIG')
('RETRO_NONE', 'Not a Widget', '', 0),
('RETRO_BWIG', 'Base Widget', '', 1),
('RETRO_CAMR', 'Camera', '', 2),
('RETRO_ENRG', 'Energy Bar', '', 3),
('RETRO_GRUP', 'Group', '', 4),
('RETRO_HWIG', 'Head Widget', '', 5),
('RETRO_IMGP', 'Image Pane', '', 6),
('RETRO_LITE', 'Light', '', 7),
('RETRO_MODL', 'Model', '', 8),
('RETRO_METR', 'Meter', '', 9),
('RETRO_PANE', 'Pane', '', 10),
('RETRO_SLGP', 'Slider Group', '', 11),
('RETRO_TBGP', 'Table Group', '', 12),
('RETRO_TXPN', 'Text Pane', '', 13)]
bpy.types.Object.retro_widget_type = bpy.props.EnumProperty(items=frame_widget_types, name='Retro: FRME Widget Type', default='RETRO_NONE')
model_draw_flags = [
('RETRO_SHADELESS', 'Shadeless', '', 0),
('RETRO_OPAQUE', 'Opaque', '', 1),

View File

@@ -26,7 +26,11 @@ else:
err_path += "/hecl_%016X.derp" % os.getpid()
def readpipestr():
read_len = struct.unpack('I', os.read(readfd, 4))[0]
read_bytes = os.read(readfd, 4)
if len(read_bytes) != 4:
print('HECL connection lost or desynchronized')
bpy.ops.wm.quit_blender()
read_len = struct.unpack('I', read_bytes)[0]
return os.read(readfd, read_len)
def writepipestr(linebytes):
@@ -223,6 +227,16 @@ def dataout_loop():
writepipestr(b'OK')
hecl.swld.cook(writepipebuf)
elif cmdargs[0] == 'FRAMECOMPILE':
pathOut = cmdargs[1]
version = int(cmdargs[2])
if version != 1:
writepipestr(b'bad version')
continue
writepipestr(b'OK')
hecl.frme.cook(pathOut, version)
elif cmdargs[0] == 'LIGHTCOMPILEALL':
writepipestr(b'OK')
lampCount = 0;