Skip to content

Basic usage

The library abstracts away the details of the NOODLES protocol and provides a simple interface for creating a window and interacting with a scene. The principal method is run, which starts up the client and displays the server's scene in a new window. This entry point opens with a gui that allows users to connect to any websocket address.

orzo.run

run()

Opens Orzo allows user to connect with a GUI

Source code in orzo/core.py
 9
10
11
def run():
    """Opens Orzo allows user to connect with a GUI"""
    Window.run()

orzo.connect

connect(address='ws://localhost:50000', default_lighting=True, on_connected=None)

Connects the Orzo Client to a websocket address

Connects to address and opens a window to display the scene. The window will run indefinitely until it is closed. The default lighting parameter is set to True by default to avoid loading an all black scene initially. The default lighting can also be toggled later in the GUI.

Parameters:

Name Type Description Default
address str

Address of the server to connect to

'ws://localhost:50000'
default_lighting bool

Whether to use default lighting

True
on_connected function

Function to run when connected to server

None
Source code in orzo/core.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
def connect(address="ws://localhost:50000", default_lighting=True, on_connected=None):
    """Connects the Orzo Client to a websocket address

    Connects to address and opens a window to display the scene. The window will run
    indefinitely until it is closed. The default lighting parameter is set to True by default to
    avoid loading an all black scene initially. The default lighting can also be toggled later
    in the GUI.

    Args:
        address (str): Address of the server to connect to
        default_lighting (bool): Whether to use default lighting
        on_connected (function): Function to run when connected to server
    """

    # Update forward refs where entity -> light -> client -> entity
    for delegate in delegate_map.values():
        delegate.update_forward_refs()

    # Create Client and start rendering loop
    with penne.Client(address, delegate_map, on_connected) as render_client:
        Window.client = render_client
        Window.default_lighting = default_lighting
        Window.run()  # Runs indefinitely until window is closed

    logging.info(f"Finished Running Orzo Client")