def export_scene(state): options = state['options'] print("Preparing scene") saved_state,objects = prepare_scene(state['scene']) try: print("Exporting lightmap") tmp_lightmap = write_temp() export_lightmap(tmp_lightmap) state['embeds'].append([tmp_lightmap,'lightmap.png']) print("Generating objects") objects = generate_objects(objects,state) out = { 'objects': objects, 'materials': globals.get_type('material',state), 'meshes': globals.get_type('mesh',state), } finally: print("Cleaning up scene") cleanup_scene(state['scene'],saved_state) return out
def export_single(state): object = False for o in state['objects']: if o.type == 'MESH': object = o break mesh = generate_geometry(object,state) return { 'mesh': mesh, 'materials': globals.get_type('material',state), }