Asset Pipeline v2 #145
@ -35,6 +35,9 @@ class AssetTransferMapping:
|
||||
self._no_match_source_colls: Set[bpy.types.Object] = set()
|
||||
self._no_match_target_colls: Set[bpy.types.Object] = set()
|
||||
|
||||
self.conflict_objects = []
|
||||
self.conflict_trasnfer_data = []
|
||||
|
||||
self.generate_mapping()
|
||||
|
||||
def generate_mapping(self) -> None:
|
||||
@ -67,12 +70,16 @@ class AssetTransferMapping:
|
||||
if local_obj.asset_id_owner in self._local_tls:
|
||||
external_obj = self._get_external_object(local_obj)
|
||||
if external_obj:
|
||||
if external_obj.asset_id_owner != local_obj.asset_id_owner:
|
||||
self.conflict_objects.append(local_obj)
|
||||
object_map[external_obj] = local_obj
|
||||
|
||||
# IF ITEM IS NOT OWNED BY LOCAL TASK LAYERS
|
||||
else:
|
||||
external_obj = self._get_external_object(local_obj)
|
||||
if external_obj:
|
||||
if external_obj.asset_id_owner != local_obj.asset_id_owner:
|
||||
self.conflict_objects.append(local_obj)
|
||||
object_map[local_obj] = external_obj
|
||||
else:
|
||||
# REMOVE OBJ NOT OWNED BY LOCAL TASK LAYER THAT HAS NO MATCH
|
||||
|
@ -168,6 +168,13 @@ def merge_task_layer(
|
||||
for conflict in map.conflict_trasnfer_data:
|
||||
error_msg += f"Transfer Data conflict found for '{conflict.name}' on obj '{conflict.id_data.name}'\n"
|
||||
return error_msg
|
||||
|
||||
if len(map.conflict_objects) != 0:
|
||||
error_msg = ''
|
||||
for conflict_obj in map.conflict_objects:
|
||||
error_msg += f"Ownership conflic found for '{conflict_obj.name}'\n"
|
||||
return error_msg
|
||||
|
||||
# Remove all transfer data from target objects
|
||||
for source_obj in map.object_map:
|
||||
target_obj = map.object_map[source_obj]
|
||||
|
Loading…
Reference in New Issue
Block a user