Asset Pipeline v2 #145
@ -22,6 +22,12 @@ class ASSETPIPE_OT_push_test(bpy.types.Operator):
|
|||||||
|
|
||||||
_new_transfer_data = {}
|
_new_transfer_data = {}
|
||||||
|
|
||||||
|
save: bpy.props.BoolProperty(
|
||||||
|
name="Save Current File",
|
||||||
|
default=True,
|
||||||
|
description="Save the Current File (after pulling if enabled) before Pushing to Publish",
|
||||||
|
)
|
||||||
|
|
||||||
def invoke(self, context: bpy.types.Context, event: bpy.types.Event):
|
def invoke(self, context: bpy.types.Context, event: bpy.types.Event):
|
||||||
local_col = bpy.data.collections.get(get_parent_col_name())
|
local_col = bpy.data.collections.get(get_parent_col_name())
|
||||||
if not local_col:
|
if not local_col:
|
||||||
@ -51,6 +57,8 @@ class ASSETPIPE_OT_push_test(bpy.types.Operator):
|
|||||||
|
|
||||||
def draw(self, context: bpy.types.Context):
|
def draw(self, context: bpy.types.Context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
row = layout.row()
|
||||||
|
row.prop(self, "save")
|
||||||
|
|
||||||
if self._new_transfer_data:
|
if self._new_transfer_data:
|
||||||
layout.label(text="New Transfer Data will be Pushed to Publish")
|
layout.label(text="New Transfer Data will be Pushed to Publish")
|
||||||
@ -70,6 +78,9 @@ class ASSETPIPE_OT_push_test(bpy.types.Operator):
|
|||||||
self.report({'ERROR'}, "Current File Name doesn't contain valid task layer")
|
self.report({'ERROR'}, "Current File Name doesn't contain valid task layer")
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
if self.save:
|
||||||
|
bpy.ops.wm.save_as_mainfile(filepath=current_file.__str__())
|
||||||
|
|
||||||
pub_file = core.find_published_file(current_file)
|
pub_file = core.find_published_file(current_file)
|
||||||
pub_file_path = pub_file.__str__()
|
pub_file_path = pub_file.__str__()
|
||||||
bpy.ops.wm.open_mainfile(filepath=pub_file_path)
|
bpy.ops.wm.open_mainfile(filepath=pub_file_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user