I want my COMP to have multiple extensions which can communicate with each other.
Let’s say I set up my extensions as such:
global op shortcut TEST
object1 op('./FooEXT').module.FooEXT(me)
name1 FOO
object2 op('./BarEXT').module.BarEXT(me)
name2 BAR
Let;s say inside each class I have a method called Test which prints out “foo” and “bar” respectively.
Now, if I open up textport:
op.TEST.ext.FOO.Test()
>>> Foo
op.TEST.ext.BAR.Test()
>>> Bar
But if I reference these extensions inside each other:
class FooEXT:
def __init__(self, ownerComp):
# The component to which this extension is attached
self.ownerComp = ownerComp
self.Bar = self.ownerComp.Ext.BAR
I get td.Error: Cannot use an extension during its initialization.
So how do I create such a cross reference? Is it considered a bad practice to do so?