mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 18:26:12 +08:00
[godot] Only log if actual work happens.
This commit is contained in:
parent
158eb4e7fb
commit
6a2a1f8101
@ -33,14 +33,17 @@ def convert_json(filename):
|
|||||||
os.remove(filename + ".import")
|
os.remove(filename + ".import")
|
||||||
|
|
||||||
def convert_tscn_or_tres(filename):
|
def convert_tscn_or_tres(filename):
|
||||||
print("Converting TSCN file " + str(filename))
|
|
||||||
file = codecs.open(filename, "r", "utf-8")
|
file = codecs.open(filename, "r", "utf-8")
|
||||||
content = file.read()
|
content = file.read()
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
new_content = ""
|
new_content = ""
|
||||||
|
is_converted = False
|
||||||
for line in content.splitlines(True):
|
for line in content.splitlines(True):
|
||||||
if line.startswith("[ext_resource") and 'type="SpineSkeletonFileResource"' in line:
|
if line.startswith("[ext_resource") and 'type="SpineSkeletonFileResource"' in line and '.json"' in line:
|
||||||
|
if not is_converted:
|
||||||
|
print("Converting TSCN file " + str(filename))
|
||||||
|
is_converted = True
|
||||||
print("Replacing .json with .spine-json in \n" + line)
|
print("Replacing .json with .spine-json in \n" + line)
|
||||||
line = line.replace('.json"', '.spine-json"')
|
line = line.replace('.json"', '.spine-json"')
|
||||||
new_content += line
|
new_content += line
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user