Developing Custom Messages#
The omni.kit.livestream.messaging
Extension is a reference implementation for messaging. This is a Python Extension that developers can use to learn how to implement their own messaging solution.
Accessing Source Code#
Start USD Composer 2023.2.3 from the Launcher.
In USD Composer, open the Extension Manager using the menu Window > Extensions.
Search for omni.kit.livestream.messaging and make sure you are using version 1.1.0.
Select the Extension.
Use the folder icon in the Extension’s detail page to open up a file browser showing the root of the Extension directory.
Open the
.\omni\kit\livestream\messaging\scripts\extension.py
file.
The _on_message_received()
method. This handles messages sent to the Kit application from a web page. This reference implementation attempts to convert a “payload message” into a new Kit event.
The _on_message_to_send()
method sends events from the Kit application to a web page. The Kit event is converted to a JSON string with properties event_type and payload.
The register_event_type_to_send()
method is used in Action Graphs included in the Bag.usd
file. The web browser developer tool view method can also be used by other Extensions. By registering a Kit event, it will be recognized as an event to send to the web page.
Developing a Custom Extension#
The Omniverse Developer Guide provides tutorials and examples for Extension development. For creating a custom message handler, a new “blank” Extension can be created and then use the omni.kit.livestream.messaging extension as a reference for custom implementation.
Note
It is not recommended to use both the custom Extension and omni.kit.livestream.messaging
at the same time in USD Composer.
➤ Next Steps: Configure Windows