Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/babylon_js/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,24 @@ def __init__(self, scene, exporter):
Logger.warn('Exception during copy:\n\t\t\t\t\t'+ msg, 4)

Logger.log('Python World class constructor completed')

self.customProperties = scene.items()

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def to_json_file(self, file_handler, exporter):
if len(self.customProperties) > 0:
file_handler.write('"metadata":{')
noComma = True
for k, v in self.customProperties:
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('},')

write_bool(file_handler, 'autoClear', self.autoClear, True)
write_color(file_handler, 'clearColor', self.clear_color)
write_vector(file_handler, 'gravity', self.gravity)
Expand Down