Asset Pipeline: Improve Performance #235

Merged
Showing only changes of commit b832586442 - Show all commits

View File

@ -235,12 +235,17 @@ class AssetTransferMapping:
source_obj, target_obj, transfer_data_item source_obj, target_obj, transfer_data_item
) )
if not source_obj in self.transfer_data_map: if not source_obj in self.transfer_data_map:
self.transfer_data_map[source_obj] = {td_type_key: [transfer_data_dict]} self.transfer_data_map[source_obj] = {
"target_obj": target_obj,
"td_types": {td_type_key: [transfer_data_dict]},
}
return
if not td_type_key in self.transfer_data_map[source_obj]: if not td_type_key in self.transfer_data_map[source_obj]["td_types"]:
self.transfer_data_map[source_obj][td_type_key] = [transfer_data_dict] self.transfer_data_map[source_obj]["td_types"][td_type_key] = [transfer_data_dict]
return
else: else:
self.transfer_data_map[source_obj][td_type_key].append(transfer_data_dict) self.transfer_data_map[source_obj]["td_types"][td_type_key].append(transfer_data_dict)
def _transfer_data_map_item(self, source_obj, target_obj, transfer_data_item): def _transfer_data_map_item(self, source_obj, target_obj, transfer_data_item):
"""Verifies if Transfer Data Item is valid/can be mapped""" """Verifies if Transfer Data Item is valid/can be mapped"""
@ -278,9 +283,9 @@ class AssetTransferMapping:
index_map = {} index_map = {}
for source_obj in self.transfer_data_map: for source_obj in self.transfer_data_map:
for td_type_key, td_items in self.transfer_data_map[source_obj].items(): target_obj = self.transfer_data_map[source_obj]["target_obj"]
for td_item in td_items: td_types = self.transfer_data_map[source_obj]["td_types"]
target_obj = td_item["target_obj"] for td_type_key, _ in td_types.items():
if td_type_key != constants.MATERIAL_SLOT_KEY: if td_type_key != constants.MATERIAL_SLOT_KEY:
continue continue
if source_obj.type != 'MESH': if source_obj.type != 'MESH':