Asset Pipeline v2 #145
@ -112,7 +112,6 @@ def ownership_set(temp_transfer_data: bpy.types.CollectionProperty) -> None:
|
|||||||
|
|
||||||
def get_invalid_objects(
|
def get_invalid_objects(
|
||||||
local_col: bpy.types.Collection,
|
local_col: bpy.types.Collection,
|
||||||
scene: bpy.types.Scene,
|
|
||||||
) -> list[bpy.types.Object]:
|
) -> list[bpy.types.Object]:
|
||||||
"""Returns a list of objects not used in the merge processing,
|
"""Returns a list of objects not used in the merge processing,
|
||||||
which are considered invalid. The objects will be excluded from
|
which are considered invalid. The objects will be excluded from
|
||||||
@ -129,7 +128,7 @@ def get_invalid_objects(
|
|||||||
task_layer_objs = get_task_layer_objects()
|
task_layer_objs = get_task_layer_objects()
|
||||||
|
|
||||||
invalid_obj = []
|
invalid_obj = []
|
||||||
for obj in scene.objects:
|
for obj in local_col.all_objects:
|
||||||
if obj.asset_id_owner == "NONE":
|
if obj.asset_id_owner == "NONE":
|
||||||
invalid_obj.append(obj)
|
invalid_obj.append(obj)
|
||||||
if obj not in task_layer_objs and obj.asset_id_owner in local_task_layer_keys:
|
if obj not in task_layer_objs and obj.asset_id_owner in local_task_layer_keys:
|
||||||
|
@ -45,7 +45,7 @@ def sync_invoke(self, context):
|
|||||||
|
|
||||||
ownership_get(local_col, context.scene)
|
ownership_get(local_col, context.scene)
|
||||||
|
|
||||||
self._invalid_objs = get_invalid_objects(local_col, context.scene)
|
self._invalid_objs = get_invalid_objects(local_col)
|
||||||
self._shared_ids = init_shared_ids(context.scene)
|
self._shared_ids = init_shared_ids(context.scene)
|
||||||
|
|
||||||
|
|
||||||
@ -119,16 +119,18 @@ def create_temp_file_backup(self, context):
|
|||||||
context.scene.asset_pipeline.temp_file = temp_file.__str__()
|
context.scene.asset_pipeline.temp_file = temp_file.__str__()
|
||||||
return temp_file.__str__()
|
return temp_file.__str__()
|
||||||
|
|
||||||
|
|
||||||
def update_temp_file_paths(self, context, temp_file_path):
|
def update_temp_file_paths(self, context, temp_file_path):
|
||||||
asset_pipe = context.scene.asset_pipeline
|
asset_pipe = context.scene.asset_pipeline
|
||||||
asset_pipe.temp_file = temp_file_path
|
asset_pipe.temp_file = temp_file_path
|
||||||
asset_pipe.source_file = self._current_file.__str__()
|
asset_pipe.source_file = self._current_file.__str__()
|
||||||
|
|
||||||
|
|
||||||
def sync_execute_pull(self, context):
|
def sync_execute_pull(self, context):
|
||||||
temp_file_path = create_temp_file_backup(self, context)
|
temp_file_path = create_temp_file_backup(self, context)
|
||||||
update_temp_file_paths(self, context, temp_file_path)
|
update_temp_file_paths(self, context, temp_file_path)
|
||||||
bpy.ops.wm.save_as_mainfile(filepath=temp_file_path, copy=True)
|
bpy.ops.wm.save_as_mainfile(filepath=temp_file_path, copy=True)
|
||||||
|
|
||||||
error_msg = merge_task_layer(
|
error_msg = merge_task_layer(
|
||||||
context,
|
context,
|
||||||
local_tls=self._task_layer_keys,
|
local_tls=self._task_layer_keys,
|
||||||
@ -147,7 +149,6 @@ def sync_execute_push(self, context):
|
|||||||
|
|
||||||
if self._sync_target not in push_targets:
|
if self._sync_target not in push_targets:
|
||||||
push_targets.append(self._sync_target)
|
push_targets.append(self._sync_target)
|
||||||
|
|
||||||
|
|
||||||
for file in push_targets:
|
for file in push_targets:
|
||||||
file_path = file.__str__()
|
file_path = file.__str__()
|
||||||
|
Loading…
Reference in New Issue
Block a user