Asset Pipeline v2 #145
@ -22,5 +22,24 @@ VERTEX_GROUP_KEY = TRANSFER_DATA_KEYS[1]
|
|||||||
MODIFIER_KEY = TRANSFER_DATA_KEYS[2]
|
MODIFIER_KEY = TRANSFER_DATA_KEYS[2]
|
||||||
MATERIAL_SLOT_KEY = TRANSFER_DATA_KEYS[3]
|
MATERIAL_SLOT_KEY = TRANSFER_DATA_KEYS[3]
|
||||||
|
|
||||||
|
PUBLISH_TYPES = [
|
||||||
|
(
|
||||||
|
"ACTIVE",
|
||||||
|
"Active",
|
||||||
|
"Publish a new active version that will become the latest published version",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"STAGE",
|
||||||
|
"Staged",
|
||||||
|
"""Publish a staged version that will replace the last active version as the Push/Pull target.
|
||||||
|
Used for internal asset pipeline use only""",
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"REVIEW",
|
||||||
|
"Review",
|
||||||
|
"Test the results that will be published in the review area, will not be used as Push/Pull target",
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
||||||
LOCAL_SUFFIX = "LOCAL"
|
LOCAL_SUFFIX = "LOCAL"
|
||||||
EXTERNAL_SUFFIX = "EXTERNAL"
|
EXTERNAL_SUFFIX = "EXTERNAL"
|
||||||
|
@ -138,7 +138,32 @@ class ASSETPIPE_OT_sync_with_publish(bpy.types.Operator):
|
|||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
classes = (ASSETPIPE_OT_sync_with_publish,)
|
class ASSETPIPE_OT_publish_new_version(bpy.types.Operator):
|
||||||
|
bl_idname = "assetpipe.publish_new_version"
|
||||||
|
bl_label = "Publish New Version"
|
||||||
|
bl_description = """Create a new Published Version in the Publish Area"""
|
||||||
|
|
||||||
|
publish_types: bpy.props.EnumProperty(
|
||||||
|
name="Transfer Data Owner",
|
||||||
|
items=constants.PUBLISH_TYPES,
|
||||||
|
)
|
||||||
|
|
||||||
|
# TODO use published types to publish to different folders
|
||||||
|
|
||||||
|
def execute(self, context: bpy.types.Context):
|
||||||
|
if bpy.data.is_dirty:
|
||||||
|
self.report(
|
||||||
|
{'ERROR'},
|
||||||
|
"Please save the current file and/or Pull from last publish before creating new Publish",
|
||||||
|
)
|
||||||
|
return {'CANCELLED'}
|
||||||
|
current_file = Path(bpy.data.filepath)
|
||||||
|
new_file_path = core.get_next_published_file(current_file)
|
||||||
|
bpy.ops.wm.save_as_mainfile(filepath=new_file_path.__str__(), copy=True)
|
||||||
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
classes = (ASSETPIPE_OT_sync_with_publish, ASSETPIPE_OT_publish_new_version)
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
|
@ -12,6 +12,7 @@ class ASSETPIPE_PT_TestUI(bpy.types.Panel):
|
|||||||
text=f"Active Task Layer: {context.collection.name.split('.')[-1]}"
|
text=f"Active Task Layer: {context.collection.name.split('.')[-1]}"
|
||||||
)
|
)
|
||||||
self.layout.label(text="Test UI")
|
self.layout.label(text="Test UI")
|
||||||
|
self.layout.operator("assetpipe.publish_new_version")
|
||||||
self.layout.operator("assetpipe.sync_with_publish", text="Update Ownership")
|
self.layout.operator("assetpipe.sync_with_publish", text="Update Ownership")
|
||||||
self.layout.operator(
|
self.layout.operator(
|
||||||
"assetpipe.sync_with_publish", text="Push to Publish", icon="TRIA_UP"
|
"assetpipe.sync_with_publish", text="Push to Publish", icon="TRIA_UP"
|
||||||
|
Loading…
Reference in New Issue
Block a user