Asset Pipeline v2 #145
@ -198,7 +198,7 @@ def get_task_layer_name_from_file():
|
||||
return task_layer_name
|
||||
|
||||
|
||||
def get_enum_item(enum, key):
|
||||
for item in enum:
|
||||
def get_dict_tuple_item(dict: dict, key: str) -> tuple:
|
||||
for item in dict:
|
||||
if item[0] == key:
|
||||
return item
|
||||
|
@ -178,7 +178,7 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
||||
error_msg = core.merge_task_layer(
|
||||
context,
|
||||
local_tls=[task_layer_name],
|
||||
target_file=sync_target,
|
||||
external_file=sync_target,
|
||||
)
|
||||
|
||||
if error_msg:
|
||||
@ -212,7 +212,7 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
||||
error_msg = core.merge_task_layer(
|
||||
context,
|
||||
local_tls=local_tls,
|
||||
target_file=current_file,
|
||||
external_file=current_file,
|
||||
)
|
||||
if error_msg:
|
||||
bpy.ops.wm.open_mainfile(filepath=current_file.__str__())
|
||||
|
@ -4,11 +4,11 @@ from .. import constants, core
|
||||
def draw_transfer_data_type(layout, items):
|
||||
if items == []:
|
||||
return
|
||||
name = core.get_enum_item(constants.TRANSFER_DATA_TYPES, items[0].type)[1]
|
||||
name = core.get_dict_tuple_item(constants.TRANSFER_DATA_TYPES, items[0].type)[1]
|
||||
box = layout.box()
|
||||
box.label(text=name, icon=items[0].type)
|
||||
for item in items:
|
||||
owner = core.get_enum_item(constants.TASK_LAYER_ITEMS, item.owner)[1]
|
||||
owner = core.get_dict_tuple_item(constants.TASK_LAYER_ITEMS, item.owner)[1]
|
||||
box.label(text=f"{item.name}: '{owner}'")
|
||||
|
||||
|
||||
|
@ -53,7 +53,9 @@ class ASSETPIPE_ownership_inspector(bpy.types.Panel):
|
||||
obj = context.active_object
|
||||
ownership = obj.transfer_data_ownership
|
||||
layout = layout.box()
|
||||
owner = core.get_enum_item(constants.TASK_LAYER_ITEMS, obj.asset_id_owner)[1]
|
||||
owner = core.get_dict_tuple_item(
|
||||
constants.TASK_LAYER_ITEMS, obj.asset_id_owner
|
||||
)[1]
|
||||
layout.label(text=f"{obj.name}: '{owner}'", icon="OBJECT_DATA")
|
||||
transfer_ui.draw_transfer_data(ownership, layout)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user