Asset Pipeline v2 #145
@ -298,15 +298,6 @@ def import_data_from_lib(
|
|||||||
return eval(f"bpy.data.{data_category}['{data_name}']")
|
return eval(f"bpy.data.{data_category}['{data_name}']")
|
||||||
|
|
||||||
|
|
||||||
def get_task_layer_name_from_file() -> str:
|
|
||||||
"""Returns task layer name found task's file name"""
|
|
||||||
context = util.get_stored_context()
|
|
||||||
file_name = bpy.path.basename(context.blend_data.filepath)
|
|
||||||
task_layer_name = file_name.split(".")[-2]
|
|
||||||
if task_layer_name in constants.TASK_LAYER_KEYS:
|
|
||||||
return task_layer_name
|
|
||||||
|
|
||||||
|
|
||||||
def get_dict_tuple_item(dict: dict, key: str) -> tuple:
|
def get_dict_tuple_item(dict: dict, key: str) -> tuple:
|
||||||
"""For a dict of tuples, returns a dict item based on it's key"""
|
"""For a dict of tuples, returns a dict item based on it's key"""
|
||||||
for item in dict:
|
for item in dict:
|
||||||
|
@ -119,8 +119,8 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
|||||||
if not local_col:
|
if not local_col:
|
||||||
self.report({'ERROR'}, "Top level collection could not be found")
|
self.report({'ERROR'}, "Top level collection could not be found")
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
task_layer_name = core.get_task_layer_name_from_file()
|
task_layer_name = context.scene.asset_pipeline.task_layer_name
|
||||||
if not task_layer_name:
|
if task_layer_name == "NONE":
|
||||||
self.report({'ERROR'}, "Current File Name doesn't contain valid task layer")
|
self.report({'ERROR'}, "Current File Name doesn't contain valid task layer")
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
@ -168,8 +168,8 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
|||||||
temp_transfer_data = context.scene.asset_pipeline.temp_transfer_data
|
temp_transfer_data = context.scene.asset_pipeline.temp_transfer_data
|
||||||
core.ownership_set(temp_transfer_data)
|
core.ownership_set(temp_transfer_data)
|
||||||
current_file = Path(bpy.data.filepath)
|
current_file = Path(bpy.data.filepath)
|
||||||
task_layer_name = core.get_task_layer_name_from_file()
|
task_layer_name = context.scene.asset_pipeline.task_layer_name
|
||||||
if not task_layer_name:
|
if task_layer_name == "NONE":
|
||||||
self.report({'ERROR'}, "Current File Name doesn't contain valid task layer")
|
self.report({'ERROR'}, "Current File Name doesn't contain valid task layer")
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user