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.
Showing only changes of commit 4ef5744b36 - Show all commits

View File

@ -530,26 +530,6 @@ class ASSETPIPE_OT_batch_ownership_change(bpy.types.Operator):
),
)
data_status: bpy.props.EnumProperty(
name="Owner Status",
items=(
('OWNED', "Owned", "Only objects that already have assignment"),
('ALL', "Any", "Set Ownership on any objects, even without an owner"),
),
)
owner_filter: bpy.props.EnumProperty(
name="Owner Status",
items=(
('LOCAL', "Local Task Layers", "Only objects that already have assignment"),
(
'ALL',
"All Task Layers",
"Set Ownership on any objects, even without an owner",
),
),
)
data_type: bpy.props.EnumProperty(
name="Type",
items=(
@ -562,6 +542,27 @@ class ASSETPIPE_OT_batch_ownership_change(bpy.types.Operator):
),
)
filter_owners: bpy.props.EnumProperty(
name="Owner Filter",
items=(
('LOCAL', "If Locally Owned", "Only data that is owned locally"),
('OWNED', "If Owned", "Only data that already have assignment"),
('ALL', "No Filter", "Set Ownership on any data, even without an owner"),
),
)
avaliable_owners: bpy.props.EnumProperty(
name="Avaliable Owners",
items=(
('LOCAL', "Local Task Layers", "Only show local task layers as options"),
(
'ALL',
"All Task Layers",
"Show all task layers as options",
),
),
)
transfer_data_type: bpy.props.EnumProperty(
name="Type Filter", items=constants.TRANSFER_DATA_TYPES_ENUM_ITEMS
)
@ -586,6 +587,12 @@ class ASSETPIPE_OT_batch_ownership_change(bpy.types.Operator):
transfer_data_items_to_update.append(transfer_data_item)
else:
transfer_data_items_to_update.append(transfer_data_item)
if self.filter_owners == "LOCAL":
return [
item
for item in transfer_data_items_to_update
if item.owner in get_local_task_layers()
]
return transfer_data_items_to_update
def _get_object_to_update(self, context):
@ -594,7 +601,13 @@ class ASSETPIPE_OT_batch_ownership_change(bpy.types.Operator):
if self.data_source == "SELECT"
else context.scene.objects
)
if self.data_status == "OWNED":
if self.filter_owners == "LOCAL":
return [
item
for item in self._filter_by_name(context, objs)
if item.asset_id_owner in get_local_task_layers()
]
if self.filter_owners == "OWNED":
return [
item
for item in self._filter_by_name(context, objs)
@ -612,34 +625,37 @@ class ASSETPIPE_OT_batch_ownership_change(bpy.types.Operator):
split = layout.split(align=True)
layout.row(align=True).prop(self, "data_source", expand=True)
# TODO SET HIGHER LEVEL ENUM IF USER WANTS TO UPDATE ONLY LOCALLY OWNED OR ALL OBJECTS
layout.prop(self, "data_type", text="Update Owner of")
if self.data_type == "OBJECT":
box = layout.box()
box.prop(self, "data_status")
box.prop(self, "filter_owners")
if self.data_type == "TRANSFER_DATA":
box = layout.box()
box.prop(self, "transfer_data_type")
box.prop(self, "owner_filter", text="Owner Filter")
box.prop(self, "name_filter", text="Name Filter")
if self.owner_filter == "LOCAL":
if self.avaliable_owners == "LOCAL":
show_local = True
show_all_task_layers = False
else:
show_local = False
show_all_task_layers = True
row = box.row(align=True)
draw_task_layer_selection(
box,
row,
context.scene,
self,
self.owner_selection,
'owner_selection',
show_all_task_layers=show_all_task_layers,
show_local=show_local,
text="Set Owner",
text="Owner",
)
row.prop(self, "avaliable_owners", text="")
# TODO Logically this can't be assigned to all objects, only ones I Own?
# if self.data_type == "TRANSFER_DATA":
# box.prop(self, "surrender_selection", expand=True)