6464 _animator3d_output_path ,
6565 _classify_row_state ,
6666 _install_file ,
67+ _painted_existing ,
6768 _painted_path ,
6869 _path_for_log ,
6970 _paths_for_row_manifest ,
7071 _rigging3d_output_path ,
72+ _shape_existing ,
7173 _shape_path ,
7274)
7375from .pipeline import (
@@ -1406,7 +1408,7 @@ def _finalize_mesh_ok_d(
14061408 for idx in pending_3d_d :
14071409 row = rows [idx ]
14081410 img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1409- mesh_shape = _shape_path (mesh_f )
1411+ mesh_shape = _shape_existing ( mesh_f ) or _shape_path (mesh_f )
14101412 if not force and mesh_shape .is_file ():
14111413 shape_skipped_d .add (idx )
14121414 shape_idx_map_d [row .id ] = idx
@@ -1535,8 +1537,8 @@ def _finalize_mesh_ok_d(
15351537 row = rows [idx ]
15361538 rec_d = results_d [idx ]
15371539 img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1538- mesh_shape = _shape_path (mesh_f )
1539- mesh_painted = _painted_path (mesh_f )
1540+ mesh_shape = _shape_existing ( mesh_f ) or _shape_path (mesh_f )
1541+ mesh_painted = _painted_existing ( mesh_f ) or _painted_path (mesh_f )
15401542 try :
15411543 assert paint3d_bin is not None
15421544 tex_argv = _texture_subprocess_argv (
@@ -1596,8 +1598,8 @@ def _finalize_mesh_ok_d(
15961598 for idx in shape_ok_paint_d :
15971599 row = rows [idx ]
15981600 img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1599- mesh_shape = _shape_path (mesh_f )
1600- mesh_painted = _painted_path (mesh_f )
1601+ mesh_shape = _shape_existing ( mesh_f ) or _shape_path (mesh_f )
1602+ mesh_painted = _painted_existing ( mesh_f ) or _painted_path (mesh_f )
16011603 if not force and mesh_painted .is_file ():
16021604 paint_skipped_d .add (idx )
16031605 paint_idx_map_d [row .id ] = idx
@@ -1674,7 +1676,7 @@ def _finalize_mesh_ok_d(
16741676 rec_d = results_d [idx ]
16751677 row = rows [idx ]
16761678 img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1677- mesh_painted = _painted_path (mesh_f )
1679+ mesh_painted = _painted_existing ( mesh_f ) or _painted_path (mesh_f )
16781680 _pst = item_result .get ("status" , "" )
16791681
16801682 if _pst == "progress" :
@@ -1708,7 +1710,7 @@ def _finalize_mesh_ok_d(
17081710 row = rows [idx ]
17091711 rec_d = results_d [idx ]
17101712 img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1711- mesh_painted = _painted_path (mesh_f )
1713+ mesh_painted = _painted_existing ( mesh_f ) or _painted_path (mesh_f )
17121714 dash .feed_event (row .id , "paint3d" , "skipped" , phase = "texture" )
17131715 _finalize_mesh_ok_d (rec_d , mesh_painted , row )
17141716 finalized_d .add (idx )
@@ -1726,7 +1728,7 @@ def _finalize_mesh_ok_d(
17261728 if rec_d .get ("status" ) == "error" :
17271729 continue
17281730 img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1729- mesh_shape = _shape_path (mesh_f )
1731+ mesh_shape = _shape_existing ( mesh_f ) or _shape_path (mesh_f )
17301732 if not mesh_shape .is_file ():
17311733 continue
17321734 rec_d ["image_path" ] = _path_for_log (img_f , manifest_dir )
@@ -1742,8 +1744,8 @@ def _finalize_mesh_ok_d(
17421744 row = rows [idx ]
17431745 rec_d = results_d [idx ]
17441746 _img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1745- mesh_painted = _painted_path (mesh_f )
1746- mesh_shape = _shape_path (mesh_f )
1747+ mesh_painted = _painted_existing ( mesh_f ) or _painted_path (mesh_f )
1748+ mesh_shape = _shape_existing ( mesh_f ) or _shape_path (mesh_f )
17471749 simplify_mesh = (
17481750 mesh_painted
17491751 if mesh_painted .is_file ()
@@ -1772,8 +1774,8 @@ def _finalize_mesh_ok_d(
17721774 row = rows [idx ]
17731775 rec_d = results_d [idx ]
17741776 img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1775- mesh_painted = _painted_path (mesh_f )
1776- mesh_shape = _shape_path (mesh_f )
1777+ mesh_painted = _painted_existing ( mesh_f ) or _painted_path (mesh_f )
1778+ mesh_shape = _shape_existing ( mesh_f ) or _shape_path (mesh_f )
17771779 actual_mesh = (
17781780 mesh_painted
17791781 if mesh_painted .is_file ()
@@ -1806,7 +1808,7 @@ def _finalize_mesh_ok_d(
18061808 row = rows [idx ]
18071809 rec_d = results_d [idx ]
18081810 img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
1809- mesh_shape = _shape_path (mesh_f )
1811+ mesh_shape = _shape_existing ( mesh_f ) or _shape_path (mesh_f )
18101812 seed = _seed_for_row (profile , row .id )
18111813 t3d_args = _text3d_argv (text3d_bin , profile , img_f , mesh_shape , row , gpu_ids = gpu_ids )
18121814 if seed is not None :
@@ -2414,8 +2416,8 @@ def _finalize_mesh_ok(
24142416 for idx in pending_3d_indices :
24152417 row = rows [idx ]
24162418 img_final , mesh_final = _paths_for_row_manifest (profile , manifest_dir , row )
2417- mesh_shape = _shape_path (mesh_final )
2418- mesh_painted = _painted_path (mesh_final )
2419+ mesh_shape = _shape_existing ( mesh_final ) or _shape_path (mesh_final )
2420+ mesh_painted = _painted_existing ( mesh_final ) or _painted_path (mesh_final )
24192421
24202422 if (
24212423 not force
@@ -2571,8 +2573,8 @@ def _finalize_mesh_ok(
25712573 rec = results [idx ]
25722574 progress .update (task_paint , description = f"[cyan]{ row .id } [/cyan] · quick paint" )
25732575 img_final , mesh_final = _paths_for_row_manifest (profile , manifest_dir , row )
2574- mesh_shape = _shape_path (mesh_final )
2575- mesh_painted = _painted_path (mesh_final )
2576+ mesh_shape = _shape_existing ( mesh_final ) or _shape_path (mesh_final )
2577+ mesh_painted = _painted_existing ( mesh_final ) or _painted_path (mesh_final )
25762578
25772579 if mesh_final .is_file () and not force :
25782580 _finalize_mesh_ok (rec , mesh_final , row )
@@ -2630,8 +2632,8 @@ def _finalize_mesh_ok(
26302632 for idx in shape_ok_paint :
26312633 row = rows [idx ]
26322634 img_final , mesh_final = _paths_for_row_manifest (profile , manifest_dir , row )
2633- mesh_shape = _shape_path (mesh_final )
2634- mesh_painted = _painted_path (mesh_final )
2635+ mesh_shape = _shape_existing ( mesh_final ) or _shape_path (mesh_final )
2636+ mesh_painted = _painted_existing ( mesh_final ) or _painted_path (mesh_final )
26352637
26362638 if mesh_final .is_file () and not force :
26372639 rec = results [idx ]
@@ -2719,7 +2721,7 @@ def _finalize_mesh_ok(
27192721 rec = results [idx ]
27202722 row = rows [idx ]
27212723 img_final , mesh_final = _paths_for_row_manifest (profile , manifest_dir , row )
2722- mesh_painted = _painted_path (mesh_final )
2724+ mesh_painted = _painted_existing ( mesh_final ) or _painted_path (mesh_final )
27232725 _pst = item_result .get ("status" , "" )
27242726
27252727 if _pst == "progress" :
@@ -2766,8 +2768,8 @@ def _finalize_mesh_ok(
27662768 row = rows [idx ]
27672769 rec = results [idx ]
27682770 _img_f , mesh_f = _paths_for_row_manifest (profile , manifest_dir , row )
2769- mesh_painted = _painted_path (mesh_f )
2770- mesh_shape = _shape_path (mesh_f )
2771+ mesh_painted = _painted_existing ( mesh_f ) or _painted_path (mesh_f )
2772+ mesh_shape = _shape_existing ( mesh_f ) or _shape_path (mesh_f )
27712773 simplify_mesh = (
27722774 mesh_painted
27732775 if mesh_painted .is_file ()
@@ -2799,8 +2801,8 @@ def _finalize_mesh_ok(
27992801 row = rows [idx ]
28002802 rec = results [idx ]
28012803 img_final , mesh_final = _paths_for_row_manifest (profile , manifest_dir , row )
2802- mesh_painted = _painted_path (mesh_final )
2803- mesh_shape = _shape_path (mesh_final )
2804+ mesh_painted = _painted_existing ( mesh_final ) or _painted_path (mesh_final )
2805+ mesh_shape = _shape_existing ( mesh_final ) or _shape_path (mesh_final )
28042806 actual_mesh = (
28052807 mesh_painted
28062808 if mesh_painted .is_file ()
@@ -2839,7 +2841,7 @@ def _finalize_mesh_ok(
28392841 rec = results [idx ]
28402842 progress .update (task2 , description = f"[cyan]{ row .id } [/cyan] · Text3D" )
28412843 img_final , mesh_final = _paths_for_row_manifest (profile , manifest_dir , row )
2842- mesh_shape = _shape_path (mesh_final )
2844+ mesh_shape = _shape_existing ( mesh_final ) or _shape_path (mesh_final )
28432845
28442846 if not force and mesh_shape .is_file ():
28452847 actual_mesh = mesh_final if mesh_final .is_file () else mesh_shape
0 commit comments