mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-07 04:45:52 +00:00
use SaveAs rather than Save for outputting .blend files
This commit is contained in:
parent
031daeb841
commit
48a4a51853
@ -319,6 +319,8 @@ def dataout_loop():
|
|||||||
for c in r:
|
for c in r:
|
||||||
writepipebuf(struct.pack('f', c))
|
writepipebuf(struct.pack('f', c))
|
||||||
|
|
||||||
|
loaded_blend = None
|
||||||
|
|
||||||
# Main exception handling
|
# Main exception handling
|
||||||
try:
|
try:
|
||||||
# Command loop
|
# Command loop
|
||||||
@ -333,6 +335,7 @@ try:
|
|||||||
if 'FINISHED' in bpy.ops.wm.open_mainfile(filepath=cmdargs[1]):
|
if 'FINISHED' in bpy.ops.wm.open_mainfile(filepath=cmdargs[1]):
|
||||||
if bpy.ops.object.mode_set.poll():
|
if bpy.ops.object.mode_set.poll():
|
||||||
bpy.ops.object.mode_set(mode = 'OBJECT')
|
bpy.ops.object.mode_set(mode = 'OBJECT')
|
||||||
|
loaded_blend = cmdargs[1]
|
||||||
writepipeline(b'FINISHED')
|
writepipeline(b'FINISHED')
|
||||||
else:
|
else:
|
||||||
writepipeline(b'CANCELLED')
|
writepipeline(b'CANCELLED')
|
||||||
@ -340,8 +343,10 @@ try:
|
|||||||
elif cmdargs[0] == 'CREATE':
|
elif cmdargs[0] == 'CREATE':
|
||||||
if len(cmdargs) >= 4:
|
if len(cmdargs) >= 4:
|
||||||
bpy.ops.wm.open_mainfile(filepath=cmdargs[3])
|
bpy.ops.wm.open_mainfile(filepath=cmdargs[3])
|
||||||
|
loaded_blend = cmdargs[1]
|
||||||
else:
|
else:
|
||||||
bpy.ops.wm.read_homefile()
|
bpy.ops.wm.read_homefile()
|
||||||
|
loaded_blend = None
|
||||||
bpy.context.user_preferences.filepaths.save_version = 0
|
bpy.context.user_preferences.filepaths.save_version = 0
|
||||||
if 'FINISHED' in bpy.ops.wm.save_as_mainfile(filepath=cmdargs[1]):
|
if 'FINISHED' in bpy.ops.wm.save_as_mainfile(filepath=cmdargs[1]):
|
||||||
bpy.ops.file.hecl_patching_load()
|
bpy.ops.file.hecl_patching_load()
|
||||||
@ -365,7 +370,8 @@ try:
|
|||||||
|
|
||||||
elif cmdargs[0] == 'SAVE':
|
elif cmdargs[0] == 'SAVE':
|
||||||
bpy.context.user_preferences.filepaths.save_version = 0
|
bpy.context.user_preferences.filepaths.save_version = 0
|
||||||
if 'FINISHED' in bpy.ops.wm.save_mainfile(check_existing=False, compress=True):
|
if loaded_blend:
|
||||||
|
if 'FINISHED' in bpy.ops.wm.save_as_mainfile(filepath=loaded_blend, check_existing=False, compress=True):
|
||||||
writepipeline(b'FINISHED')
|
writepipeline(b'FINISHED')
|
||||||
else:
|
else:
|
||||||
writepipeline(b'CANCELLED')
|
writepipeline(b'CANCELLED')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user