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

Studio Library can only be launched once per maya session #468

Open
ZBB-XD opened this issue Aug 13, 2024 · 0 comments
Open

Studio Library can only be launched once per maya session #468

ZBB-XD opened this issue Aug 13, 2024 · 0 comments

Comments

@ZBB-XD
Copy link

ZBB-XD commented Aug 13, 2024

This app doesnt maintain its own window reference in maya. So if you run this code twice, it breaks with a "C++ internal object already deleted".
On Maya 2023.

import studiolibrary
studiolibrary.main()

To get around this, I store the window ref from studiolibrary.main() in a module-level global variable, and our launch method checks if that var is valid and calls "window.show()" instead.

window = None
def launchSL():
    global window
    if window is not None:
        window.show()
    import studiolibrary
    window = studiolibrary.main()

Your documentation acts like this isn't required, very strange.

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

No branches or pull requests

1 participant