Skip to content

Simple Custom Messages

maybites edited this page Jun 12, 2021 · 4 revisions

Lets have a look at the most simple application: You want to receive an osc message and apply it to a blender property.

A OSC message may look like this:

/custom/osc/message 4 myTexVvalue 5.63 1

with the structure

address args

where in the above example the args is a tuple with 4 values

  • address = /custom/osc/message
  • arg0 = 4
  • arg1 = 'myTextValue'
  • arg2 = 5.63
  • arg3 = 1

In the following examples the osc message would look something like this:

/objects/Cube/location Cube 10.0 15.2 -5.3

We can see we receive the message on /objects/Cube/location. We want to apply the arguments on the data-path bpy.data.objects['Cube'].location, but since the message contains 4 arguments and the positional information are on the indices 1, 2 and 3, args[idx] is set to (1, 2, 3)

but we can do even better -> Filter-Custom-Messages