Skip to content

SG-43811 migrate flow write node#135

Merged
yungsiow merged 14 commits into
masterfrom
ticket/sg-43811/migrate-flow-write-node
Jul 14, 2026
Merged

SG-43811 migrate flow write node#135
yungsiow merged 14 commits into
masterfrom
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 7 commits June 22, 2026 13:09
- added .flake8 config copied from tk-core
- added vim lock files to .gitignore
- implemented NukeHost subclass of FlowHost
NOTE: FlowWrite node will be ported in a separate ticket
- instantiate NukeHost during engine set up
- 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 (0280856) to head (42d957f).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #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.

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

@carlos-villavicencio-adsk carlos-villavicencio-adsk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe the code style validation check if failing.

Comment thread python/flowam/flow_write_node/callbacks.py Outdated
Comment thread python/flowam/flow_write_node/callbacks.py
Base automatically changed from ticket/sg-43461/migrate-nuke-host to master July 2, 2026 21:22

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

LGTM!

Comment thread hooks/tk-multi-publish2/basic/collector.py Outdated
@yungsiow
yungsiow merged commit 6220577 into master Jul 14, 2026
26 checks passed
@yungsiow
yungsiow deleted the ticket/sg-43811/migrate-flow-write-node branch July 14, 2026 21:12
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.

3 participants