Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Maya: Maya Look Assigner window is initialized on Maya launch #2539

Closed
BigRoy opened this issue Jan 15, 2022 · 2 comments
Closed

Maya: Maya Look Assigner window is initialized on Maya launch #2539

BigRoy opened this issue Jan 15, 2022 · 2 comments

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Jan 15, 2022

Describe the bug

During debugging of some other things I noticed that directly after Maya launch the mayalookassigner dialog actually has initialized and started. Which seems redundant before the user clicked on the actual "launch maya look assigner".

It seems extra off that it's a top level widget maybe? I thought it wasn't a top level widget if it were parented to Maya main window?

Some more details

I noticed that when commenting out this avalon.on("init", on_init) line the mayalookassigner tool doesn't show up in that list when printed. Meaning it's some code triggered through there causing it which I traced down to override_toolbox_ui because removing that also fixes it.

Which is when I traced it down to here. Looking at that code makes somewhat sense as to why it happens - it's trying to not add the maya look assigner button if it can't be initialized.

It feels off that even checking whether it's available actually initializes the dialog. Shouldn't it just be a case of checking whether mayalookassigner tool is availble (at most check whether we can access it on our pythonpath?)

Aside of that with Maya Look Assigner code now inside OpenPype this seems like less required? (However, it was also in openpype.tools.mayalookassigner during that commit).

To Reproduce
Steps to reproduce the behavior:

  1. Start Maya in OpenPype.

Confirm the dialog exists:

from Qt import QtWidgets
top_level_widgets = QtWidgets.QApplication.topLevelWidgets()

for widget in top_level_widgets:
    if widget.objectName() == "lookManager":
        print(widget)

Expected behavior

Initialize the app only when the user starts it instead.

Additional context

I understand It's a bit extreme to focus on this since it doesn't really get in the way. But making sure apps don't unnecessarily slow down host start ups etc. I felt it would be good to at least open this issue here. This also should give us extra focus so that we ensure not all OpenPype tools get initialized in the background on Maya start making it drag down over the years as we expand the toolset.

[cuID:OP-2445]

@antirotor
Copy link
Member

This is now merged, but I'll leave this issue open until we merge it also with Maya Python 3 fixes.

@BigRoy
Copy link
Collaborator Author

BigRoy commented Mar 30, 2022

This is now merged, but I'll leave this issue open until we merge it also with Maya Python 3 fixes.

This should be done now for some time too with PR #2445

@BigRoy BigRoy closed this as completed Mar 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants