Skip to content

Non existant data_path in OSC config may keep the server from launching #39

@joncraig

Description

@joncraig

I have worked around this by not having a bad config file but FYI...

I think I am running the v2.4.1 but it says v2.3.2 in the add-ons page. So its one of those two(?)

Seems like when I had a data_path that listed something that didn't exist it crashed the OSC sever as it tried to open. The UI didn't reflect that there had been a problem.
Although now that I read the console more closely perhaps I generated a bad character in there somehow?

Anyhow, if you care to you could guard the config read to update the UI with an error, or at least to not show osc py server running if the config fails to read in, or the server fails to start?

Thanks for making this. Love having another osc enabled tool

I had a typo in my osc config file where the data_path was

        ...
        "data_path": "bpy.data.objects[\"Plat32\"].dimensions",
        ...

Rather than "Plate3"

 {
        "address": "/Projection/Plate/3/d",
        "data_path": "bpy.data.objects[\"Plate3\"].dimensions",
        "osc_type": "f",
        "osc_index": "()",
        "osc_direction": "OUTPUT",
        "filter_repetition": false,
        "dp_format_enable": false,
        "dp_format": "args",
        "loop_enable": false,
        "loop_range": "0, length, 1",
        "enabled": true
    }

Looking at the console it seemed to keep the OSC server from launching:

OSCPy Server sended test message to 127.0.0.1 on port 9002
Create OscPy Thread...
... server started on  9001
OSCPy Server is shutting down...
  stopping all sockets...
Exception in thread Thread-14 (_run_listener):
Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 4.4\4.4\python\Lib\threading.py", line 1045, in _bootstrap_inner
  terminating server...
    self.run()
... OSCPy Server is shutdown
  File "C:\Program Files\Blender Foundation\Blender 4.4\4.4\python\Lib\threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Jon\AppData\Roaming\Blender Foundation\Blender\4.4\extensions\.local\lib\python3.11\site-packages\oscpy\server.py", line 338, in _run_listener
    self._listen()
  File "C:\Users\Jon\AppData\Roaming\Blender Foundation\Blender\4.4\extensions\.local\lib\python3.11\site-packages\oscpy\server.py", line 382, in _listen
    data, sender = sender_socket.recvfrom(65535)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [WinError 10038] An operation was attempted on something that is not a socket
Traceback (most recent call last):
  File "M:\globals\application_globals\blender\System\addons\NodeOSC\server\operators.py", line 245, in execute
    osc_import_config(context.scene, config_file)
  File "M:\globals\application_globals\blender\System\addons\NodeOSC\server\operators.py", line 26, in osc_import_config
    config_table = json.load(config_file)
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Blender Foundation\Blender 4.4\4.4\python\Lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
                 ^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdb in position 21: invalid continuation byte
Info: Server stopped!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions