Skip to content

Commit

Permalink
Do not add a stray comma to the JSON for meshes and nodes if custom p…
Browse files Browse the repository at this point in the history
…roperty not one of the types that can be handled (#68)

Co-authored-by: Markus Wagner <[email protected]>
The trailing else just looks like standard defensive code that should have been put in.  Nothing weird to handle this Cycles issue.  Good Job.

Will not get to getting this on the repo's .zip today, but you should not be impacted  .  Thanks!
  • Loading branch information
mwagner-webdev authored Aug 25, 2023
1 parent 63ed1d9 commit dbdf9bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/babylon_js/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,9 @@ def writeCustomProperties(self, file_handler):
if type(v) == str: write_string(file_handler, k, v, noComma)
elif type(v) == float: write_float(file_handler, k, v, FLOAT_PRECISION_DEFAULT, noComma)
elif type(v) == int: write_int(file_handler, k, v, noComma)
else:
Logger.warn('Non-scalar custom prop "' + k + '" ignored.', 2)
continue
noComma = False
file_handler.write('}')

Expand Down
3 changes: 3 additions & 0 deletions src/babylon_js/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@ def writeCustomProperties(self, file_handler):
if type(v) == str: write_string(file_handler, k, v, noComma)
elif type(v) == float: write_float(file_handler, k, v, noComma)
elif type(v) == int: write_int(file_handler, k, v, noComma)
else:
Logger.warn('Non-scalar custom prop "' + k + '" ignored.', 2)
continue
noComma = False
file_handler.write('}')

0 comments on commit dbdf9bf

Please sign in to comment.