Skip to content

Commit

Permalink
fixed time.clock
Browse files Browse the repository at this point in the history
  • Loading branch information
thomatoes50 committed Nov 28, 2022
1 parent 6cbe5dc commit 5df396e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion io_scene_forest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
bl_info = {
"name": "BeamNG forest item (*.forest4.json)",
"author": "BeamNG / dmn",
"version": (0, 2, 0),
"version": (0, 2, 1),
"blender": (2, 80, 0),
"location": "File > Import-Export",
"description": "Import-Export forest files",
Expand Down
10 changes: 6 additions & 4 deletions io_scene_forest/export_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#
# ##### END LICENSE BLOCK #####

import os, time, math
import os, math
import datetime
import bpy , mathutils

######################################################
Expand Down Expand Up @@ -37,7 +38,8 @@ def export_forest(file, object_name, data_source):

loc = ob.location

items.append('{"type":"' + object_name + '","pos":[' + str(loc[0]) + ',' + str(loc[1]) + ',' + str(loc[2]) + '],"quat":[' + str(object_quaternion[2]) + ',' + str(object_quaternion[1] * -1) + ',' + str(object_quaternion[0]) + "," + str(object_quaternion[3]) + '],"scale":' + str(uniform_scale) + "}")
items.append('{"type":"' + object_name + '","pos":[' + str(loc[0]) + ',' + str(loc[1]) + ',' + str(loc[2]) + '],"quat":[' +
str(object_quaternion[2]) + ',' + str(object_quaternion[1] * -1) + ',' + str(object_quaternion[0]) + "," + str(object_quaternion[3]) + '],"scale":' + str(uniform_scale) + "}")

# write to file
file.write("\n".join(items))
Expand All @@ -53,7 +55,7 @@ def save_forest(filepath,

print("exporting forest: %r..." % (filepath))

time1 = time.clock()
time1 = datetime.datetime.now()

# get data source
data_source = bpy.data.objects
Expand All @@ -66,7 +68,7 @@ def save_forest(filepath,
file.close()

# forest export complete
print(" done in %.4f sec." % (time.clock() - time1))
print(" done in %.4f sec." % ((datetime.datetime.now() - time1).total_seconds()))


def save(operator,
Expand Down

0 comments on commit 5df396e

Please sign in to comment.