- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
3Ds Max newbie here. I have a fully functional PySide tool in Maya that I am trying to make a 3ds Max version for.
Managed to get most of it working but I am getting stuck with this C++ error that I suspect is related to C++ object not getting garbage collected properly.
In my tool, I have a loop of QPushButtons that gets created dynamically within python. Think of it as an image/thumbnail viewer that I have connected to a database. I am using a custom Flow Layout to create a grid layout that expands and contracts based on the UI width/height. The database is tasked to do the page numbers.
The problem is when I am trying to delete the page 1 layout in order to load page 2, I get this error:
"RuntimeError: Internal C++ object (PySide2.QtWidgets.QCommonStyle) already deleted."
This is the delete function that I am using to clear out the old layout.
def clearLayout(self, layout):
if layout is not None:
while layout.count():
item = layout.takeAt(0)
widget = item.widget()
if widget is not None:
widget.setParent(None)
widget.deleteLater()
widget.update()
else:
self.clearLayout(item.layout())
Tried looking online for any hints and it looks like it's the deleteLater() method that might be the culprit here. Python is garbage collecting properly but somehow C++ objects are still present.
Using Max 2022(version 24.0 - 24.0.0.923) on the Windows platform.
Thanks in advance 🙂
Solved! Go to Solution.