Asset Pipeline v2 #145

Closed
Nick Alberelli wants to merge 431 commits from (deleted):feature/asset-pipeline-v2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 55 additions and 1 deletions
Showing only changes of commit de8eae829d - Show all commits

View File

@ -357,6 +357,47 @@ class ASSETPIPE_OT_reset_ownership(bpy.types.Operator):
return {'FINISHED'} return {'FINISHED'}
class ASSETPIPE_OT_update_local_task_layers(bpy.types.Operator):
bl_idname = "assetpipe.update_local_task_layers"
bl_label = "Update Local Task Layers"
bl_description = """Change the Task Layers that are Local to your file"""
# box
@classmethod
def poll(cls, context: bpy.types.Context) -> bool:
asset_pipe = context.scene.asset_pipeline
new_local_tl = [
tl.name for tl in asset_pipe.all_task_layers if tl.is_local == True
]
local_tl = [tl.name for tl in asset_pipe.local_task_layers]
if new_local_tl == local_tl:
cls.poll_message_set("Local Task Layers already match current selection")
return False
return True
def invoke(self, context: bpy.types.Context, event: bpy.types.Event):
return context.window_manager.invoke_props_dialog(self, width=400)
def draw(self, context: bpy.types.Context):
layout = self.layout
layout.alert = True
layout.label(
text="Caution, this only affects current file.",
icon="ERROR",
) # TODO Improve warning
layout.label(
text="Two files owning the same task layer can break merge process."
)
def execute(self, context: bpy.types.Context):
asset_pipe = context.scene.asset_pipeline
all_task_layers = asset_pipe.all_task_layers
local_tl = [tl.name for tl in all_task_layers if tl.is_local == True]
set_local_task_layers(local_tl)
return {'FINISHED'}
classes = ( classes = (
ASSETPIPE_OT_update_ownership, ASSETPIPE_OT_update_ownership,
ASSETPIPE_OT_sync_push, ASSETPIPE_OT_sync_push,
@ -364,6 +405,7 @@ classes = (
ASSETPIPE_OT_publish_new_version, ASSETPIPE_OT_publish_new_version,
ASSETPIPE_OT_create_new_asset, ASSETPIPE_OT_create_new_asset,
ASSETPIPE_OT_reset_ownership, ASSETPIPE_OT_reset_ownership,
ASSETPIPE_OT_update_local_task_layers,
) )

View File

@ -66,7 +66,19 @@ class ASSETPIPE_PT_sync_advanced(bpy.types.Panel):
def draw(self, context: bpy.types.Context) -> None: def draw(self, context: bpy.types.Context) -> None:
layout = self.layout layout = self.layout
layout.operator("assetpipe.reset_ownership") box = layout.box()
box.operator("assetpipe.reset_ownership")
# Task Layer Updater
box = layout.box()
box.label(text="Change Local Task Layers")
row = box.row()
asset_pipe = context.scene.asset_pipeline
all_task_layers = asset_pipe.all_task_layers
for task_layer in all_task_layers:
row.prop(task_layer, "is_local", text=task_layer.name)
box.operator("assetpipe.update_local_task_layers")
class ASSETPIPE_PT_ownership_inspector(bpy.types.Panel): class ASSETPIPE_PT_ownership_inspector(bpy.types.Panel):