Asset Pipeline v2 #145
@ -79,20 +79,17 @@ def push_task_layer(
|
||||
|
||||
def pull_task_layer(
|
||||
context: bpy.types.Context,
|
||||
current_task_col: bpy.types.Collection,
|
||||
col_base_name: str,
|
||||
current_tls: list[str],
|
||||
target_col: bpy.types.Collection,
|
||||
target_file: Path,
|
||||
):
|
||||
current_task_col = bpy.data.collections[col_base_name]
|
||||
current_suffix = "TASK"
|
||||
source_suffix = "PUBLISH"
|
||||
target_suffix = "TARGET"
|
||||
asset_suffix.add_suffix_to_hierarchy(current_task_col, current_suffix)
|
||||
|
||||
current_file = Path(bpy.data.filepath)
|
||||
pub_file = find_published_file(
|
||||
current_file
|
||||
) # TODO if this function is used in PULL then this needs to be a variable set by the operator instead
|
||||
import_data_from_lib(pub_file, "collections", col_base_name)
|
||||
import_data_from_lib(target_file, "collections", col_base_name)
|
||||
appended_col = bpy.data.collections[col_base_name] # find appended data
|
||||
asset_suffix.add_suffix_to_hierarchy(appended_col, source_suffix)
|
||||
|
||||
|
@ -49,15 +49,15 @@ class ASSETPIPE_OT_pull_test(bpy.types.Operator):
|
||||
bl_label = 'Pull from Publish'
|
||||
|
||||
def execute(self, context):
|
||||
current_file = Path(bpy.data.filepath)
|
||||
current_tl = current_file.name.split('.')[-2]
|
||||
pub_file = core.find_published_file(current_file)
|
||||
col_base_name = "CH-chr_test" # TODO replace hard coded value
|
||||
current_task_col = bpy.data.collections[col_base_name]
|
||||
core.pull_task_layer(
|
||||
context,
|
||||
current_task_col=current_task_col,
|
||||
col_base_name=col_base_name,
|
||||
current_tls=[current_tl],
|
||||
current_tl="MODEL",
|
||||
target_file=pub_file,
|
||||
)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user