Skip to content

NXT Maya: Add option to provide paths to NXT layers to open in nxt_ui command - #293

Open
michaelharmonart wants to merge 1 commit into
nxt-dev:devfrom
michaelharmonart:maya-command
Open

michaelharmonart wants to merge 1 commit into
nxt-dev:devfrom
michaelharmonart:maya-command

Conversation

@michaelharmonart

Copy link
Copy Markdown

We have a place in our pipeline where it would be nice to have tooling to open NXT layers associated with rigging certain assets, and where manually navigating to a file is redundant as the pipeline can provide it assuming it can pass that data to NXT.

This is the cleanest way I could think of to interface such that we keep the nice behavior of having graceful file save popups on quit, etc.

@ImLucasBrown ImLucasBrown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR! I don't have Maya to test this, but I spotted a few issues I think need to be addressed. Also could you please target the dev branch instead of release. 🙂

nxt_win = nxt_editor.show_new_editor()

try:
parser = om.MArgParser(self.syntax(), args)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The parser does not declare positional args so auto_reload will raise a RuntimeError since it calls cmds.nxt_ui('reload').
I don't have Maya to confirm this, but I think this also breaks the "Open Editor" menu item since I think those callbacks pass a bool arg.

@michaelharmonart michaelharmonart Sep 5, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

for the auto_reload function.... it doesn't seem to be used anywhere? and also the reload flag was never parsed or passed through by anything. should it just be removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think this also breaks the "Open Editor" menu item since I think those callbacks pass a bool arg.

Huh, would you look at that it does. You learn something new everyday.

Comment thread nxt_editor/integration/maya/plug-ins/nxt_maya.py
@michaelharmonart
michaelharmonart changed the base branch from release to dev September 5, 2026 00:28
@michaelharmonart

Copy link
Copy Markdown
Author

Ahh shoot, can't believe I missed adding the flag for reload.

Thank you for your notes!

I'll rebase on dev and address those.

@enriquevelmai

Copy link
Copy Markdown

Nice, we had the same need and moved to MSyntax flags locally as well. Two things from our version that might be worth folding in here, since they touch the same code:

  1. Focus instead of duplicating. When nxt_ui is called with no -path and an editor is already open, raise / activate it instead of building a second window:
if __NXT_INSTANCE__ is not None and not paths:
    try:
        if __NXT_INSTANCE__.isMinimized():
            __NXT_INSTANCE__.showNormal()
        elif __NXT_INSTANCE__.isHidden():
            __NXT_INSTANCE__.show()
        __NXT_INSTANCE__.raise_()
        __NXT_INSTANCE__.activateWindow()
        return
    except RuntimeError:
        # The previous window was deleted C++ side; rebuild a new one
        __NXT_INSTANCE__ = None
  1. -reload is currently a pass. What we use (mirrors auto_reload):
if parser.isFlagSet(NxtUiCmd.kReloadFlag):
    safe = True
    if __NXT_INSTANCE__:
        safe = __NXT_INSTANCE__.close()
    if not safe:
        cmds.warning('Aborted reload!')
        return
    __NXT_INSTANCE__ = None

With that, auto_reload can just call cmds.nxt_ui(reload=True). Happy to open a follow-up PR on top of this one once it lands if you prefer that.

@wyoder
wyoder requested review from ZachGray, matthew-schiller and wyoder and removed request for ImLucasBrown September 24, 2026 14:45
@wyoder

wyoder commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

We are taking a look @michaelharmonart and @enriquevelmai. We will get back to you on this soon.

@wyoder
wyoder dismissed ImLucasBrown’s stale review September 24, 2026 14:49

removing this for now. If you want to chat, let me know

This branch has not been deployed

No deployments
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.

4 participants