def export(blender_scene): # Export the scene (with silenced pyluxcore) pyluxcore.Init(luxcore_logger) exporter = Exporter() session = exporter.create_session(blender_scene) config = session.GetRenderConfig() luxcore_scene = config.GetScene() scene_props = luxcore_scene.ToProperties() return scene_props
def test_final_export(self): start = time() with open("./full_export/log.txt", "w") as log: with redirect_stdout(log): pyluxcore.Init(luxcore_logger) # Test final render export from the engine's point of view _exporter = export.Exporter() _session = _exporter.create_session(bpy.context.scene) print("test_final_export(): Export took %.1fs" % (time() - start)) # TODO: We could check a lot more here self.assertIsNotNone(_session)
def test_user_abort(self): start = time() with open("./full_export/log.txt", "w") as log: with redirect_stdout(log): pyluxcore.Init(luxcore_logger) # Test user aborting the export process _exporter = export.Exporter(bpy.context.scene) engine = RenderEngineMockup(abort_immediately=True) _session = _exporter.create_session(context=None, engine=engine) print("test_user_abort(): Export took %.1f s" % (time() - start)) self.assertIsNone(_session)