np = aspect2d.find('**/foo*')
Assuming I have created e. g. a DirectButton previously and named it ‘foo’ I will be able to find it this way. But the variable “np” returned by “find” is now a NodePath, and not a DirectButton.
I think understand why, because DirectButton inherits from NodePath, but it is a Python extension for NodePath and the C++ method “find” doesn’t know about it.
My question: I considered cleaning up a GUI layer by searching for GUI elements this way and then calling “destroy” on them. Is therea way to convert the NodePath returned by “find” into it’s original type (DirectButton)?
I can easily work around, e. g. by storing the GUI elements somewhere. It’s more a question of curiousity, so no priority at all.