mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
create first workfile version function to global abstraction
This commit is contained in:
parent
698e639fa6
commit
491eb3e750
3 changed files with 37 additions and 26 deletions
|
|
@ -2685,7 +2685,7 @@ def start_workfile_template_builder():
|
|||
# to avoid looping of the callback, remove it!
|
||||
# nuke.removeOnCreate(start_workfile_template_builder, nodeClass="Root")
|
||||
log.info("Starting workfile template builder...")
|
||||
build_workfile_template()
|
||||
build_workfile_template(run_from_callback=True)
|
||||
|
||||
|
||||
@deprecated
|
||||
|
|
|
|||
|
|
@ -56,24 +56,6 @@ class NukeTemplateBuilder(AbstractTemplateBuilder):
|
|||
|
||||
return True
|
||||
|
||||
def create_first_workfile_version(self):
|
||||
"""
|
||||
Create first version of workfile.
|
||||
|
||||
Should load the content of template into scene so
|
||||
'populate_scene_placeholders' can be started.
|
||||
|
||||
Args:
|
||||
template_path (str): Fullpath for current task and
|
||||
host's template file.
|
||||
"""
|
||||
last_workfile_path = os.environ.get("AVALON_LAST_WORKFILE")
|
||||
# Save current scene, continue to open file
|
||||
if isinstance(self.host, IWorkfileHost):
|
||||
self.host.save_workfile(last_workfile_path)
|
||||
else:
|
||||
self.host.save_file(last_workfile_path)
|
||||
|
||||
|
||||
class NukePlaceholderPlugin(PlaceholderPlugin):
|
||||
node_color = 4278190335
|
||||
|
|
@ -966,9 +948,9 @@ class NukePlaceholderCreatePlugin(
|
|||
siblings_input.setInput(0, copy_output)
|
||||
|
||||
|
||||
def build_workfile_template(*args):
|
||||
def build_workfile_template(*args, **kwargs):
|
||||
builder = NukeTemplateBuilder(registered_host())
|
||||
builder.build_template()
|
||||
builder.build_template(*args, **kwargs)
|
||||
|
||||
|
||||
def update_workfile_template(*args):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue