Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collector collects non-ShotGrid nodes #5

Open
MaximumFX opened this issue Feb 23, 2024 · 0 comments
Open

Collector collects non-ShotGrid nodes #5

MaximumFX opened this issue Feb 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MaximumFX
Copy link
Member

When a script includes a regular write node that has rendered, publishing fails as it tries to add a node that isn't set to a ShotGrid path and can't find it's (non-existing) ShotGrid data.

def collect_node_outputs(self, parent_item):
"""
Scan known output node types in the session and see if they reference
files that have been written to disk.
:param parent_item: The parent item for any nodes collected
"""
# iterate over all the known output types
for node_type in _NUKE_OUTPUTS:
# get all the instances of the node type
all_nodes_of_type = [
n for n in nuke.allNodes() if n.Class() == node_type
]
# iterate over each instance
for node in all_nodes_of_type:
param_name = _NUKE_OUTPUTS[node_type]
# evaluate the output path parameter which may include frame
# expressions/format
file_path = node[param_name].evaluate()
if not file_path or not os.path.exists(file_path):
# no file or file does not exist, nothing to do
continue
self.logger.info(
"Processing %s node: %s" % (node_type, node.name())
)
# file exists, let the basic collector handle it
item = super(NukeSessionCollector, self)._collect_file(
parent_item, file_path, frame_sequence=True
)
# the item has been created. update the display name to include
# the nuke node to make it clear to the user how it was
# collected within the current session.
item.name = "%s (%s)" % (item.name, node.name())

@MaximumFX MaximumFX added the bug Something isn't working label Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant