def test_Hafarm1(self): with tempdir('hafarm_nuke_test_Hafarm1') as tmppath: nuke.root().setSelected(self.write1) ctx = HaContext.HaContext(external_hashes=map(lambda x: str(x).rjust(4,'Y'), xrange(1,90))) kwargs = dict( queue = 'nuke' ,group = 'render' ,start_frame = 1 ,end_frame = 100 ,frame_range = 1 ,job_on_hold = False ,priority = 100 ) graph = ctx.get_graph(**kwargs) json_files = graph.render(json_output_directory=tmppath, copy_scene_file=True) json_files.sort() self.assertEqual(len(json_files), 1, 'incorrect count files') json_expected_files = [ 'testRenderPressed.nk_YYY1_Write1.json' ] json_expected_files.sort() self._test_files(json_expected_files, json_files) return True
def test_Hafarm1(self): self.root.parm("make_proxy").set(True) self.root.parm("make_movie").set(True) self.root.parm("debug_images").set(True) self.grid.parm("vm_tile_render").set(True) hou.setPwd(self.root) ctx = HaContext.HaContext() graph = ctx.get_graph() graph.set_render(PrintRender.JsonParmRender) json_files = graph.render() return True
def test_post_render_actions(self): hou.setPwd(self.farm) ctx = HaContext.HaContext() graph = ctx.get_graph() self.assertTrue(len(graph.graph_items) == 5) # for n in graph.graph_items: # print type(n), n, n.dependencies graph.set_render(GraphvizRender.GraphvizRender) graph.render()
def test_mantra_render_frame_list(self): hou.setPwd(self.farm) ctx = HaContext.HaContext() graph = ctx.get_graph() frames = [1,3,5] mframes = Houdini.mantra_render_frame_list(self.hbatch_farm, frames) self.assertEqual(mframes, self.hbatch_farm.get_direct_outputs()) self.assertEqual(len(frames), len(mframes)) self.assertTrue("-l 1,3,5" in self.hbatch_farm.parms['command_arg']) for frame in range(len(frames)): self.assertEqual(mframes[frame].parms['start_frame'], frames[frame]) self.assertEqual(mframes[frame].parms['end_frame'], frames[frame]) self.assertEqual(mframes[frame].get_direct_inputs()[0], self.hbatch_farm)
def test_mantra_render_from_ifd_1(self): frames = None job_name = None image = os.path.join(self.tmppath, "image.0001.exr") self.farm.parm("render_from_ifd").set(True) hou.setPwd(self.farm) ctx = HaContext.HaContext() graph = ctx.get_graph() mantras = filter(lambda x: isinstance(x, Houdini.HoudiniMantraExistingIfdWrapper), graph.graph_items) for mantra in mantras: self.assertEqual(mantra.parms['start_frame'], self.farm.parm("ifd_range1").eval()) self.assertEqual(mantra.parms['end_frame'], self.farm.parm("ifd_range2").eval()) self.assertEqual(mantra.parms['step_frame'], self.farm.parm("ifd_range3").eval()) self.assertTrue(const.TASK_ID in mantra.parms['scene_file']) self.assertEqual(mantra.parms['output_picture'], image) self.farm.parm("render_from_ifd").set(False)
def test2_MoreOptions(self): with tempdir('hafarm_slurm_test2_MoreOptions') as (tmp, generated_directory): hou.setPwd(self.root) self.root.parm("more").set(True) self.root.parm("hbatch_slots").set(44) self.root.parm("mantra_slots").set(55) self.root.parm("hbatch_ram").set(64) self.root.parm("mantra_ram").set(32) self.root.parm("max_running_tasks").set(77) self.root.parm("delay").set(7) ctx = HaContext.HaContext(external_hashes=map(lambda x: str(x).rjust(4,'Z'), xrange(1,90))) graph = ctx.get_graph() graph.set_render(SlurmRender.SlurmRender) json_files = graph.render(json_output_directory=generated_directory, dryrun=True) json_files.sort() self.assertEqual(len(json_files), 7, 'incorrect count files') json_expected_files = [ 'testRenderSlurm.hip_ZZ10_grid_ifd.hip' ,'testRenderSlurm.hip_ZZ10_grid_ifd.job' ,'testRenderSlurm.hip_ZZ10_grid_ifd.json' ,'testRenderSlurm.hip_ZZ10_grid_mantra.job' ,'testRenderSlurm.hip_ZZ10_grid_mantra.json' ,'testRenderSlurm.hip_ZZ13_comp_comp.hip' ,'testRenderSlurm.hip_ZZ13_comp_comp.job' ,'testRenderSlurm.hip_ZZ13_comp_comp.json' ,'testRenderSlurm.hip_ZZZ2_alembic_alembic.hip' ,'testRenderSlurm.hip_ZZZ2_alembic_alembic.job' ,'testRenderSlurm.hip_ZZZ2_alembic_alembic.json' ,'testRenderSlurm.hip_ZZZ4_teapot_geometry.hip' ,'testRenderSlurm.hip_ZZZ4_teapot_geometry.job' ,'testRenderSlurm.hip_ZZZ4_teapot_geometry.json' ,'testRenderSlurm.hip_ZZZ6_box_teapot_ifd.hip' ,'testRenderSlurm.hip_ZZZ6_box_teapot_ifd.job' ,'testRenderSlurm.hip_ZZZ6_box_teapot_ifd.json' ,'testRenderSlurm.hip_ZZZ6_box_teapot_mantra.job' ,'testRenderSlurm.hip_ZZZ6_box_teapot_mantra.json' ] json_expected_files.sort() actual_files = os.listdir(generated_directory) actual_files.sort() self._test_files(json_expected_files, actual_files, generated_directory)
def test_Hafarm1(self): with tempdir('hafarm_houRS_test_Hafarm1') as tmppath: hou.setPwd(self.root) ctx = HaContext.HaContext(external_hashes=map(lambda x: str(x).rjust(4,'Y'), xrange(1,90))) graph = ctx.get_graph() json_files = graph.render(json_output_directory=tmppath, copy_scene_file=True) json_files.sort() self.assertEqual(len(json_files), 3, 'incorrect count files') json_expected_files = [ 'testRedshiftRenderPressed.hip_YYY2_teapot_geometry.json' ,'testRedshiftRenderPressed.hip_YYY4_teapotRS_redshift.json' ,'testRedshiftRenderPressed.hip_YYY4_teapotRS_rs.json' ] json_expected_files.sort() self._test_files(json_expected_files, json_files) return True
def test_mantra_render_frames(self): self.farm.parm("use_frame_list").set(True) self.farm.parm("frame_list").set('1,3,5') image = os.path.join(self.tmppath, "image.0001.exr") hou.setPwd(self.farm) ctx = HaContext.HaContext() graph = ctx.get_graph() frames = [1,3,5] mantras = filter(lambda x: isinstance(x, Houdini.HoudiniMantraExistingIfdWrapper), graph.graph_items) for frame in frames: idx = frames.index(frame) self.assertEqual(mantras[idx].parms['start_frame'], frame) self.assertEqual(mantras[idx].parms['end_frame'], frame) self.assertTrue(const.TASK_ID in mantras[idx].parms['scene_file']) self.assertEqual(mantras[idx].parms['output_picture'], image)
def test_Hafarm2_and_Hafarm1(self): with tempdir('hafarm_hou_test_Hafarm3') as tmppath: self.root.parm("group").set("renders_root") self.root.parm("queue").set("cuda_root") self.root.parm("priority").set(-100) self.root.parm("job_on_hold").set(True) self.root.parm("make_proxy").set(True) self.root.parm("make_movie").set(True) self.root.parm("debug_images").set(True) self.hafarm1.parm("group").set("3d_hafarm1") self.hafarm1.parm("queue").set("opencl_hafarm1") self.hafarm1.parm("priority").set(-333) self.hafarm1.parm("job_on_hold").set(True) self.hafarm1.parm("make_proxy").set(False) self.hafarm1.parm("make_movie").set(False) self.hafarm1.parm("debug_images").set(False) hou.setPwd(self.root) ctx = HaContext.HaContext(external_hashes=map(lambda x: str(x).rjust(4,'W'), xrange(1,90))) graph = ctx.get_graph() json_files = graph.render(json_output_directory=tmppath, copy_scene_file=True) json_files.sort() self.assertEqual(len(json_files), 14, 'incorrect count files') json_expected_files = [ 'testRenderPressed.hip_WW13_alembic_alembic.json' ,'testRenderPressed.hip_WW15_grid_ifd.json' ,'testRenderPressed.hip_WW15_grid_mantra.json' ,'testRenderPressed.hip_WW18_comp_comp.json' ,'testRenderPressed.hip_WW18_comp_debug.json' ,'testRenderPressed.hip_WW18_comp_mp4.json' ,'testRenderPressed.hip_WW18_comp_reports.json' ,'testRenderPressed.hip_WWW2_teapot_geometry.json' ,'testRenderPressed.hip_WWW4_box_geometry.json' ,'testRenderPressed.hip_WWW6_box_teapot_debug.json' ,'testRenderPressed.hip_WWW6_box_teapot_ifd.json' ,'testRenderPressed.hip_WWW6_box_teapot_mantra.json' ,'testRenderPressed.hip_WWW6_box_teapot_mp4.json' ,'testRenderPressed.hip_WWW6_box_teapot_reports.json' ] json_expected_files.sort() self._test_files(json_expected_files, json_files)
def test1_SlurmFiles(self): with tempdir('hafarm_slurm_test1_SlurmFiles') as (tmp, generated_directory): hou.setPwd(self.root) ctx = HaContext.HaContext(external_hashes=map( lambda x: str(x).rjust(4, 'Y'), xrange(1, 90))) graph = ctx.get_graph() graph.set_render(SlurmRender.SlurmRender) json_files = graph.render( json_output_directory=generated_directory, dryrun=True) json_files.sort() self.assertEqual(len(json_files), 7, 'incorrect count files') json_expected_files = [ 'testRenderSlurm.hip_YY10_grid_ifd.hip', 'testRenderSlurm.hip_YY10_grid_ifd.job', 'testRenderSlurm.hip_YY10_grid_ifd.json', 'testRenderSlurm.hip_YY10_grid_mantra.job', 'testRenderSlurm.hip_YY10_grid_mantra.json', 'testRenderSlurm.hip_YY13_comp_comp.hip', 'testRenderSlurm.hip_YY13_comp_comp.job', 'testRenderSlurm.hip_YY13_comp_comp.json', 'testRenderSlurm.hip_YYY2_alembic_alembic.hip', 'testRenderSlurm.hip_YYY2_alembic_alembic.job', 'testRenderSlurm.hip_YYY2_alembic_alembic.json', 'testRenderSlurm.hip_YYY4_teapot_geometry.hip', 'testRenderSlurm.hip_YYY4_teapot_geometry.job', 'testRenderSlurm.hip_YYY4_teapot_geometry.json', 'testRenderSlurm.hip_YYY6_box_teapot_ifd.hip', 'testRenderSlurm.hip_YYY6_box_teapot_ifd.job', 'testRenderSlurm.hip_YYY6_box_teapot_ifd.json', 'testRenderSlurm.hip_YYY6_box_teapot_mantra.job', 'testRenderSlurm.hip_YYY6_box_teapot_mantra.json' ] json_expected_files.sort() actual_files = os.listdir(generated_directory) actual_files.sort() self._test_files(json_expected_files, actual_files, generated_directory)
def test_Hafarm2(self): with tempdir('hafarm_hou_test_Hafarm2') as tmppath: self.root.parm("make_proxy").set(True) self.root.parm("make_movie").set(True) self.root.parm("debug_images").set(True) self.hafarm1.parm("make_proxy").set(True) self.hafarm1.parm("make_movie").set(True) self.hafarm1.parm("debug_images").set(True) hou.setPwd(self.root) ctx = HaContext.HaContext(external_hashes=map(lambda x: str(x).rjust(4,'X'), xrange(1,90))) graph = ctx.get_graph() json_files = graph.render(json_output_directory=tmppath, copy_scene_file=True) json_files.sort() self.assertEqual(len(json_files), 17, 'incorrect count files') json_expected_files = [ 'testRenderPressed.hip_XX13_alembic_alembic.json' ,'testRenderPressed.hip_XX15_grid_debug.json' ,'testRenderPressed.hip_XX15_grid_ifd.json' ,'testRenderPressed.hip_XX15_grid_mantra.json' ,'testRenderPressed.hip_XX15_grid_mp4.json' ,'testRenderPressed.hip_XX15_grid_reports.json' ,'testRenderPressed.hip_XX21_comp_comp.json' ,'testRenderPressed.hip_XX21_comp_debug.json' ,'testRenderPressed.hip_XX21_comp_mp4.json' ,'testRenderPressed.hip_XX21_comp_reports.json' ,'testRenderPressed.hip_XXX2_teapot_geometry.json' ,'testRenderPressed.hip_XXX4_box_geometry.json' ,'testRenderPressed.hip_XXX6_box_teapot_debug.json' ,'testRenderPressed.hip_XXX6_box_teapot_ifd.json' ,'testRenderPressed.hip_XXX6_box_teapot_mantra.json' ,'testRenderPressed.hip_XXX6_box_teapot_mp4.json' ,'testRenderPressed.hip_XXX6_box_teapot_reports.json' ] json_expected_files.sort() self._test_files(json_expected_files, json_files) return True