Skip to content

Commit

Permalink
bugfixes lol
Browse files Browse the repository at this point in the history
  • Loading branch information
Burgerballs authored Mar 16, 2023
1 parent d7f3480 commit 659726c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions psychjsontocodenamexml.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ def convAnim(a):
print('CONVERTING"' + a['anim'] + '"')
b = ' <anim name="'+a['anim']+'" anim="'+a['name']+'"'
if a['fps'] != 24: b+=' fps="'+str(a['fps'])+'"'
b+=' loop="'+str(a['loop']).lower()+'"'
offset = []
for i in a['offsets']: offset.append(i)
b+=' x="'+str(offset[0])+'"'
b+=' y="'+str(offset[1])+'"'
indices = []
for i in a['indices']: offset.indices(i)
for i in a['indices']: indices.append(i)
if (a['indices'] != []):
b+='indices= "'
b+=' indices="'
for i in indices:
b+=str(i)
if i != indices[len(indices)]-1:
if i != indices[len(indices)-1]:
b+=','
b+='"'
b+='/>\n'
print('CONVERTING"' + a['anim'] + '" SUCCESS')
return b
Expand Down Expand Up @@ -80,4 +82,4 @@ def convert(jsonfile):
f.close()
print('CONVERSION SUCCESSFUL, OPEN '+str(sys.argv[1]).rstrip('.json') + '.xml')
else:
print('Error:',sys.argv[1],'is not a JSON formatted file.')
print('Error:',sys.argv[1],'is not a JSON formatted file.')

0 comments on commit 659726c

Please sign in to comment.