Quote:
Originally Posted by Hi5TBone
Don't be to rain on the parade but...
I don't know how to add customs modules, could someone help me?
I could know how because it sounds like Déjà vu but maybe somethings just not registering in my brain or I forgot.
|
Create a new .py file, name it whatever you like and add this into it for Panda3D:
Code:
from direct.showbase.DirectObject import DirectObject
class MYCLASS(DirectObject):
def __init__(self):
pass
Then in another file you can call it like so:
Code:
from MYCLASS import *
Star, '*', imports everything, so if you only want certain classes you need to include which class you want, which would be:
Code:
from MYCLASS import MYSECONDCLASS, MYTHIRDCLASS
I hope this helps.