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,17 +18,13 @@ 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:
for target_obj in target_objs:
if asset_suffix.get_basename(target_obj.name) == asset_suffix.get_basename(
item.id_data.name
):
if item.type == constants.VERTEX_GROUP_KEY: if item.type == constants.VERTEX_GROUP_KEY:
print(f"Transfering Data {constants.VERTEX_GROUP_KEY}: {name}")
transfer_functions.transfer_vertex_group( transfer_functions.transfer_vertex_group(
context=context, context=context,
vertex_group_name=item.name, vertex_group_name=item.name,
@ -36,8 +32,10 @@ def apply_transfer_data(
obj_source=item.id_data, obj_source=item.id_data,
) )
if item.type == constants.MODIFIER_KEY: if item.type == constants.MODIFIER_KEY:
print(f"Transfering Data {constants.MODIFIER_KEY}: {name}")
transfer_functions.transfer_modifier(item, target_obj) transfer_functions.transfer_modifier(item, target_obj)
if item.type == constants.MATERIAL_SLOT_KEY: if item.type == constants.MATERIAL_SLOT_KEY:
print(f"Transfering Data {constants.MATERIAL_SLOT_KEY}: {name}")
transfer_functions.transfer_material_slot(item, target_obj) transfer_functions.transfer_material_slot(item, target_obj)
update_transfer_data_ownership( update_transfer_data_ownership(
transfer_data_item=item, transfer_data_item=item,