how would I manage to let two different extensions (A and B) talk to each other? I would like to use the member function foo of extension A from within function bar in extension B. How would I do that? To be specific, I would like to access the already running instance of Extension A. I don’t want to create a new instance of A.
Example / more details: Extension A:
can spawn prims on the stage.
maintains a list of all the prims that were created with Extension A.
foo: using that list, Extension A can delete all the prims, that it once spawned on the stage.
Extension B:
bar: needs call the foo function of A so that all the prims are deleted that were created by the running instance of Extension A.
Hi @markus-franz.ziegler. There are lots of different ways that you can implement interactions between two extensions. The way you describe is just one of them, so I thought I’d list out a few different options for you though maybe not all of them are appropriate for your specific use case.
Make Extension A a singleton. See omni.kit.window.file_importer’s implementation for an example. (This is specifically what you were asking about).