Asset Pipeline v2 #145
@ -344,12 +344,33 @@ class ASSETPIPE_OT_publish_new_version(bpy.types.Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
class ASSETPIPE_OT_reset_ownership(bpy.types.Operator):
|
||||||
|
bl_idname = "assetpipe.reset_ownership"
|
||||||
|
bl_label = "Reset Ownership"
|
||||||
|
bl_description = (
|
||||||
|
"""Reset the Object owner and transfer data on selected object(s)"""
|
||||||
|
)
|
||||||
|
|
||||||
|
def execute(self, context: bpy.types.Context):
|
||||||
|
objs = context.selected_objects
|
||||||
|
for obj in objs:
|
||||||
|
obj = context.active_object
|
||||||
|
obj.asset_id_owner = "NONE"
|
||||||
|
obj.transfer_data_ownership.clear()
|
||||||
|
self.report(
|
||||||
|
{'INFO'},
|
||||||
|
f"'{obj.name}' ownership data cleared ",
|
||||||
|
)
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
ASSETPIPE_OT_update_ownership,
|
ASSETPIPE_OT_update_ownership,
|
||||||
ASSETPIPE_OT_sync_push,
|
ASSETPIPE_OT_sync_push,
|
||||||
ASSETPIPE_OT_sync_pull,
|
ASSETPIPE_OT_sync_pull,
|
||||||
ASSETPIPE_OT_publish_new_version,
|
ASSETPIPE_OT_publish_new_version,
|
||||||
ASSETPIPE_OT_create_new_asset,
|
ASSETPIPE_OT_create_new_asset,
|
||||||
|
ASSETPIPE_OT_reset_ownership,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,8 @@ class ASSETPIPE_PT_sync_advanced(bpy.types.Panel):
|
|||||||
bl_options = {'DEFAULT_CLOSED'}
|
bl_options = {'DEFAULT_CLOSED'}
|
||||||
|
|
||||||
def draw(self, context: bpy.types.Context) -> None:
|
def draw(self, context: bpy.types.Context) -> None:
|
||||||
self.layout.label(text="FOO")
|
layout = self.layout
|
||||||
|
layout.operator("assetpipe.reset_ownership")
|
||||||
|
|
||||||
|
|
||||||
class ASSETPIPE_PT_ownership_inspector(bpy.types.Panel):
|
class ASSETPIPE_PT_ownership_inspector(bpy.types.Panel):
|
||||||
|
Loading…
Reference in New Issue
Block a user