import os
+import mathutils
def linear_to_srgb(l):
if l<0.0031308:
from .outfile import open_output
out_file = open_output(out_file)
+ p1 = max(((v.co, v.co.length) for v in obj.data.vertices), key=lambda x:x[1])[0]
+ p2 = max(((v.co, (v.co-p1).length) for v in obj.data.vertices), key=lambda x:x[1])[0]
+ center = (p1+p2)/2
+ radius = (p1-p2).length/2
+ for v in obj.data.vertices:
+ d = v.co-center
+ if d.length>radius:
+ center += d*(1-radius/d.length)/2
+ radius = (radius+d.length)/2
+
+ out_file.write("bounding_sphere_hint", center[0], center[1], center[2], radius)
+
prev_mesh = None
prev_tech = (None, None)
for i, l in enumerate(lods):