@@ -1062,7 +1062,7 @@ def id_to_asset_id_type(id: ID) -> str:
1062
1062
1063
1063
1064
1064
@contextmanager
1065
- def display_all_assets_in_library (context : Context ) -> None :
1065
+ def display_all_assets_in_library (context : Context ) -> Generator [ None , None , None ] :
1066
1066
"""Makes all possible assets visible in the UI for the duration of the context manager. Assets are all selected so running `context.selected_assets` will return all assets."""
1067
1067
# Gather Current State ##
1068
1068
# Params
@@ -1563,6 +1563,18 @@ def handle_preview_path(v: str):
1563
1563
else :
1564
1564
print (f"Could not find asset: '{ item_name } ' of type '{ item_type } ' in blend file: { blend_file } " )
1565
1565
1566
+ def handle_out_path (v : str ) -> None :
1567
+ for asset_dict in json_dict ["assets" ]:
1568
+ if Path (asset_dict ["blend_path" ]) == blend_file :
1569
+ path = Path (v )
1570
+ if path .is_relative_to (destination_dir ):
1571
+ path = path .relative_to (destination_dir )
1572
+ asset_dict ["blend_path" ] = str (path )
1573
+ else :
1574
+ print (
1575
+ f"Out path is not relative to destination directory. Probably saved in wrong place!\n \t { path } "
1576
+ )
1577
+
1566
1578
if op :
1567
1579
while True :
1568
1580
line = proc .stdout .readline ()
@@ -1582,6 +1594,8 @@ def handle_preview_path(v: str):
1582
1594
op .movingfiles_sub_prog = float (value )
1583
1595
case "preview_path" :
1584
1596
handle_preview_path (value )
1597
+ case "out_path" :
1598
+ handle_out_path (value )
1585
1599
case _:
1586
1600
print ("Unhandled Property:" , prop , ", value:" , value )
1587
1601
op .updated = True
@@ -1608,8 +1622,11 @@ def handle_preview_path(v: str):
1608
1622
elif line .startswith ("=" ):
1609
1623
prop , value = line [1 :].split ("=" )
1610
1624
value = value .replace ("\n " , "" )
1611
- if prop == "preview_path" :
1612
- handle_preview_path (value )
1625
+ match prop :
1626
+ case "preview_path" :
1627
+ handle_preview_path (value )
1628
+ case "out_path" :
1629
+ handle_out_path (value )
1613
1630
1614
1631
if proc .returncode > 1 :
1615
1632
print ()
0 commit comments