Closed dewiweb closed 2 years ago
So I understand right: A kind of pass-through for osc messages?
Yes, to use incoming messages as variable for scripts in AN.
Maybe It could be clearest if I explain my final needs:
So if an incoming message's address contain unmatched track's number with any object's name in existing blender's scene--> blender create a new object(icosphere by default) and set is name as "icosphere.(number of track)". Else blender update matching object's properties accordingly to incoming messages.
So clearly I need to filter incoming osc messages by script before pythonosc dispatcher.
I hope this explanation is understandable...and you'll be able to help me. Regards;
I've found a workaround with two "Expression" AN and NodeOSC in debug mode. I've putted "lastaddr" and "lastpayload" datapaths in each of them and now I'm able to use these values in a py script. I now it isn't really clean but it seems to work (in localhost for now).
After tests(on lan) with this workaround, it appears that "lastaddr" and "lastpayload" don't return all incoming messages queued if incoming messages are sended at high frequency. Is nodeOSC dropping or queueing messages overflowing?
NodeOSC is in my opinion not suitable for your problem, at least not in its current architecture...
I'm agree with you but step by step, I'm able to receive incoming message, create objects,name them,set their locations, set their colors according to incoming OSC data. I've also made a py script to generate OSC config file based on existing objects(to control x,y,and z coordinates) and importable in your addon. So, it is imperfect for my needs but there's not really alternative apart completely rewrite an addon from scratch.... Thanks for replies.
I could implement the following:
inside the datapath field you could enter the following:
script.custom_callback.py
where 'script' is the name of the internal text datablock and 'custom_callback' the name of the function to be called.
where the structure of the function would be:
# address is the received address string
# args is the received args tuple
def custom_callback(address, args):
print(address)
print(args)
though I am not sure yet how to script inside my addon to load the text datablock. The best example I have found is this:
when the server is started, and there is a string that ends with .py inside the datapath field, it will call the custom function.
Maybe this can be relevant : https://blender.stackexchange.com/questions/260599/how-to-use-an-internal-text-file-in-an-add-on
I've made some progress: https://github.com/maybites/blender.NodeOSC/issues/23#issuecomment-1304466361
Hello, Is there a way to listen to all incoming messages (without handlers filtering) and to output received address+args from the osc input node? Regards (and many thanks for this addon).