Skip to content

SG-43811 migrate flow write node#135

Open
yungsiow wants to merge 5 commits into
ticket/sg-43461/migrate-nuke-hostfrom
ticket/sg-43811/migrate-flow-write-node
Open

SG-43811 migrate flow write node#135
yungsiow wants to merge 5 commits into
ticket/sg-43461/migrate-nuke-hostfrom
ticket/sg-43811/migrate-flow-write-node

Conversation

@yungsiow

Copy link
Copy Markdown
Contributor

Summary: Port the FlowWrite node implementation in Nuke of POC to Nuke engine, and adapt the user flow more in line with existing SG Write node.

Details:

  • Added FlowWriteNode class to Nuke engine
  • Kept original create and pre-render callbacks attached to node to ensure node is created under the right conditions, and renders go to the right place
  • Removed the post-render callback that published renders to Flow - this will be handled via the Publisher app from now on
  • Ensured the Nuke collector detects FlowWrite node renders and types them correctly, storing pertinent information in publish item about the FlowWrite renders
  • Add a publish script for FlowWrite nodes specifically which will do some post processing on the node after the publish is complete
  • During NukeHost initialization, register the FlowWrite node in the tab menu of Nuke and hook up callbacks

yungsiow added 2 commits June 26, 2026 17:11
- add custom FlowWriteNode class to flowam module
- collect renders of FlowWriteNodes in publisher
- post-publish add asset id back to FlowWrite node and save file
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 19.89%. Comparing base (a87de68) to head (43e3161).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           ticket/sg-43461/migrate-nuke-host     #135   +/-   ##
==================================================================
  Coverage                              19.89%   19.89%           
==================================================================
  Files                                      6        6           
  Lines                                    553      553           
==================================================================
  Hits                                     110      110           
  Misses                                   443      443           
Flag Coverage Δ
Linux 18.80% <ø> (ø)
Python-3.10 19.89% <ø> (ø)
Python-3.11 19.89% <ø> (ø)
Python-3.13 19.89% <ø> (ø)
Python-3.9 19.89% <ø> (ø)
Windows 18.80% <ø> (ø)
macOS 17.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

yungsiow added 2 commits June 29, 2026 14:43
- line endings on flow_write_node.py
- remove top level imports of flow modules

@chenm1adsk chenm1adsk left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some questions :)

HookBaseClass = sgtk.get_hook_baseclass()


class NukeFlowWritePublishPlugin(HookBaseClass):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I am not quite understand nuke hooks here. I am wondering why we need two different publish hooks? Are they get triggered differently?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, and my understanding is also not great. The original one only deals with Nuke "session" publishes - i.e. nuke script files. The item filter only accepts these. And since I need specific publish behaviour for the renders (which is different than scripts) - specifically a bit of post processing - the way to ensure I can "catch" those publishes is by creating a custom publisher which does the normal generic publish, but then some extra functionality after. Hope that makes sense!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. I am thinking should we move nuke_flow_write_publish_script.py inside nuke_publish_script.py and use context to check if we trigger flowam logic for nuke script publish workflow?
In this case, user don't need to update their config to add a new hook to be able to use flowam logic (same as collector.py/pre_publish.py/publish_file.py in native tk-multi-publsih2).
What do you think?

Comment thread python/flowam/host.py
)

self.logger.info("Registering global callbacks for Write nodes...")
nuke.addKnobChanged(FlowWriteNode._on_update_flow_write, nodeClass="Write")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove registered callback on tear down? Would this registered callback accumulate?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is a good idea. I haven't been doing that in the host code and probably should. Let me look into that!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed!


# Check for mandatory properties
if not write_node["asset_name"].value().strip():
nuke.message("Asset Name must be set.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering why we need two messages here. Does nuke.message display differently?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think Nuke.message() pops up a little dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants