Python callback error in custom viewer state

   679   2   0
User Avatar
Member
3 posts
Joined: Nov. 2020
Offline
Hi everyone! I'm writing a python viewer state where I split the viewport while in the state, then close that extra pane tab when the state exits. I've been running into an odd error. When I open or close a pane tab while in the state, a window pops up with the title "Python Callback Error", with the following message:
"Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError:'NoneType' object has no attribute 'findPaneTab'.

I'm unsure how to debug this since the error is not in my own file. If I understand correctly, one of Houdini's code files is calling findPaneTab on an object that's been passed to it from my code, and the object I'm passing is a NoneType object, but I'm not sure what object that is or how to find out. It's also an odd situation because my code appears to do exactly what I want it to do, other than the error messages.

Any insight or tips you have to offer are greatly appreciated!
Edited by helvetica1957 - Aug. 24, 2023 11:53:17
User Avatar
Staff
401 posts
Joined: Feb. 2018
Offline
Please post your python state.
User Avatar
Member
3 posts
Joined: Nov. 2020
Offline
I actually just figured out a solve! I'm still not sure exactly why, but it seems that Houdini didn't appreciate me renaming a pane tab. I tried a different approach where I just stored the pane's original name and used that to look it up later (which I guess is better practice anyway haha) and that seemed to work! I'm attaching both the broken version of my state and the workaround in case it helps somebody else to see.

Thank you so much for being willing to take a look mabelzile!
Edited by helvetica1957 - Aug. 24, 2023 16:17:01

Attachments:
SplitViewportsTest_05_Broken.py (3.0 KB)
SplitViewportsTest_06_Works.py (3.0 KB)

  • Quick Links