CNMAT's OSC-route with Variable Arguments in a Sub-Patch
Hello Max users!
I'm working on getting Max to communicate with Blender, and vice-versa. To do this, I'm creating two Sub-Patches: BlenderIN and BlenderOUT, both of which take one argument (the name of the object in Blender that is to be observed). BlenderIN is responsible for receiving messages from Blender as OSC messages, decoding them, and sending the information about the observed object via outlets. BlenderOUT is responsible for accepting parameters, such as xPosition; yPosition; scale; colour, and converting them into OSC messages before sending them back to Blender via UDP.
The only issue I have is that I cannot figure out how to set up my sub-patch in order to accept arguments as described in the attached image, (BlenderIN myCube), nor can I figure out how to take this argument and pass it into the CNMAT OSC-route object as an argument.
You can see my attempts in the attached image.
I'd be grateful if anyone could point me in the right direction.
From what I understand of your problem and unless I have missed something it would go something like the attached (compressed) patch. If that IS what you were after, the question arises: do you plan to instantiate a BlenderIN abstraction for each element in the scene? Or…
In any case, as a some time Blender user I look forward to your results.
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 523.3ocwUErbaBCD8L7Uri5UmXKYL1jas8Tuzo2axzQF1DqNfDCRzX2L4euv BJgzZSbsmzdfEzpEsu2a0J8PX.asYKZYvUvWgffGBCBHWsNB5GGvJjaSykVJ LVpon.0N1jt4b3VG42J+ABtMHjZztl.rf41lwJKTJ0XNHsv0rOji5Lr5Se9Z FH0YfRacRsSIcHbuxsgV.Y0c0so3JXZwtOVuF84JWowTSslRnn2YozktQou6 aUXpqiHIhKmMAhm2ZEQIzqFKbS+unxHDaV+8K3y8K9sMvVKKPZp2Woj49Yz0 EJcN5H9yGDtU8SJb9rlT7TrlZmOXu2xJz1PHoSYzCvoXwpVrwEDdm0afaZ+o GCCaMSNypB5RujcXkRLuWjhIEaAAmUGPpD+OkpU7txXzYKUcIcDQgKH0PrHp 6k2tWQgOJ02OG8Eq1EgcBLfxynDfPNmu70IPxdw+9qQdV04xsqD6xGi8zJet TSi22fp+XarwldQUSZQX51uXrp1cGvzc9OOhhIm5w3QQisE+McG97CpdS5eN osyuph8N9nxSWO+R5bf33QO.3sTcDipNmjxP26LB2io1ijUCNXQLKZ+be4eS a9.rRqEcw0ucIKgmV+uj.VScUpm58hN7LhxPqSooCGGDi3EwrQkkg5gcwEpr RiR65gvADyiEQIGAh3+SQj3XPz4.olAOF9K.cUOI9A -----------end_max5_patcher-----------
Thanks for the quick reply, Spectro. This approach was my first though, but these OSC addresses ideally shouldn’t be static, they should be able to be passed into the BlenderIN sub-patch, so that Max users shouldn’t have worry about knowing how OSC works.
With the support from sandbags and mattly, from the freenode #maxmsp channel, I’ve managed to solve my problem. I should finish in a few weeks, after which I can hopefully release my Blender scripts and Max sub-patches.
For what it’s worth (i.e. for anyone looking to set up their sub-patch to using arguments), here is a patch that demonstrates how to approach my issue:
The following patch is a sub-patch, and will accept a named argument in the form of a port number, which this patch will send on to a udpreceive object.
E.g. if you saved this patch as argumenttest, you could pass the port into it like so: [argumenttest 1234] (this requires that you add the location of this patch on your drive to the Max folder list.)
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 399.3oc0U10SCBCEF9ZVx9OzzqQSA1Fp24uCyhoiVY0.sDZQmt3+caO.6CEL 3GatcCGx6os4sObNGVOdjGdgZEWiQ2ftC44s1p3AZNEuVAObNcURFUCKDK4O qV7H1uImgux.5Ek7BtjgJTklMYELHmcCWDEuQUVkqpLYbCbhAsx0ZlWJ30NB iQyayUPMIKExz6K4Il5zQjKI9nfqfP70tmg122tmGTRijlCmF91RAMCuaJs3 UHUPncqaclPtwXf3aiG4h1f+fYTNWqoo7NwPvgACSgPzrZl7WhgveLF5sTwc K3kzxTcmHhzChB6GQ9CDSjoP0xjSopk96nDxNakBi5APju..MW8voPH5rf.Y JJaAUl1EDl7s6ifSZ.EIw.glQNGHTEyN2MgKdpygMGlYMMkPyNBibqOYblP9 oeSA1yk3CXSqpJSZuNsSbQ63QFWaDRpQnj6tp38W0RAiwk60TkKXEJaKYiSP y6+q4vMW7PLWvIr2bCi9OLGYPeUcjK3natICxajScv86LmSvFdGrJnjL -----------end_max5_patcher-----------
Forums > MaxMSP