Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

Commit e4a4eae

Browse files
committed
fix: fix fatal error when exporting virtools file
- fix fatal error that user only can export virtools file into existing file, rather than any new file.
1 parent f920cdc commit e4a4eae

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

bbp_ng/OP_EXPORT_virtools.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,18 @@ def execute(self, context):
4444
self.report({'ERROR'}, 'You must specify at least one encoding for file saving (e.g. cp1252, gbk)!')
4545
return {'CANCELLED'}
4646

47-
# check file name
47+
# check file name, but has slightly difference with importer.
48+
# when exporting, file can be inexisting in file system, so we can't check it directly.
4849
filename = self.general_get_filename()
49-
if not os.path.isfile(filename):
50+
bad_filename: bool = False
51+
# for filename, at first, it should not be empty surely.
52+
if len(filename) == 0:
53+
bad_filename = True
54+
# then, if it is existing, it should be a file, otherwise everything is okey.
55+
if os.path.exists(filename) and (not os.path.isfile(filename)):
56+
bad_filename = True
57+
# now, show message and exit if we have bad file name
58+
if bad_filename:
5059
self.report({'ERROR'}, 'No file was selected!')
5160
return {'CANCELLED'}
5261

bbp_ng/blender_manifest.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ schema_version = "1.0.0"
66
# Example of manifest file for a Blender extension
77
# Change the values according to your extension
88
id = "bbp_ng"
9-
version = "4.3.0"
9+
version = "4.3.1"
1010
name = "Ballance Blender Plugin"
1111
tagline = "The specialized add-on served for creating game map of Ballance"
1212
maintainer = "yyc12345 <yyc12321@outlook.com>"

0 commit comments

Comments
 (0)