Skip to content

Commit eb262be

Browse files
committed
2.6.3 ready
1 parent d45fba6 commit eb262be

File tree

4 files changed

+355
-135
lines changed

4 files changed

+355
-135
lines changed

__init__.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
bl_info = {
3535
'name': 'Objex Exporter for N64 romhacking',
3636
'author': 'Campbell Barton, Bastien Montagne, OoT modding community',
37-
'version': (2, 6, 2),
37+
'version': (2, 6, 3),
3838
'blender': (2, 80, 0),
3939
'location': 'File > Export',
4040
'description': 'Allows to export to objex and provides new features for further customization',
@@ -100,6 +100,7 @@ class OBJEX_OT_export_base():
100100

101101
bl_idname = 'objex.export'
102102
bl_label = 'Export OBJEX'
103+
bl_description = "Exports as Objex2 (.objex)"
103104
bl_options = {'PRESET'}
104105

105106
filename_ext = '.objex'
@@ -108,6 +109,8 @@ class OBJEX_OT_export_base():
108109
options={'HIDDEN'},
109110
)
110111

112+
skip_dialog: bpy.props.BoolProperty(default=False, options={"HIDDEN"})
113+
111114
# context group
112115
use_selection = BoolProperty(
113116
name='Selection Only',
@@ -452,7 +455,12 @@ def progress_report_print(*args, **kwargs):
452455
if bpy.app.version < (2, 80, 0) else '',
453456
display_device_ok)
454457

455-
return export_objex.save(context, **keywords)
458+
result = export_objex.save(context, **keywords)
459+
# Save the chosen filepath
460+
context.scene.objex_last_export_path = bpy.path.relpath(self.filepath)
461+
462+
return result
463+
456464
except util.ObjexExportAbort as abort:
457465
log.error('Export abort: {}', abort.reason)
458466
return {'CANCELLED'}
@@ -463,6 +471,16 @@ def progress_report_print(*args, **kwargs):
463471
progress_report.print = print
464472
logging_util.resetLoggingSettings()
465473

474+
def invoke(self, context, event):
475+
# If textbox already filled -> bypass file browser
476+
if self.skip_dialog and context.scene.objex_last_export_path:
477+
self.filepath = bpy.path.abspath(context.scene.objex_last_export_path)
478+
result = self.execute(context)
479+
self.report({'INFO'}, f"Exported to {self.filepath}")
480+
return result
481+
else:
482+
# No path stored yet -> open file browser as usual
483+
return ExportHelper.invoke(self, context, event)
466484
axis_forward = '-Z'
467485
axis_up='Y'
468486

@@ -472,7 +490,7 @@ class OBJEX_OT_export(bpy.types.Operator, OBJEX_OT_export_base, ExportHelper):
472490
pass
473491

474492
def menu_func_export(self, context):
475-
self.layout.operator(OBJEX_OT_export.bl_idname, text='Objex2 (.objex)')
493+
self.layout.operator(OBJEX_OT_export.bl_idname, text='Objex2 (.objex)').skip_dialog = False
476494

477495
class OBJEX_AddonPreferences(bpy.types.AddonPreferences, logging_util.AddonLoggingPreferences, addon_updater_ops.AddonUpdaterPreferences):
478496
bl_idname = __package__

export_objex.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,8 @@ def save(context,
781781
use_collection=None,
782782
include_armatures_from_selection=True,
783783
global_matrix=None,
784-
path_mode=None
784+
path_mode=None,
785+
skip_dialog = False
785786
):
786787

787788
objex_writer = ObjexWriter(context)

0 commit comments

Comments
 (0)