Is there a way to save a class in a tag, and then retrieve it later? For example, a collisionNode that points back to a class when clicked/collided?
for example:
#import direct.directbase.DirectStart
from pandac.PandaModules import *
import sys,random
from math import *
class test:
def __init__(self):
self.np = NodePath(PandaNode('hi'))
self.hi = 'hi'
self.np.setTag('test',str(self))
t = test()
t1 = t.np.getTag('test')
print t
print t1
print t.hi
print t1.hi #fails
t and t1 appear to be the same things, but t is real and t1 is only a string. Is there a way to make t1 ‘real’?