Objects automatically connect by proximity.

Feb 7, 2010 at 2:38am

Objects automatically connect by proximity.

I’ve been putting together a patch that creates named bpatchers, and connects them in order when they’re created. The patch keeps track of their vertical order. So if I switch the order, pressing a button reconnects the bpatchers in vertical order and disconnects the old connections. It has been difficult, and now the patch is getting too complicated to support the actual functions of the bpatchers. The main idea is to connect objects automatically (or with a reconnect button) by proximity or vertical order. Any suggestions or advice ? I can post my patch, but I’m trying to start new. Thanks .. !

#48290
Feb 7, 2010 at 12:54pm

If you post your patch I will take a look and help if I can.

lh

#173661
Feb 7, 2010 at 7:04pm

what a mess….

– Pasted Max Patch, click to expand. –
#173662
Feb 7, 2010 at 7:22pm

You haven’t posted the javascript file from the patch. I’ll take a look at it though.

lh

#173663
Feb 7, 2010 at 7:39pm

Shoot, you’re right. But Luke, I think you gave me the script. It was a replacement for [posit]. it queries the x-y coordinates of an object with a scripting name.

#173664
Feb 7, 2010 at 8:00pm

Ah no problems there then. I’ll check it out!

lh

#173665
Feb 10, 2010 at 12:19am

Right, here’s what I have so far. It is by no means perfect but it does a fair lot and should set you on the right track. Rock’n'roll! If you create some objects by selecting from the [umenu] you can then click on the [inlet] at the top of each [bpatcher] and drag it around the screen. It will try and re-order the [bpatchers] by vertical position each time you release the mouse. At the moment it does this even if the order has not changed and there’s no sort of alignment done. There are a few other things you might want to improve, the position where new [bpatchers] are created is relative to the number of existing [bpatchers] which are assumed to all be the standard size, not their actual position on screen. I’ll see if I can improve it a bit more but 10 hour days at work might decide otherwise!

lh

#173666
Feb 10, 2010 at 3:33am

Good job. I need to go through some javascript tutorials. What took me a huge messy patch (and didnt work) is accomplished in your script. I really appreciate the help. It works entirely for my purposes..I’ll send you the patch it will be incorporated into sometime soon…thanks luke !

-brandon

#173667
May 14, 2010 at 12:59am

Hey Brandon. If your patch managed to survive I’d be interested in seeing what became of it!

lh

#173668

You must be logged in to reply to this topic.