Hi! Is it possible to get the instance of the main plugin’s class from outside of it (within the same code)?
myPluginInstance.method() # how to get myPluginInstance?
What do you want to do exactly?
I think you mean to access the main plugin instance, not the class.
You need to give the reference to the plugin instance to the other class
self.otherObject = AnotherClass()
self.otherObject.pluginInstance = self
then you can do:
Perfect, thank you!
Trying to be object-oriented
Normally, an object should encapsulate functionally so that it doesn’t need access to outside stuff.
So maybe move
def method(self): to the other class.