class SceneExporter:
def __init__(self):
- self.external_tech = True
self.resource_collection = True
+ self.show_progress = True
def export(self, context, out_file):
objs = context.selected_objects
from .export_object import ObjectExporter
object_export = ObjectExporter()
- object_export.external_tech = self.external_tech
object_prototypes = {}
unique_objects = []
object_prototypes[c.name] = o
from .util import Progress
- progress = Progress(context)
+ progress = Progress(self.show_progress and context)
+
if self.resource_collection:
res_out = open_output(os.path.join(path, base+"_resources.mdc"))
# TODO Export techniques as separate items in the collection
for i, o in enumerate(unique_objects):
res_out.begin("object", '"{}.object"'.format(o.name))
- progress.push_task(o.name, i/len(objs), (i+1)/len(objs))
+ progress.push_task_slice(o.name, i, len(objs))
object_export.export(context, res_out, o, progress)
progress.pop_task()
res_out.end()
os.makedirs(res_dir)
for i, o in enumerate(unique_objects):
obj_out = open_output(os.path.join(res_dir, o.name+".object"))
- progress.push_task(o.name, i/len(objs), (i+1)/len(objs))
+ progress.push_task_slice(o.name, i, len(objs))
object_export.export(context, obj_out, o, progress)
progress.pop_task()
axis = q.axis
out_file.write("rotation", angle*180/math.pi, axis[0], axis[1], axis[2])
out_file.write("scale", o.scale[0], o.scale[1], o.scale[2])
- out_file.end();
+ out_file.end()