Asset Pipeline v2 #145
@ -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(
|
data_type: bpy.props.EnumProperty(
|
||||||
name="Type",
|
name="Type",
|
||||||
items=(
|
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(
|
transfer_data_type: bpy.props.EnumProperty(
|
||||||
name="Type Filter", items=constants.TRANSFER_DATA_TYPES_ENUM_ITEMS
|
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)
|
transfer_data_items_to_update.append(transfer_data_item)
|
||||||
else:
|
else:
|
||||||
transfer_data_items_to_update.append(transfer_data_item)
|
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
|
return transfer_data_items_to_update
|
||||||
|
|
||||||
def _get_object_to_update(self, context):
|
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"
|
if self.data_source == "SELECT"
|
||||||
else context.scene.objects
|
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 [
|
return [
|
||||||
item
|
item
|
||||||
for item in self._filter_by_name(context, objs)
|
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)
|
split = layout.split(align=True)
|
||||||
layout.row(align=True).prop(self, "data_source", expand=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")
|
layout.prop(self, "data_type", text="Update Owner of")
|
||||||
|
|
||||||
if self.data_type == "OBJECT":
|
box = layout.box()
|
||||||
box = layout.box()
|
|
||||||
box.prop(self, "data_status")
|
box.prop(self, "filter_owners")
|
||||||
|
|
||||||
if self.data_type == "TRANSFER_DATA":
|
if self.data_type == "TRANSFER_DATA":
|
||||||
box = layout.box()
|
|
||||||
box.prop(self, "transfer_data_type")
|
box.prop(self, "transfer_data_type")
|
||||||
box.prop(self, "owner_filter", text="Owner Filter")
|
|
||||||
box.prop(self, "name_filter", text="Name Filter")
|
box.prop(self, "name_filter", text="Name Filter")
|
||||||
|
|
||||||
if self.owner_filter == "LOCAL":
|
if self.avaliable_owners == "LOCAL":
|
||||||
show_local = True
|
show_local = True
|
||||||
show_all_task_layers = False
|
show_all_task_layers = False
|
||||||
else:
|
else:
|
||||||
show_local = False
|
show_local = False
|
||||||
show_all_task_layers = True
|
show_all_task_layers = True
|
||||||
|
row = box.row(align=True)
|
||||||
|
|
||||||
draw_task_layer_selection(
|
draw_task_layer_selection(
|
||||||
box,
|
row,
|
||||||
context.scene,
|
context.scene,
|
||||||
self,
|
self,
|
||||||
self.owner_selection,
|
self.owner_selection,
|
||||||
'owner_selection',
|
'owner_selection',
|
||||||
show_all_task_layers=show_all_task_layers,
|
show_all_task_layers=show_all_task_layers,
|
||||||
show_local=show_local,
|
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?
|
# TODO Logically this can't be assigned to all objects, only ones I Own?
|
||||||
# if self.data_type == "TRANSFER_DATA":
|
# if self.data_type == "TRANSFER_DATA":
|
||||||
# box.prop(self, "surrender_selection", expand=True)
|
# box.prop(self, "surrender_selection", expand=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user