Asset Pipeline v2 #145
@ -1,6 +1,6 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
from . import asset_suffix, datablocks, transferable_data
|
from . import asset_suffix, transferable_data
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from .asset_mapping import AssetTransferMapping
|
from .asset_mapping import AssetTransferMapping
|
||||||
|
@ -9,7 +9,7 @@ def get_parent_col_name():
|
|||||||
return "CH-chr_test" # TODO Replace Hard Coded Value
|
return "CH-chr_test" # TODO Replace Hard Coded Value
|
||||||
|
|
||||||
|
|
||||||
def get_task_layer_name_from_file(self):
|
def get_task_layer_name_from_file():
|
||||||
file_name = bpy.path.basename(bpy.context.blend_data.filepath)
|
file_name = bpy.path.basename(bpy.context.blend_data.filepath)
|
||||||
task_layer_name = file_name.split(".")[-2]
|
task_layer_name = file_name.split(".")[-2]
|
||||||
if task_layer_name in constants.TASK_LAYER_KEYS:
|
if task_layer_name in constants.TASK_LAYER_KEYS:
|
||||||
@ -22,7 +22,7 @@ class ASSETPIPE_OT_update_ownership(bpy.types.Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
obj = context.active_object
|
obj = context.active_object
|
||||||
task_layer_name = get_task_layer_name_from_file(self)
|
task_layer_name = get_task_layer_name_from_file()
|
||||||
if not task_layer_name:
|
if not task_layer_name:
|
||||||
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'}
|
||||||
@ -39,7 +39,7 @@ class ASSETPIPE_OT_push_test(bpy.types.Operator):
|
|||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
# Find current task Layer
|
# Find current task Layer
|
||||||
current_file = Path(bpy.data.filepath)
|
current_file = Path(bpy.data.filepath)
|
||||||
task_layer_name = get_task_layer_name_from_file(self)
|
task_layer_name = get_task_layer_name_from_file()
|
||||||
if not task_layer_name:
|
if not task_layer_name:
|
||||||
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'}
|
||||||
@ -72,7 +72,7 @@ class ASSETPIPE_OT_pull_test(bpy.types.Operator):
|
|||||||
bl_label = 'Pull from Publish'
|
bl_label = 'Pull from Publish'
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
task_layer_name = get_task_layer_name_from_file(self)
|
task_layer_name = get_task_layer_name_from_file()
|
||||||
if not task_layer_name:
|
if not task_layer_name:
|
||||||
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