Asset Pipeline v2 #145
@ -16,9 +16,9 @@ def get_task_layer_name_from_file():
|
|||||||
return task_layer_name
|
return task_layer_name
|
||||||
|
|
||||||
|
|
||||||
class ASSETPIPE_OT_update_ownership(bpy.types.Operator):
|
class ASSETPIPE_OT_push_test(bpy.types.Operator):
|
||||||
bl_idname = "assetpipe.update_ownership"
|
bl_idname = "assetpipe.push_test"
|
||||||
bl_label = 'Update Ownership'
|
bl_label = 'Push to Publish'
|
||||||
|
|
||||||
_new_transfer_data = {}
|
_new_transfer_data = {}
|
||||||
|
|
||||||
@ -60,22 +60,16 @@ class ASSETPIPE_OT_update_ownership(bpy.types.Operator):
|
|||||||
for key in constants.TRANSFER_DATA_KEYS:
|
for key in constants.TRANSFER_DATA_KEYS:
|
||||||
self.draw_transfer_data_items(layout, key)
|
self.draw_transfer_data_items(layout, key)
|
||||||
|
|
||||||
def execute(self, context: bpy.types.Context):
|
|
||||||
core.set_ownership(self._new_transfer_data)
|
|
||||||
return {'FINISHED'}
|
|
||||||
|
|
||||||
|
|
||||||
class ASSETPIPE_OT_push_test(bpy.types.Operator):
|
|
||||||
bl_idname = "assetpipe.push_test"
|
|
||||||
bl_label = 'Push to Publish'
|
|
||||||
|
|
||||||
def execute(self, context: bpy.types.Context):
|
def execute(self, context: bpy.types.Context):
|
||||||
# Find current task Layer
|
# Find current task Layer
|
||||||
|
|
||||||
|
core.set_ownership(self._new_transfer_data)
|
||||||
current_file = Path(bpy.data.filepath)
|
current_file = Path(bpy.data.filepath)
|
||||||
task_layer_name = get_task_layer_name_from_file()
|
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'}
|
||||||
|
|
||||||
pub_file = core.find_published_file(current_file)
|
pub_file = core.find_published_file(current_file)
|
||||||
pub_file_path = pub_file.__str__()
|
pub_file_path = pub_file.__str__()
|
||||||
bpy.ops.wm.open_mainfile(filepath=pub_file_path)
|
bpy.ops.wm.open_mainfile(filepath=pub_file_path)
|
||||||
@ -126,7 +120,6 @@ class ASSETPIPE_OT_pull_test(bpy.types.Operator):
|
|||||||
classes = (
|
classes = (
|
||||||
ASSETPIPE_OT_push_test,
|
ASSETPIPE_OT_push_test,
|
||||||
ASSETPIPE_OT_pull_test,
|
ASSETPIPE_OT_pull_test,
|
||||||
ASSETPIPE_OT_update_ownership,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ class ASSETPIPE_PT_TestUI(bpy.types.Panel):
|
|||||||
text=f"Active Task Layer: {context.collection.name.split('.')[-1]}"
|
text=f"Active Task Layer: {context.collection.name.split('.')[-1]}"
|
||||||
)
|
)
|
||||||
self.layout.label(text="Test UI")
|
self.layout.label(text="Test UI")
|
||||||
self.layout.operator("assetpipe.update_ownership")
|
|
||||||
self.layout.operator("assetpipe.push_test", icon="TRIA_UP")
|
self.layout.operator("assetpipe.push_test", icon="TRIA_UP")
|
||||||
self.layout.operator("assetpipe.pull_test", icon="TRIA_DOWN")
|
self.layout.operator("assetpipe.pull_test", icon="TRIA_DOWN")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user