Asset Pipeline v2 #145
@ -23,7 +23,6 @@ def draw_transfer_data_type(
|
||||
if not bool(asset_pipe.get(ui_bool)):
|
||||
return
|
||||
|
||||
scene = bpy.context.scene
|
||||
for transfer_data_item in transfer_data:
|
||||
row = box.row()
|
||||
row.label(text=f"{transfer_data_item.name}: ")
|
||||
@ -34,17 +33,29 @@ def draw_transfer_data_type(
|
||||
if transfer_data_item.owner in asset_pipe.get_local_task_layers()
|
||||
else True
|
||||
)
|
||||
row.operator(
|
||||
# Disable entire row if the item is surrender (prevents user from un-surrendering)
|
||||
row.enabled = enabled
|
||||
col = row.column()
|
||||
col.operator(
|
||||
"assetpipe.update_surrendered_transfer_data"
|
||||
).transfer_data_item_name = transfer_data_item.name
|
||||
row.enabled = enabled
|
||||
else:
|
||||
row.prop(transfer_data_item, "surrender", text="Surrender")
|
||||
draw_task_layer_selection(
|
||||
layout=row,
|
||||
data=transfer_data_item,
|
||||
show_all_task_layers=transfer_data_item.get("use_default_owner"),
|
||||
)
|
||||
|
||||
# New Row inside a column because draw_task_layer_selection() will enable/disable the entire row
|
||||
# Only need this to affect itself and the "surrender" property
|
||||
col = row.column()
|
||||
task_layer_row = col.row()
|
||||
|
||||
draw_task_layer_selection(
|
||||
layout=task_layer_row,
|
||||
data=transfer_data_item,
|
||||
show_all_task_layers=transfer_data_item.get("use_default_owner"),
|
||||
)
|
||||
surrender_icon = (
|
||||
"ORPHAN_DATA" if transfer_data_item.get("surrender") else "HEART"
|
||||
)
|
||||
task_layer_row.prop(
|
||||
transfer_data_item, "surrender", text="", icon=surrender_icon
|
||||
)
|
||||
|
||||
|
||||
def draw_transfer_data(
|
||||
|
@ -135,11 +135,18 @@ class ASSETPIPE_PT_ownership_inspector(bpy.types.Panel):
|
||||
if obj.asset_id_owner in asset_pipe.get_local_task_layers()
|
||||
else True
|
||||
)
|
||||
row.operator("assetpipe.update_surrendered_object")
|
||||
row.enabled = enabled
|
||||
else:
|
||||
row.prop(obj, "asset_id_surrender", text="Surrender")
|
||||
draw_task_layer_selection(layout=row, data=obj)
|
||||
col = row.column()
|
||||
col.operator("assetpipe.update_surrendered_object")
|
||||
|
||||
# New Row inside a column because draw_task_layer_selection() will enable/disable the entire row
|
||||
# Only need this to affect itself and the "surrender" property
|
||||
col = row.column()
|
||||
task_layer_row = col.row()
|
||||
|
||||
draw_task_layer_selection(layout=task_layer_row, data=obj)
|
||||
surrender_icon = "ORPHAN_DATA" if obj.get("asset_id_surrender") else "HEART"
|
||||
task_layer_row.prop(obj, "asset_id_surrender", text="", icon=surrender_icon)
|
||||
draw_transfer_data(transfer_data, layout)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user