Skip to content

Commit

Permalink
Added bounds info to JSON filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jterrace committed Aug 8, 2012
1 parent 86667e2 commit 7be4edc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions meshtool/filters/print_filters/print_json.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from meshtool.filters.base_filters import PrintFilter
from meshtool.filters.print_filters.print_render_info import getRenderInfo
from meshtool.filters.print_filters.print_bounds import getBoundsInfo

try:
import json
Expand Down Expand Up @@ -42,7 +43,16 @@ def getJSON(mesh):
'effects': effects,
'images': images,
'primitives': primitives}

json_ret.update(getRenderInfo(mesh))

boundsInfo = getBoundsInfo(mesh)
boundsInfo = {'bounds': [boundsInfo['bounds'][0].tolist(), boundsInfo['bounds'][1].tolist()],
'center': boundsInfo['center'].tolist(),
'center_farthest': boundsInfo['center_farthest'].tolist(),
'center_farthest_distance': float(boundsInfo['center_farthest_distance'])}
json_ret['bounds_info'] = boundsInfo

return json.dumps(json_ret)

def FilterGenerator():
Expand Down

0 comments on commit 7be4edc

Please sign in to comment.