Maxscript + Qt RuntimeError

Maxscript + Qt RuntimeError

Anonymous
Not applicable
696 Views
2 Replies
Message 1 of 3

Maxscript + Qt RuntimeError

Anonymous
Not applicable

Hi,

 

still trying to make some stuff using this method:

https://forums.autodesk.com/t5/3ds-max-programming/maxscript-qt-ui/m-p/10052536/highlight/false#M268...

 

Getting "RuntimeError: Internal C++ object (PySide2.QtWidgets.QMainWindow) already deleted." each time I open, save or reset max.

 

I tried to save "GetQMaxMainWindow" and my dialog to persistent variables + using callbacks with no luck 😞

 

GetQMaxMainWindow keeps living but my dialog returns  "<Error getting string representation>"

 

Any thought ?

Thanks!

0 Likes
Accepted solutions (1)
697 Views
2 Replies
Replies (2)
Message 2 of 3

Swordslayer
Advisor
Advisor
Accepted solution

You're again linking to a post about partial functions and really related to Qt stuff so this time I'm gonna assume it's about the .ui file again. Next time better post a complete code snippet that shows the problem though.

 

While you can also always check with shiboken.isValid if the underlying C++ object wasn't destroyed (see the previous code sample, I'd also recommended checking PySide shiboken object ownership if you haven't already), it's worth noting that usually if you're not destroying the objects, it's not really needed. The exception here is when loading .ui files where it's again not the responsibility of PySide to create and wrap the objects. See the discussion on tech artists on ways how to avoid these issues.

Message 3 of 3

Anonymous
Not applicable

Thank you for the tips Sowrdslayer,

I'll definitely look at shiboken and the post you mentioned.

Sorry for the noob questions, thanks to you I feel a bit less lost 🙂

0 Likes