Asset Pipeline v2 #145

Closed
Nick Alberelli wants to merge 431 commits from (deleted):feature/asset-pipeline-v2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 24 additions and 39 deletions
Showing only changes of commit 510af2c8cf - Show all commits

View File

@ -64,20 +64,7 @@ def merge_task_layer(
map = AssetTransferMapping(local_col, external_col, local_tls) map = AssetTransferMapping(local_col, external_col, local_tls)
# Find Transfer Data transfer_core.apply_transfer_data(context, map.transfer_data_map)
transfer_data_items = []
for obj in external_col.all_objects:
for item in obj.transfer_data_ownership:
if item.owner not in local_tls:
transfer_data_items.append(item)
for obj in local_col.all_objects:
for item in obj.transfer_data_ownership:
if item.owner in local_tls:
transfer_data_items.append(item)
target_objs = [map.object_map[obj] for obj in map.object_map]
transfer_core.apply_transfer_data(context, transfer_data_items, target_objs)
for source_obj in map.object_map: for source_obj in map.object_map:
target_obj = map.object_map[source_obj] target_obj = map.object_map[source_obj]

View File

@ -18,31 +18,29 @@ def update_transfer_data_ownership(transfer_data_item, target_obj: bpy.types.Obj
) )
def apply_transfer_data( def apply_transfer_data(context, transfer_data_map):
context: bpy.types.Context, for name in transfer_data_map:
transfer_data_list, transfer_data = transfer_data_map[name]
target_objs: set[bpy.types.Object], item = transfer_data[0]
): target_obj = transfer_data[1]
for item in transfer_data_list: if item.type == constants.VERTEX_GROUP_KEY:
for target_obj in target_objs: print(f"Transfering Data {constants.VERTEX_GROUP_KEY}: {name}")
if asset_suffix.get_basename(target_obj.name) == asset_suffix.get_basename( transfer_functions.transfer_vertex_group(
item.id_data.name context=context,
): vertex_group_name=item.name,
if item.type == constants.VERTEX_GROUP_KEY: obj_target=target_obj,
transfer_functions.transfer_vertex_group( obj_source=item.id_data,
context=context, )
vertex_group_name=item.name, if item.type == constants.MODIFIER_KEY:
obj_target=target_obj, print(f"Transfering Data {constants.MODIFIER_KEY}: {name}")
obj_source=item.id_data, transfer_functions.transfer_modifier(item, target_obj)
) if item.type == constants.MATERIAL_SLOT_KEY:
if item.type == constants.MODIFIER_KEY: print(f"Transfering Data {constants.MATERIAL_SLOT_KEY}: {name}")
transfer_functions.transfer_modifier(item, target_obj) transfer_functions.transfer_material_slot(item, target_obj)
if item.type == constants.MATERIAL_SLOT_KEY: update_transfer_data_ownership(
transfer_functions.transfer_material_slot(item, target_obj) transfer_data_item=item,
update_transfer_data_ownership( target_obj=target_obj,
transfer_data_item=item, )
target_obj=target_obj,
)
def check_transfer_data_entry(ownership, key, td_type): def check_transfer_data_entry(ownership, key, td_type):