create first workfile version function to global abstraction

This commit is contained in:
Jakub Jezek 2023-03-01 17:27:16 +01:00
parent 698e639fa6
commit 491eb3e750
No known key found for this signature in database
GPG key ID: 730D7C02726179A7
3 changed files with 37 additions and 26 deletions

View file

@ -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

View file

@ -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):