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

Improve selection handling in NukeWriteCreator #65

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jakubjezek001
Copy link
Member

@jakubjezek001 jakubjezek001 commented Jan 31, 2025

Changelog Description

  • Added early return for no selection case.
  • Simplified logic to raise error only if selected nodes are missing.
  • Handled headless mode by defaulting pre_create_data when absent.

closes #56

Testing steps

  1. have activated workfile template building templates at your project
  2. have Create placeholder in template
  3. build templates and see that creator placeholder is working again.

- Added early return for no selection case.
- Simplified logic to raise error only if selected nodes are missing.
- Handled headless mode by defaulting pre_create_data when absent.
@jakubjezek001 jakubjezek001 linked an issue Jan 31, 2025 that may be closed by this pull request
1 task
@jakubjezek001 jakubjezek001 self-assigned this Jan 31, 2025
@jakubjezek001 jakubjezek001 added the type: bug Something isn't working label Jan 31, 2025
Comment on lines +458 to +462
if not pre_create_data:
# add no selection for headless
pre_create_data = {
"use_selection": False
}
Copy link
Contributor

@BigRoy BigRoy Jan 31, 2025

Choose a reason for hiding this comment

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

This seems odd to do. Especially because this doesn't necessarily differentiate between "headless" (e.g. Nuke without UI) or running the creator through a script, like e.g. template placeholders.

If the issue is to solve template placeholders, then you may be better off making sure that the Loader used there actually clears the selection? (I mean, fix that in the Nuke Workfile Template Builder itself)

Copy link
Member

@iLLiCiTiT iLLiCiTiT Feb 3, 2025

Choose a reason for hiding this comment

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

I don't understand what is odd? This is defeault behavior for calling create without pre create data. Yes, it is for template builder, but for headless scripts too. If you need different behavior for headless scripts, you can pass in pre-create attributes... If anybody does have headless scripts, then they already fill pre-create attributes, otherwise the create would crash.

@robin-ynput
Copy link
Contributor

The code looks OK and confirmed I have been able to test it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AY-7420_Templated Workfile Builder doesn't create Write
4 participants