Creating colls by scripting

Apr 28, 2007 at 10:45pm

Creating colls by scripting

The following is the text of a patcher that contains two colls

max v2;
#N vpatcher 10 59 610 459;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#N coll ;
#T flags 1 0;
#P newobj 77 117 53 196617 coll;
#N coll garycoll;
#P newobj 79 84 66 196617 coll garycoll;
#P pop;

What is the scripting equivalent of these lines?

Unamed coll saved with patcher
#N coll ;
#T flags 1 0;
#P newobj 77 117 53 196617 coll;

Named coll not saved
#N coll garycoll;
#P newobj 79 84 66 196617 coll garycoll;

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#31644
Apr 29, 2007 at 12:45am

could this possibly help?

max v2;
#N vpatcher 694 159 1294 559;
#P window setfont “Sans Serif” 10.;
#P window linecount 1;
#P message 46 39 189 196618 script newdefault garycol 79 84 coll;
#N thispatcher;
#Q end;
#P newobj 46 60 66 196618 thispatcher;
#P connect 1 0 0 0;
#P pop;

#103092
Apr 29, 2007 at 6:51am

Thanks John, very nice. I didn’t know about newdefault. Very concise. And
it led me to the complete solution of this problem. I wanted to hide the
object and set the “save with patcher” flag.

Here’s what you enabled me to do.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden newex 463 161 69 196617 route symbol;
#P user ubutton 550 61 85 29 0 0;
#P window setfont “Sans Serif” 18.;
#P message 549 62 85 196626 New Coll;
#P window setfont “Sans Serif” 10.;
#N thispatcher;
#Q end;
#P hidden newobj 494 303 121 196618 thispatcher;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P hidden newex 465 247 92 196617 sprintf script send %scoll open;
#P window linecount 1;
#P hidden newex 461 188 78 196617 prepend append;
#P hidden newex 550 121 53 196617 t s s s s;
#P hidden newex 550 99 94 196617 dialog Coll name??;
#P window linecount 3;
#P hidden newex 590 221 64 196617 sprintf script send %s flags 1 0;
#P hidden newex 659 221 118 196617 sprintf script hidden newdefault %scoll
79 84 coll %scoll;
#P window setfont “Sans Serif” 18.;
#P user umenu 642 62 161 196683 1 64 90 1;
#X add;
#X add gary;
#X add john;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 190 240 123 196617 script send garycoll open;
#P message 40 241 143 196617 script send garycoll flags 1 0;
#P window setfont “Sans Serif” 10.;
#P message 25 214 273 196618 script hidden newdefault garycoll 79 84 coll
garycoll;
#N thispatcher;
#Q end;
#P newobj 25 270 121 196618 thispatcher;
#P window setfont “Sans Serif” 14.;
#P comment 25 184 268 196622 John Cobbett’s solution expanded;
#P comment 490 32 225 196622 this is what I really want to do;
#P window setfont “Sans Serif” 9.;
#N coll garycoll;
#P hidden newobj 80 84 66 196617 coll garycoll;
#P objectname garycoll;
#N coll johncoll;
#P hidden newobj 79 84 64 196617 coll johncoll;
#P objectname johncoll;
#P window setfont “Sans Serif” 24.;
#P window linecount 2;
#P comment 171 60 237 196632 Unlock patch to see what’s going on;
#P hidden connect 19 0 14 0;
#P hidden connect 13 0 19 0;
#P hidden connect 8 0 5 0;
#P hidden connect 7 0 5 0;
#P hidden connect 6 0 5 0;
#P hidden connect 14 0 9 0;
#P hidden fasten 9 1 15 0 798 211 470 211;
#P hidden connect 15 0 16 0;
#P hidden connect 11 0 16 0;
#P hidden connect 10 0 16 0;
#P hidden connect 18 0 12 0;
#P hidden connect 12 0 13 0;
#P hidden connect 13 1 11 0;
#P hidden connect 13 2 10 0;
#P hidden connect 13 3 10 1;
#P window clipboard copycount 20;

How did we do anything without this list?

On 4/28/07 8:45 PM, “John Cobbett” wrote:

>
> could this possibly help?
>
>
>
> max v2;
> #N vpatcher 694 159 1294 559;
> #P window setfont “Sans Serif” 10.;
> #P window linecount 1;
> #P message 46 39 189 196618 script newdefault garycol 79 84 coll;
> #N thispatcher;
> #Q end;
> #P newobj 46 60 66 196618 thispatcher;
> #P connect 1 0 0 0;
> #P pop;

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

#103093
Apr 29, 2007 at 10:20am

i’m not worthy!! :) thanks for the thispatcher example

while messing around w/ thispatcher I found that this crashes max every time (leaving out “script” command):

max v2;
#N vpatcher 694 159 1294 559;
#P window setfont “Sans Serif” 10.;
#P message 46 39 205 196618 newobj 79 84 66 196617 coll garycoll;
#N thispatcher;
#Q end;
#P newobj 46 60 66 196618 thispatcher;
#P connect 1 0 0 0;
#P pop;

#103094

You must be logged in to reply to this topic.