Asset Pipeline v2 #145
@ -38,12 +38,17 @@ def get_transfer_data_owner(td_type_key: str, use_default_owner: bool, name=""):
|
||||
|
||||
|
||||
def draw_task_layer_selection(
|
||||
row,
|
||||
scene,
|
||||
data,
|
||||
data_owner,
|
||||
data_owner_name,
|
||||
row, scene, data, data_owner, data_owner_name, use_default_owner=False
|
||||
):
|
||||
if use_default_owner == True:
|
||||
row.prop_search(
|
||||
data,
|
||||
data_owner_name,
|
||||
scene.asset_pipeline,
|
||||
'all_task_layers',
|
||||
text="",
|
||||
)
|
||||
return
|
||||
if data_owner not in [tl.name for tl in scene.asset_pipeline.local_task_layers]:
|
||||
row.enabled = False
|
||||
row.prop_search(
|
||||
@ -53,6 +58,7 @@ def draw_task_layer_selection(
|
||||
'all_task_layers',
|
||||
text="",
|
||||
)
|
||||
return
|
||||
else:
|
||||
row.prop_search(
|
||||
data,
|
||||
|
@ -114,6 +114,7 @@ def init_modifiers(scene, obj, use_default_owner: bool):
|
||||
owner=task_layer_owner,
|
||||
type=td_type_key,
|
||||
obj=obj,
|
||||
use_default_owner=use_default_owner,
|
||||
)
|
||||
|
||||
|
||||
@ -210,6 +211,7 @@ def init_constraints(scene, obj, use_default_owner: bool):
|
||||
owner=task_layer_owner,
|
||||
type=td_type_key,
|
||||
obj=obj,
|
||||
use_default_owner=use_default_owner,
|
||||
)
|
||||
|
||||
|
||||
@ -314,6 +316,7 @@ def init_material_slots(scene, obj, use_default_owner: bool):
|
||||
owner=get_transfer_data_owner(td_type_key, use_default_owner),
|
||||
type=td_type_key,
|
||||
obj=obj,
|
||||
use_default_owner=use_default_owner,
|
||||
)
|
||||
|
||||
|
||||
@ -578,6 +581,7 @@ def init_attributes(scene, obj, use_default_owner: bool):
|
||||
),
|
||||
type=td_type_key,
|
||||
obj=obj,
|
||||
use_default_owner=use_default_owner,
|
||||
)
|
||||
|
||||
|
||||
@ -649,6 +653,7 @@ def init_parent(scene, obj, use_default_owner: bool):
|
||||
owner=get_transfer_data_owner(td_type_key, use_default_owner),
|
||||
type=td_type_key,
|
||||
obj=obj,
|
||||
use_default_owner=use_default_owner,
|
||||
)
|
||||
|
||||
|
||||
|
@ -27,8 +27,14 @@ def draw_transfer_data_type(
|
||||
for transfer_data_item in transfer_data:
|
||||
row = box.row()
|
||||
row.label(text=f"{transfer_data_item.name}: ")
|
||||
|
||||
draw_task_layer_selection(
|
||||
row, scene, transfer_data_item, transfer_data_item.owner, "owner"
|
||||
row,
|
||||
scene,
|
||||
transfer_data_item,
|
||||
transfer_data_item.owner,
|
||||
"owner",
|
||||
transfer_data_item.get("use_default_owner"),
|
||||
)
|
||||
|
||||
|
||||
|
@ -113,4 +113,5 @@ def transfer_data_item_init(
|
||||
owner=get_transfer_data_owner(td_type_key, use_default_owner),
|
||||
type=td_type_key,
|
||||
obj=obj,
|
||||
use_default_owner=use_default_owner,
|
||||
)
|
||||
|
@ -38,12 +38,17 @@ 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.StringProperty(name="Owner", default="NONE")
|
||||
owner: bpy.props.StringProperty(name="OwneAr", default="NONE")
|
||||
type: bpy.props.EnumProperty(
|
||||
name="Transfer Data Type",
|
||||
items=constants.TRANSFER_DATA_TYPES_ENUM_ITEMS,
|
||||
)
|
||||
obj: bpy.props.PointerProperty(type=bpy.types.Object)
|
||||
use_default_owner: bpy.props.BoolProperty(
|
||||
name="Defaults Ownership",
|
||||
description="Default ownership has been used when initializing these properties",
|
||||
default=False,
|
||||
)
|
||||
|
||||
|
||||
class TaskLayerSettings(bpy.types.PropertyGroup):
|
||||
@ -69,13 +74,14 @@ class AssetPipeline(bpy.types.PropertyGroup):
|
||||
|
||||
local_task_layers: bpy.props.StringProperty(name="Local Task Layers", default="")
|
||||
|
||||
def add_temp_transfer_data(self, name, owner, type, obj):
|
||||
def add_temp_transfer_data(self, name, owner, type, obj, use_default_owner=False):
|
||||
new_transfer_data = self.temp_transfer_data
|
||||
transfer_data_item = new_transfer_data.add()
|
||||
transfer_data_item.name = name
|
||||
transfer_data_item.owner = owner
|
||||
transfer_data_item.type = type
|
||||
transfer_data_item.obj = obj
|
||||
transfer_data_item.use_default_owner = use_default_owner
|
||||
|
||||
## NEW FILE
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user