Asset Pipeline v2 #145
@ -40,6 +40,7 @@ class AssetTransferMapping:
|
||||
def generate_mapping(self) -> None:
|
||||
self.object_map = self._gen_object_map()
|
||||
self.collection_map = self._gen_collection_map()
|
||||
self.transfer_data_map = self._gen_transfer_data_map()
|
||||
|
||||
def _get_external_object(self, local_obj):
|
||||
external_obj_name = asset_suffix.get_target_name(
|
||||
@ -117,3 +118,23 @@ class AssetTransferMapping:
|
||||
self._no_match_target_colls = all_tgt_colls - match_target_colls
|
||||
|
||||
return coll_map
|
||||
|
||||
def _gen_transfer_data_map(self):
|
||||
transfer_data_map: Dict[bpy.types.Collection, bpy.types.Collection] = {}
|
||||
|
||||
for obj in self._external_col.all_objects:
|
||||
for item in obj.transfer_data_ownership:
|
||||
if item.owner not in self._local_tls:
|
||||
name = item.name + '_' + obj.name
|
||||
target_obj_name = asset_suffix.get_target_name(obj.name)
|
||||
target_obj = self._local_col.all_objects.get(target_obj_name)
|
||||
transfer_data_map[name] = (item, target_obj)
|
||||
|
||||
for obj in self._local_col.all_objects:
|
||||
for item in obj.transfer_data_ownership:
|
||||
if item.owner in self._local_tls:
|
||||
name = item.name + '_' + obj.name
|
||||
target_obj_name = asset_suffix.get_target_name(obj.name)
|
||||
target_obj = self._external_col.all_objects.get(target_obj_name)
|
||||
transfer_data_map[name] = (item, target_obj)
|
||||
return transfer_data_map
|
||||
|
Loading…
Reference in New Issue
Block a user