Asset Pipeline v2 #145
@ -167,67 +167,31 @@ class AssetTransferMapping:
|
||||
if not other_obj:
|
||||
return
|
||||
for other_transfer_data_item in other_obj.transfer_data_ownership:
|
||||
if (
|
||||
other_transfer_data_item.type == transfer_data_item.type
|
||||
and other_transfer_data_item.name == transfer_data_item.name
|
||||
if other_transfer_data_item.type == transfer_data_item.type and (
|
||||
task_layer_prefix_basename_get(other_transfer_data_item.name)
|
||||
== task_layer_prefix_basename_get(transfer_data_item.name)
|
||||
):
|
||||
check_transfer_data_item = other_transfer_data_item
|
||||
if check_transfer_data_item is None:
|
||||
return
|
||||
if check_transfer_data_item.owner != transfer_data_item.owner:
|
||||
if check_transfer_data_item.owner != transfer_data_item.owner and not (
|
||||
check_transfer_data_item.surrender or transfer_data_item.surrender
|
||||
):
|
||||
self.conflict_transfer_data.append(transfer_data_item)
|
||||
print("CONFLICT FOUND")
|
||||
return True
|
||||
|
||||
def transfer_data_map_surrendered(self, transfer_data_item):
|
||||
def transfer_data_get_other(self, transfer_data_item):
|
||||
# THIS IS FOR WHEN SURRENDERED DATA HAS BEEN REPLACED
|
||||
obj = transfer_data_item.id_data
|
||||
other_obj = bpy.data.objects.get(get_target_name(obj.name))
|
||||
other_transfer_data_item = None
|
||||
# Find Related Transfer Data Item on Target/Source Object
|
||||
for other_obj_transfer_data_item in other_obj.transfer_data_ownership:
|
||||
if task_layer_prefix_basename_get(
|
||||
other_obj_transfer_data_item.name
|
||||
) == task_layer_prefix_basename_get(transfer_data_item.name):
|
||||
other_transfer_data_item = other_obj_transfer_data_item
|
||||
|
||||
# TODO CONSIDER PREFIXES
|
||||
|
||||
if not other_transfer_data_item:
|
||||
return None, None
|
||||
|
||||
# If the other transfer data is surrendered map it accordingly
|
||||
if (
|
||||
other_transfer_data_item.surrender
|
||||
and not transfer_data_item.surrender
|
||||
and other_transfer_data_item.owner != transfer_data_item.owner
|
||||
):
|
||||
if transfer_data_item.owner in self._local_tls:
|
||||
target_obj = obj
|
||||
source_obj = other_obj
|
||||
else:
|
||||
target_obj = other_obj
|
||||
source_obj = obj
|
||||
|
||||
return self._get_transfer_data_map_item(
|
||||
source_obj, target_obj, transfer_data_item
|
||||
)
|
||||
|
||||
if (
|
||||
transfer_data_item.surrender
|
||||
and not other_transfer_data_item.surrender
|
||||
and other_transfer_data_item.owner != transfer_data_item.owner
|
||||
):
|
||||
if other_transfer_data_item.owner in self._local_tls:
|
||||
target_obj = obj
|
||||
source_obj = other_obj
|
||||
else:
|
||||
target_obj = other_obj
|
||||
source_obj = obj
|
||||
|
||||
return self._get_transfer_data_map_item(
|
||||
source_obj, target_obj, other_transfer_data_item
|
||||
)
|
||||
return None, None
|
||||
return other_obj_transfer_data_item
|
||||
return None
|
||||
|
||||
def _gen_transfer_data_map(self):
|
||||
context = bpy.context
|
||||
@ -239,18 +203,19 @@ class AssetTransferMapping:
|
||||
objs = [source_obj, target_obj]
|
||||
for obj in objs:
|
||||
for transfer_data_item in obj.transfer_data_ownership:
|
||||
name, map_item = self.transfer_data_map_surrendered(
|
||||
transfer_data_item
|
||||
)
|
||||
if bool(name and map_item):
|
||||
transfer_data_map[name] = map_item
|
||||
continue
|
||||
|
||||
self._check_transfer_data_conflict(obj, transfer_data_item)
|
||||
if (
|
||||
transfer_data_item.owner in self._local_tls
|
||||
and obj.name.endswith(constants.LOCAL_SUFFIX)
|
||||
):
|
||||
other_td = self.transfer_data_get_other(transfer_data_item)
|
||||
if other_td:
|
||||
if (
|
||||
transfer_data_item.surrender
|
||||
and not other_td.surrender
|
||||
and transfer_data_item.owner != other_td.owner
|
||||
):
|
||||
continue
|
||||
name, map_item = self._get_transfer_data_map_item(
|
||||
obj, target_obj, transfer_data_item
|
||||
)
|
||||
@ -261,6 +226,15 @@ class AssetTransferMapping:
|
||||
and transfer_data_item.owner != "NONE"
|
||||
and obj.name.endswith(constants.EXTERNAL_SUFFIX)
|
||||
):
|
||||
other_td = self.transfer_data_get_other(transfer_data_item)
|
||||
if other_td:
|
||||
if (
|
||||
transfer_data_item.surrender
|
||||
and not other_td.surrender
|
||||
and transfer_data_item.owner != other_td.owner
|
||||
):
|
||||
continue
|
||||
|
||||
name, map_item = self._get_transfer_data_map_item(
|
||||
obj, target_obj, transfer_data_item
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user