NXT Maya: Add option to provide paths to NXT layers to open in nxt_ui command - #293
michaelharmonart wants to merge 1 commit into
Conversation
ImLucasBrown
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
|
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. |
366cbb3 to
38e6975
Compare
a12b80e to
39f33f8
Compare
|
Nice, we had the same need and moved to
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
if parser.isFlagSet(NxtUiCmd.kReloadFlag):
safe = True
if __NXT_INSTANCE__:
safe = __NXT_INSTANCE__.close()
if not safe:
cmds.warning('Aborted reload!')
return
__NXT_INSTANCE__ = NoneWith that, |
|
We are taking a look @michaelharmonart and @enriquevelmai. We will get back to you on this soon. |
removing this for now. If you want to chat, let me know
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.