-
Notifications
You must be signed in to change notification settings - Fork 129
Nuke: Build workfile by template #3544
Nuke: Build workfile by template #3544
Conversation
Thank you @friquette! we're actually just about to approve and merge the source PR for Maya, which opens the road this right away. We'll have a look and give it a proper review |
Thank you @friquette , this is awesome! I was able to make and use template with loadClip for mov and exr.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an error during Nuke startup
sys.version_info < (3,) and warnings.warn("*" * 60 + msg + "*" * 60)
Traceback (most recent call last):
File "D:\REPO\OpenPype\openpype\hosts\nuke\startup/menu.py", line 5, in <module>
from openpype.hosts.nuke import api
File "D:\REPO\OpenPype\openpype\hosts\nuke\api\__init__.py", line 17, in <module>
from .plugin import OpenPypeCreator
File "D:\REPO\OpenPype\openpype\hosts\nuke\api\plugin.py", line 14, in <module>
from .lib import (
File "D:\REPO\OpenPype\openpype\hosts\nuke\api\lib.py", line 24, in <module>
from openpype.tools.utils import host_tools
File "D:\REPO\OpenPype\openpype\tools\utils\__init__.py", line 1, in <module>
from .widgets import (
File "D:\REPO\OpenPype\openpype\tools\utils\widgets.py", line 4, in <module>
from openpype.vendor.python.common import qargparse
ImportError: No module named python.common
…io.com/quad/openpype/OpenPype into build-workfile-template-nuke
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still no luck for me . . .
sys.version_info < (3,) and warnings.warn("*" * 60 + msg + "*" * 60)
Traceback (most recent call last):
File "D:\REPO\OpenPype\openpype\hosts\nuke\startup/menu.py", line 3, in <module>
from openpype.api import Logger
File "D:\REPO\OpenPype\openpype\api.py", line 1, in <module>
from .settings import (
File "D:\REPO\OpenPype\openpype\settings\__init__.py", line 27, in <module>
from .entities import (
File "D:\REPO\OpenPype\openpype\settings\entities\__init__.py", line 73, in <module>
from .base_entity import (
File "D:\REPO\OpenPype\openpype\settings\entities\base_entity.py", line 18, in <module>
from openpype.lib import PypeLogger
File "D:\REPO\OpenPype\openpype\lib\__init__.py", line 54, in <module>
from .execute import (
File "D:\REPO\OpenPype\openpype\lib\execute.py", line 8, in <module>
from .log import PypeLogger as Logger
File "D:\REPO\OpenPype\openpype\lib\log.py", line 28, in <module>
from .mongo import (
File "D:\REPO\OpenPype\openpype\lib\mongo.py", line 5, in <module>
import pymongo
File "D:\REPO\OpenPype\.venv\lib\site-packages\pymongo\__init__.py", line 112, in <module>
from pymongo.collection import ReturnDocument
File "D:\REPO\OpenPype\.venv\lib\site-packages\pymongo\collection.py", line 29, in <module>
from pymongo import (common,
File "D:\REPO\OpenPype\.venv\lib\site-packages\pymongo\common.py", line 36, in <module>
from pymongo.ssl_support import (validate_cert_reqs,
File "D:\REPO\OpenPype\.venv\lib\site-packages\pymongo\ssl_support.py", line 36, in <module>
import certifi
File "D:\REPO\OpenPype\.venv\lib\site-packages\certifi\__init__.py", line 1, in <module>
from .core import contents, where
File "D:\REPO\OpenPype\.venv\lib\site-packages\certifi\core.py", line 17
def where() -> str:
^
SyntaxError: invalid syntax
Are you sure your venv is set in python3 ? |
@@ -0,0 +1,206 @@ | |||
from collections import OrderedDict | |||
|
|||
from openpype.vendor.python.common import qargparse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from openpype.vendor.python.common import qargparse | |
import qargparse |
|
||
from openpype.vendor.python.common import qargparse | ||
from openpype.tools.utils.widgets import OptionDialog | ||
from openpype.hosts.nuke.api.lib import imprint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from openpype.hosts.nuke.api.lib import imprint | |
from .lib import imprint |
def populate_template(self, ignored_ids=None): | ||
place_holders = self.get_template_nodes() | ||
while len(place_holders) > 0: | ||
super().populate_template(ignored_ids) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super().populate_template(ignored_ids) | |
super(NukeTemplateLoader, self).populate_template(ignored_ids) |
return ids | ||
|
||
def get_placeholders(self): | ||
placeholders = super().get_placeholders() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
placeholders = super().get_placeholders() | |
placeholders = super(NukeTemplateLoader, self).get_placeholders() |
set inputs and outputs of loaded nodes""" | ||
|
||
node = self.data['node'] | ||
input, output = get_io(self.data['last_loaded']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be also some single unconnected nodes
Traceback (most recent call last):
File "C:\CODE\__PYPE\OpenPype\openpype\hosts\nuke\api\pipeline.py", line 223, in <lambda>
lambda: build_workfile_template()
File "C:\CODE\__PYPE\OpenPype\openpype\lib\build_template.py", line 28, in build_workfile_template
template_loader.populate_template()
File "C:\CODE\__PYPE\OpenPype\openpype\hosts\nuke\api\template_loader.py", line 47, in populate_template
super(NukeTemplateLoader, self).populate_template(ignored_ids)
File "C:\CODE\__PYPE\OpenPype\openpype\lib\abstract_template_loader.py", line 254, in populate_template
self.postload(placeholder)
File "C:\CODE\__PYPE\OpenPype\openpype\lib\abstract_template_loader.py", line 306, in postload
placeholder.clean()
File "C:\CODE\__PYPE\OpenPype\openpype\hosts\nuke\api\template_loader.py", line 447, in clean
self.set_loaded_connections()
File "C:\CODE\__PYPE\OpenPype\openpype\hosts\nuke\api\template_loader.py", line 346, in set_loaded_connections
input, output = get_io(self.data['last_loaded'])
File "C:\CODE\__PYPE\OpenPype\openpype\hosts\nuke\api\lib.py", line 2628, in get_io
raise Exception("No Input found")
Exception: No Input found
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing as it is replaced by #3838 |
Brief description
Following discussion https://github.com/pypeclub/OpenPype/discussions/2013
This PR depends on the Maya build workfile by template #3315
Templated Build Workfile
Building a workfile using a template designed by users. Helping to assert homogeneous subsets hierarchy and imports. Template stored as file easy to define, change and customize for production needs.
1. Make a template
Make your template. Add nodes and everything needed for your tasks. Here is an example template for the compositing task using a placeholder.
The placeholder will be replaced by the nodes you want. To create a placeholder: OpenPype > Template Builder > Create Place Holder
Fill in the necessary fields (the optional fields are regex filters)
2. Configure Template
3. Build your workfile
Open Nuke
Build your workfile