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.
Showing only changes of commit 06d0e25e8b - Show all commits

View File

@ -40,6 +40,7 @@ class AssetTransferMapping:
def generate_mapping(self) -> None: def generate_mapping(self) -> None:
self.object_map = self._gen_object_map() self.object_map = self._gen_object_map()
self.collection_map = self._gen_collection_map() self.collection_map = self._gen_collection_map()
self.transfer_data_map = self._gen_transfer_data_map()
def _get_external_object(self, local_obj): def _get_external_object(self, local_obj):
external_obj_name = asset_suffix.get_target_name( 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 self._no_match_target_colls = all_tgt_colls - match_target_colls
return coll_map 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