WASM Communication API documentation misleading


The WASM Comms API works between WASM and JS gauges but not between an in-game panel and standalone WASM module.

Thank you for the step in the right direction with this API. The day this works across the board will be an incredible day for all of us developers.

Edit: See below


Following the actual sample project worked. The examples provided here use misleading names and functions.

this.wasmListener = RegisterViewListener('JS_LISTENER_MODULE_COMMUNICATION');
// and
this.wasmListener.call("MODULE_COMM_WASM_CALLBACK", "MyWasmCallback", "{value : 42}");

Should read:

this.wasmListener = RegisterViewListener('JS_LISTENER_COMM_BUS');
// and
this.wasmListener.call("COMM_BUS_WASM_CALLBACK", "MyWasmCallback", "{value : 42}");

Most/all the C++ side has been renamed as well:

1 Like

Following… hoping all works fine on panels vs WASM.

Hello @runshotgun

This will be fixed in the next version of the documentation.
Thank you for pointing this out.


@runshotgun could you please clarify your previous comments you now stroked out ?

Do you think it’s now possible to call JS running in a Toolbar Panel from WASM, even when the panel is closed ?

Until now, the main problem was the whole .JS code of a Toolbar panel would stop running if panel is closed, would the registered listener still “listen” to wasm in that case ?

Unless you inject JS code in the toolbar itself to open the panel, you can’t call JS code that isn’t listening (in a closed panel)

@runshotgun thanks for posting this - huge time saver for the rest of us.

1 Like