Asset Pipeline v2 #145
@ -15,6 +15,8 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
||||
bl_label = "Sync with Publish"
|
||||
bl_description = """Push and or Pull data from Published file. Will prompt with a list of new data found before pushing"""
|
||||
|
||||
_temp_ownership = None
|
||||
|
||||
save: bpy.props.BoolProperty(
|
||||
name="Save Current File",
|
||||
default=True,
|
||||
@ -32,9 +34,8 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
||||
)
|
||||
|
||||
def invoke(self, context: bpy.types.Context, event: bpy.types.Event):
|
||||
# TODO Store ownership in self for easier access?
|
||||
ownership = context.scene.temp_transfer_data_ownership
|
||||
ownership.clear()
|
||||
self._temp_ownership = context.scene.temp_transfer_data_ownership
|
||||
self._temp_ownership.clear()
|
||||
|
||||
local_col = bpy.data.collections.get(get_parent_col_name())
|
||||
if not local_col:
|
||||
@ -44,7 +45,7 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
||||
if not task_layer_name:
|
||||
self.report({'ERROR'}, "Current File Name doesn't contain valid task layer")
|
||||
return {'CANCELLED'}
|
||||
core.get_ownership(local_col, task_layer_name, ownership)
|
||||
core.get_ownership(local_col, task_layer_name, self._temp_ownership)
|
||||
|
||||
# Default behaviour is to pull before pushing
|
||||
if self.push:
|
||||
@ -53,22 +54,21 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
||||
|
||||
def draw(self, context: bpy.types.Context):
|
||||
layout = self.layout
|
||||
ownership = context.scene.temp_transfer_data_ownership
|
||||
|
||||
row = layout.row()
|
||||
if self.push:
|
||||
row.prop(self, "pull")
|
||||
row.prop(self, "save")
|
||||
|
||||
if len(ownership) == 0:
|
||||
if len(self._temp_ownership) == 0:
|
||||
layout.label(text="No New Transfer Data found")
|
||||
else:
|
||||
layout.label(text="New Transfer Data will be Pushed to Publish")
|
||||
|
||||
objs = [item.obj for item in ownership]
|
||||
objs = [item.obj for item in self._temp_ownership]
|
||||
|
||||
for obj in set(objs):
|
||||
obj_ownership = [item for item in ownership if item.obj == obj]
|
||||
obj_ownership = [item for item in self._temp_ownership if item.obj == obj]
|
||||
box = layout.box()
|
||||
box.label(text=obj.name, icon="OBJECT_DATA")
|
||||
transfer_ui.draw_transfer_data(obj_ownership, box)
|
||||
|
Loading…
Reference in New Issue
Block a user