Asset Pipeline v2 #145
@ -1,5 +1,6 @@
|
||||
import bpy
|
||||
from ... import constants
|
||||
from ..task_layer import get_local_task_layers
|
||||
|
||||
|
||||
def draw_transfer_data_type(
|
||||
@ -11,9 +12,29 @@ def draw_transfer_data_type(
|
||||
name, icon = constants.TRANSFER_DATA_TYPES[transfer_data[0].type]
|
||||
box = layout.box()
|
||||
box.label(text=name, icon=icon)
|
||||
scene = bpy.context.scene
|
||||
for transfer_data_item in transfer_data:
|
||||
owner_tl_ui_name = constants.TASK_LAYER_TYPES[transfer_data_item.owner]
|
||||
box.label(text=f"{transfer_data_item.name}: '{owner_tl_ui_name}'")
|
||||
row = layout.row()
|
||||
row.label(text=f"{transfer_data_item.name}: ")
|
||||
if transfer_data_item.owner not in [
|
||||
tl.name for tl in scene.asset_pipeline.local_task_layers
|
||||
]:
|
||||
row.enabled = False
|
||||
row.prop_search(
|
||||
transfer_data_item,
|
||||
'owner',
|
||||
scene.asset_pipeline,
|
||||
'all_task_layers',
|
||||
text="",
|
||||
)
|
||||
else:
|
||||
row.prop_search(
|
||||
transfer_data_item,
|
||||
'owner',
|
||||
scene.asset_pipeline,
|
||||
'local_task_layers',
|
||||
text="",
|
||||
)
|
||||
|
||||
|
||||
def draw_transfer_data(
|
||||
|
@ -1,6 +1,6 @@
|
||||
import bpy
|
||||
from ..naming import get_basename
|
||||
from ..task_layer import get_transfer_data_owner
|
||||
from ..task_layer import get_transfer_data_owner, get_local_task_layers
|
||||
|
||||
|
||||
def check_transfer_data_entry(
|
||||
@ -40,7 +40,7 @@ def transfer_data_add_entry(
|
||||
"""
|
||||
transfer_data_item = transfer_data.add()
|
||||
transfer_data_item.name = name
|
||||
transfer_data_item.owner = task_layer_name.upper()
|
||||
transfer_data_item.owner = task_layer_name
|
||||
transfer_data_item.type = td_type_key
|
||||
return transfer_data_item
|
||||
|
||||
|
@ -10,10 +10,7 @@ avaliable task layers from the task_layer_defaults.json file that needs to be cr
|
||||
class AssetTransferData(bpy.types.PropertyGroup):
|
||||
"""Properties to track transferable data on an object"""
|
||||
|
||||
owner: bpy.props.EnumProperty(
|
||||
name="Transfer Data Owner",
|
||||
items=constants.TASK_LAYER_TYPES_ENUM_ITEMS,
|
||||
)
|
||||
owner: bpy.props.StringProperty()
|
||||
type: bpy.props.EnumProperty(
|
||||
name="Transfer Data Type",
|
||||
items=constants.TRANSFER_DATA_TYPES_ENUM_ITEMS,
|
||||
@ -24,10 +21,7 @@ class AssetTransferDataTemp(bpy.types.PropertyGroup):
|
||||
"""Class used when finding new ownership data so it can be drawn
|
||||
with the same method as the existing ownership data from ASSET_TRANSFER_DATA"""
|
||||
|
||||
owner: bpy.props.EnumProperty(
|
||||
name="Transfer Data Owner",
|
||||
items=constants.TASK_LAYER_TYPES_ENUM_ITEMS,
|
||||
)
|
||||
owner: bpy.props.StringProperty()
|
||||
type: bpy.props.EnumProperty(
|
||||
name="Transfer Data Type",
|
||||
items=constants.TRANSFER_DATA_TYPES_ENUM_ITEMS,
|
||||
|
Loading…
Reference in New Issue
Block a user