Asset Pipeline v2 #145
@ -124,6 +124,24 @@ class AssetTransferMapping:
|
|||||||
|
|
||||||
return coll_map
|
return coll_map
|
||||||
|
|
||||||
|
def _get_transfer_data_map_item(self, obj, target_obj, transfer_info):
|
||||||
|
temp_transfer_data = bpy.context.scene.asset_pipeline.temp_transfer_data
|
||||||
|
temp_info_index = len(temp_transfer_data)
|
||||||
|
temp_info = transfer_core.transfer_data_add_entry(
|
||||||
|
transfer_data=temp_transfer_data,
|
||||||
|
name=transfer_info.name,
|
||||||
|
td_type=transfer_info.type,
|
||||||
|
task_layer_name=transfer_info.owner,
|
||||||
|
)
|
||||||
|
|
||||||
|
map_item = {
|
||||||
|
'transfer_info_index': temp_info_index,
|
||||||
|
'source_obj': obj,
|
||||||
|
'target_obj': target_obj,
|
||||||
|
}
|
||||||
|
name = transfer_info.name + '_' + obj.name
|
||||||
|
return name, map_item
|
||||||
|
|
||||||
def _gen_transfer_data_map(self):
|
def _gen_transfer_data_map(self):
|
||||||
context = bpy.context
|
context = bpy.context
|
||||||
transfer_data_map: Dict[bpy.types.Collection, bpy.types.Collection] = {}
|
transfer_data_map: Dict[bpy.types.Collection, bpy.types.Collection] = {}
|
||||||
@ -136,37 +154,19 @@ class AssetTransferMapping:
|
|||||||
if obj.name.endswith(constants.LOCAL_SUFFIX):
|
if obj.name.endswith(constants.LOCAL_SUFFIX):
|
||||||
for transfer_info in obj.transfer_data_ownership:
|
for transfer_info in obj.transfer_data_ownership:
|
||||||
if transfer_info.owner in self._local_tls:
|
if transfer_info.owner in self._local_tls:
|
||||||
temp_info_index = len(temp_transfer_data)
|
name, map_item = self._get_transfer_data_map_item(
|
||||||
temp_info = transfer_core.transfer_data_add_entry(
|
obj, target_obj, transfer_info
|
||||||
transfer_data=temp_transfer_data,
|
|
||||||
name=transfer_info.name,
|
|
||||||
td_type=transfer_info.type,
|
|
||||||
task_layer_name=transfer_info.owner,
|
|
||||||
)
|
)
|
||||||
name = transfer_info.name + '_' + obj.name
|
transfer_data_map[name] = map_item
|
||||||
transfer_data_map[name] = {
|
|
||||||
'transfer_info_index': temp_info_index,
|
|
||||||
'source_obj': obj,
|
|
||||||
'target_obj': target_obj,
|
|
||||||
}
|
|
||||||
if obj.name.endswith(constants.EXTERNAL_SUFFIX):
|
if obj.name.endswith(constants.EXTERNAL_SUFFIX):
|
||||||
for transfer_info in obj.transfer_data_ownership:
|
for transfer_info in obj.transfer_data_ownership:
|
||||||
if (
|
if (
|
||||||
transfer_info.owner not in self._local_tls
|
transfer_info.owner not in self._local_tls
|
||||||
and transfer_info.owner != "NONE"
|
and transfer_info.owner != "NONE"
|
||||||
):
|
):
|
||||||
temp_info_index = len(temp_transfer_data)
|
name, map_item = self._get_transfer_data_map_item(
|
||||||
temp_info = transfer_core.transfer_data_add_entry(
|
obj, target_obj, transfer_info
|
||||||
transfer_data=temp_transfer_data,
|
|
||||||
name=transfer_info.name,
|
|
||||||
td_type=transfer_info.type,
|
|
||||||
task_layer_name=transfer_info.owner,
|
|
||||||
)
|
)
|
||||||
|
transfer_data_map[name] = map_item
|
||||||
name = transfer_info.name + '_' + obj.name
|
|
||||||
transfer_data_map[name] = {
|
|
||||||
'transfer_info_index': temp_info_index,
|
|
||||||
'source_obj': obj,
|
|
||||||
'target_obj': target_obj,
|
|
||||||
}
|
|
||||||
return transfer_data_map
|
return transfer_data_map
|
||||||
|
Loading…
Reference in New Issue
Block a user