Forums > MaxMSP

thispatcher script moveto in Presentation mode?

April 23, 2008 | 7:48 am

So here’s something I’m a bit confused on. I am used to hiding on lock any objects I don’t want to show up. You can’t do that anymore, that’s what Presentation mode is for. Ok I get that.

But what if I want to script moving objects around? It looks like I can’t do that in Presentation mode?

So is there some compromise where I can only show some objects but also script moving them around? Like in this patch, I only want the comment and the number box to appear.

{
"boxes" : [ {
"box" : {
"maxclass" : "number",
"numinlets" : 1,
"patching_rect" : [ 26.0, 14.0, 50.0, 20.0 ],
"numoutlets" : 2,
"presentation" : 1,
"id" : "obj-19",
"fontname" : "Arial",
"outlettype" : [ "int", "bang" ],
"fontsize" : 12.0,
"presentation_rect" : [ 26.0, 14.0, 50.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "script move moveme $1 50",
"numinlets" : 2,
"patching_rect" : [ 28.0, 91.0, 155.0, 18.0 ],
"numoutlets" : 1,
"id" : "obj-18",
"fontname" : "Arial",
"outlettype" : [ "" ],
"fontsize" : 12.0
}

}
, {
"box" : {
"maxclass" : "comment",
"varname" : "moveme",
"text" : "Move me!",
"numinlets" : 1,
"patching_rect" : [ 47.0, 50.0, 86.0, 20.0 ],
"numoutlets" : 0,
"presentation" : 1,
"id" : "obj-12",
"fontname" : "Arial",
"fontsize" : 12.0,
"presentation_rect" : [ 40.0, 50.0, 86.0, 20.0 ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "thispatcher",
"numinlets" : 1,
"patching_rect" : [ 28.0, 142.0, 69.0, 20.0 ],
"numoutlets" : 2,
"id" : "obj-11",
"fontname" : "Arial",
"outlettype" : [ "", "" ],
"fontsize" : 12.0,
"save" : [ "#N", "thispatcher", ";", "#Q", "end", ";" ]
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-18", 0 ],
"destination" : [ "obj-11", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-19", 0 ],
"destination" : [ "obj-18", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
]
}


April 23, 2008 | 7:58 am

Nevermind, I’m stupid. I got thrown off because I am used to Hide/Show on Lock in the Ctrl+click context menu. It’s not there anymore but it’s under the normal menus. Maybe it’s time for bed.

Still curious about scripting limitations in presentation mode.


April 23, 2008 | 8:09 am

> So here’s something I’m a bit confused on. I am used to hiding on
> lock any objects I don’t want to show up. You can’t do that anymore,
> that’s what Presentation mode is for. Ok I get that.

sure you can. it’s under object in the menu, it’s in the inspector for
each object under the appearance tab, or send a "hidden 1" message to
the object. All three will hide without needing to be in presentation
mode.

HTH,
David


April 23, 2008 | 8:14 am

On Apr 23, 2008, at 12:48 AM, Adam Murray wrote:
> So here’s something I’m a bit confused on. I am used to hiding on
> lock any objects I don’t want to show up. You can’t do that anymore…

Sure you can.

{
"boxes" : [ {
"box" : {
"maxclass" : "number",
"fontsize" : 12.0,
"id" : "obj-19",
"presentation_rect" : [ 26.0, 14.0, 50.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 2,
"patching_rect" : [ 26.0, 14.0, 50.0, 20.0 ],
"fontname" : "Arial",
"presentation" : 1,
"outlettype" : [ "int", "bang" ]
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "script move moveme $1 50",
"fontsize" : 12.0,
"id" : "obj-18",
"numinlets" : 2,
"hidden" : 1,
"numoutlets" : 1,
"patching_rect" : [ 28.0, 91.0, 155.0, 18.0 ],
"fontname" : "Arial",
"outlettype" : [ "" ]
}

}
, {
"box" : {
"maxclass" : "comment",
"varname" : "moveme",
"text" : "Move me!",
"fontsize" : 12.0,
"id" : "obj-12",
"presentation_rect" : [ 40.0, 50.0, 86.0, 20.0 ],
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 78.0, 50.0, 86.0, 20.0 ],
"fontname" : "Arial",
"presentation" : 1
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "thispatcher",
"fontsize" : 12.0,
"id" : "obj-11",
"numinlets" : 1,
"hidden" : 1,
"numoutlets" : 2,
"patching_rect" : [ 28.0, 142.0, 69.0, 20.0 ],
"fontname" : "Arial",
"outlettype" : [ "", "" ],
"save" : [ "#N", "thispatcher", ";", "#Q", "end", ";" ]
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-19", 0 ],
"destination" : [ "obj-18", 0 ],
"hidden" : 1,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-18", 0 ],
"destination" : [ "obj-11", 0 ],
"hidden" : 1,
"midpoints" : [ ]
}

}
]
}

Chris Muir
cbm@well.com

http://www.xfade.com


April 23, 2008 | 8:25 am

Thanks for the replies guys. I figured it out right after I posted but due to forum/mailing list lag guess you hadn’t seen my second post.

It was the classic "it moved from the spot I was used to and now I can’t find it" issue. Not nearly as bad as the latest version of Microsoft Office though ;)


April 23, 2008 | 9:52 am

On 23 avr. 08, at 09:48, Adam Murray wrote:

> But what if I want to script moving objects around? It looks like I
> can’t do that in Presentation mode?

You don’t even need scripting for that. Sending the
presentation_position message just work fine.

HTH,
ej

{
"boxes" : [ {
"box" : {
"maxclass" : "number",
"fontname" : "Arial",
"numinlets" : 1,
"presentation_rect" : [ 26.0, 14.0, 50.0, 20.0 ],
"numoutlets" : 2,
"fontsize" : 12.0,
"patching_rect" : [ 26.0, 14.0, 50.0, 20.0 ],
"outlettype" : [ "int", "bang" ],
"presentation" : 1,
"id" : "obj-19"
}

}
, {
"box" : {
"maxclass" : "message",
"text" : "presentation_position $1 50",
"fontname" : "Arial",
"numinlets" : 2,
"numoutlets" : 1,
"fontsize" : 12.0,
"patching_rect" : [ 26.0, 60.0, 158.0, 18.0 ],
"outlettype" : [ "" ],
"id" : "obj-18"
}

}
, {
"box" : {
"maxclass" : "comment",
"varname" : "moveme",
"text" : "Move me!",
"fontname" : "Arial",
"numinlets" : 1,
"presentation_rect" : [ 8.0, 50.0, 86.0, 20.0 ],
"numoutlets" : 0,
"fontsize" : 12.0,
"patching_rect" : [ 26.0, 92.0, 86.0, 20.0 ],
"presentation" : 1,
"id" : "obj-12"
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-19", 0 ],
"destination" : [ "obj-18", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-18", 0 ],
"destination" : [ "obj-12", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
]
}


April 23, 2008 | 4:30 pm

Quote: Emmanuel Jourdan wrote on Wed, 23 April 2008 02:52
—————————————————-
> On 23 avr. 08, at 09:48, Adam Murray wrote:
>
> > But what if I want to script moving objects around? It looks like I
> > can’t do that in Presentation mode?
>
> You don’t even need scripting for that. Sending the
> presentation_position message just work fine.

Got it. And you can drag and drop presentation_position out of the inspector. Much easier than remembering thispatcher syntax. I feel like a newbie again.


April 23, 2008 | 5:27 pm

whoa. 2 months of beta testing and i didn’t see that one!

On Apr 23, 2008, at 12:30 PM, Adam Murray wrote:

>
> Quote: Emmanuel Jourdan wrote on Wed, 23 April 2008 02:52
> —————————————————-
>> On 23 avr. 08, at 09:48, Adam Murray wrote:
>>
>>> But what if I want to script moving objects around? It looks like I
>>> can’t do that in Presentation mode?
>>
>> You don’t even need scripting for that. Sending the
>> presentation_position message just work fine.
>
> Got it. And you can drag and drop presentation_position out of the
> inspector. Much easier than remembering thispatcher syntax. I feel
> like a newbie again.
>
>
> –
> Adam Murray
> compusition.com


April 23, 2008 | 6:41 pm

…and like any new user, you have all kinds of nice facilities at your disposal to peruse for answers to questions like this. One of those times when seasoned users get the gift of "beginner’s mind."



Ch
May 6, 2009 | 12:25 pm
Quote:
You don’t even need scripting for that. Sending the
presentation_position message just work fine.

HTH,
ej

Just to say that the presentation_position message isn’t documented in the "common box attributes" page. (see http://www.cycling74.com/docs/max5/refpages/max-ref/jbox.html)
Is it somewhere else? Is there any other useful attribute undocumented?

Ch.


May 6, 2009 | 12:38 pm

You can specify the "position", "size" and "rect" of objects in "patching_", "presentation_" or both modes. For example:

"patching_position a b" position co-ordinates, patching mode
"presentation_rect c d e f" position and size, presentation mode
"size g h" object size in both modes

I hope this clears things up a bit.

lh



Ch
May 6, 2009 | 12:53 pm

OK, I definitely missed it!
Thanks for the clarification!

Ch.



jln
May 6, 2009 | 1:13 pm
Ch wrote on Wed, 06 May 2009 14:25
Is there any other useful attribute undocumented?

I just came across the ‘@fixwidth 0|1′ which can be usefull when scripting. I could not find it in the doc whether it is the common box attributes or in the thispatcher ref pages.

Best,
Julien


May 6, 2009 | 1:18 pm

The @fixwidth attribute is mentioned in the "Making New Objects" subpatch in the [thispatcher] object help file. It’s a bit like hitting command+j after scripting a new object.

lh



jln
May 6, 2009 | 1:44 pm

Doh! I had this window opened right under my eyes when I was looking for this attribute but still managed to miss it…

Another example that late night patching is no good, I guess… Smile Thanks for the spotlight on this.

Best,
Julien


May 6, 2009 | 11:30 pm
Adam Murray wrote on Wed, 23 April 2008 02:58
Nevermind, I’m stupid. I got thrown off because I am used to Hide/Show on Lock in the Ctrl+click context menu. It’s not there anymore but it’s under the normal menus.

Have a look at maxinterface.json in the Cycling ’74/interfaces folder. Pretty much everything (is it actually everything?) is there regarding how the menus operate. It’s really enlightening to see how things are set up, a bit abstract since it’s in JSON notation, but if you poke around and compare the listing with what you see in the menus, things will start to make sense… then you can begin customizing.

Specifically, look for "boxcontextmenu" and "multiboxcontextmenu" near the bottom. These are the "right-click" menus when you select an object or multiple objects. You can add Hide on Lock / Show on Lock by adding "hide", "show" into the list at the point you want. These are identical to those found in the Object menu, and simply adding the commands "hide", "show" will appear as Hide on Lock — Ctrl+K, Show on Lock — Ctrl+L (on Windows). Very cool. I added it and use it all the time. There’s a bunch of other things I may look into customizing too, I just need to see what things would be nice to have in certain spots.

Note: you have to restart Max to see the changes take effect, as it’s an initialization file.

Note: you should be careful what you do to this file, keep a backup of the original. I’m not sure how badly you could "break" things, but I’m sure there could be some headaches if you mess around too much. So if that happens, you can reload the original and give it the proper filename, and all will be right in your Max world.


May 9, 2009 | 5:38 am
Ch wrote on Wed, 06 May 2009 14:25
Just to say that the presentation_position message isn’t documented in the "common box attributes" page.
Is it somewhere else? Is there any other useful attribute undocumented?

you can find the attribute message within the inspector of an object:
If you ctrl-click in the column header, you can select "Attribute" and an additional column appears with the attribute names…


July 11, 2009 | 11:21 am

Hi,

Is there any way to move bpatcher object in presentation mode?
I could not make it work


July 11, 2009 | 11:33 am

message [script sendbox bpatcherscriptingname presentation_position $1 $2]
|
thispatcher


July 11, 2009 | 11:47 am

Thank you so much!
You saved my life.
It works!


Viewing 20 posts - 1 through 20 (of 20 total)