Asset Pipeline v2 #145

Closed
Nick Alberelli wants to merge 431 commits from (deleted):feature/asset-pipeline-v2 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
5 changed files with 32 additions and 8 deletions
Showing only changes of commit 98e2cce922 - Show all commits

View File

@ -38,12 +38,17 @@ def get_transfer_data_owner(td_type_key: str, use_default_owner: bool, name=""):
def draw_task_layer_selection( def draw_task_layer_selection(
row, row, scene, data, data_owner, data_owner_name, use_default_owner=False
scene,
data,
data_owner,
data_owner_name,
): ):
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]: if data_owner not in [tl.name for tl in scene.asset_pipeline.local_task_layers]:
row.enabled = False row.enabled = False
row.prop_search( row.prop_search(
@ -53,6 +58,7 @@ def draw_task_layer_selection(
'all_task_layers', 'all_task_layers',
text="", text="",
) )
return
else: else:
row.prop_search( row.prop_search(
data, data,

View File

@ -114,6 +114,7 @@ def init_modifiers(scene, obj, use_default_owner: bool):
owner=task_layer_owner, owner=task_layer_owner,
type=td_type_key, type=td_type_key,
obj=obj, 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, owner=task_layer_owner,
type=td_type_key, type=td_type_key,
obj=obj, 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), owner=get_transfer_data_owner(td_type_key, use_default_owner),
type=td_type_key, type=td_type_key,
obj=obj, 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, type=td_type_key,
obj=obj, 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), owner=get_transfer_data_owner(td_type_key, use_default_owner),
type=td_type_key, type=td_type_key,
obj=obj, obj=obj,
use_default_owner=use_default_owner,
) )

View File

@ -27,8 +27,14 @@ def draw_transfer_data_type(
for transfer_data_item in transfer_data: for transfer_data_item in transfer_data:
row = box.row() row = box.row()
row.label(text=f"{transfer_data_item.name}: ") row.label(text=f"{transfer_data_item.name}: ")
draw_task_layer_selection( 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"),
) )

View File

@ -113,4 +113,5 @@ def transfer_data_item_init(
owner=get_transfer_data_owner(td_type_key, use_default_owner), owner=get_transfer_data_owner(td_type_key, use_default_owner),
type=td_type_key, type=td_type_key,
obj=obj, obj=obj,
use_default_owner=use_default_owner,
) )

View File

@ -38,12 +38,17 @@ class AssetTransferDataTemp(bpy.types.PropertyGroup):
"""Class used when finding new ownership data so it can be drawn """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""" 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( type: bpy.props.EnumProperty(
name="Transfer Data Type", name="Transfer Data Type",
items=constants.TRANSFER_DATA_TYPES_ENUM_ITEMS, items=constants.TRANSFER_DATA_TYPES_ENUM_ITEMS,
) )
obj: bpy.props.PointerProperty(type=bpy.types.Object) 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): 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="") 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 new_transfer_data = self.temp_transfer_data
transfer_data_item = new_transfer_data.add() transfer_data_item = new_transfer_data.add()
transfer_data_item.name = name transfer_data_item.name = name
transfer_data_item.owner = owner transfer_data_item.owner = owner
transfer_data_item.type = type transfer_data_item.type = type
transfer_data_item.obj = obj transfer_data_item.obj = obj
transfer_data_item.use_default_owner = use_default_owner
## NEW FILE ## NEW FILE