Forums > MaxMSP

hide/show objects dynamically in presentation mode


April 5, 2011 | 2:13 pm

hello,

using the different objects to design an interface using the presentation mode, I’m comfortable with fpic, playing with alpha & presentation_rect to hide, move etc.

Using jit.pwindow too, I can I play with it dynamically?
I don’t mean to load new movies etc.. I’m ok with that
I mean about making it … invisible?
I thought about sending into it the message (presentation_rect -20. -20. 10. 10.) in order to put it outside, BUT I’m afraid in standalone, it shows scrolling bars or something like that..

any tips? trick?


MIB
April 5, 2011 | 2:25 pm

how about taking a panel with the same color as the background and put it over your pwindow? then all you need to do is play with bringtofront and sendtoback in thispatcher to either show or hide it.

April 5, 2011 | 2:40 pm

you can set the object’s @presentation attribute to 1/0 to show/hide in presentation view:

— Pasted Max Patch, click to expand. —
April 5, 2011 | 2:47 pm

MIB, I have special background, not solid color so I cannot use that; thanks.

Ben, didn’t even know that.
combining that + another presentation_rect message (because presentation 0 modify to patcher_rect) is FINE!

thanks to both of you :)

April 5, 2011 | 7:17 pm

working on it, went further.
all seems to work very fine.

I chose another way to do that.
Using a lot of JS as a core of a lot of systems I designed, I’m using the method: this.patcher.message(); to address directly objects on the patcher.

Just wanted to put it here, in the case others find that on search engine.
Indeed, scripting Maxobj from JS works very fine.

December 29, 2013 | 4:16 am

Good one…
the only issue with the

toggle > presentation $1

is that the position and size of the object in the presentation mode aren’t recalled because it will basically be withdrawn and re-added to presentation. The simple use of the

toggle > attrui (hidden)

hides the object from the presentation without altering its properties within it.

haven’t pasted a max code before, hope this works:

{
"boxes" : [ {
"box" : {
"maxclass" : "comment",
"text" : "< DELETE/ADD object (resets display settings)",
"linecount" : 2,
"presentation_linecount" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 381.0, 58.0, 150.0, 33.0 ],
"numinlets" : 1,
"frgb" : 0.0,
"patching_rect" : [ 45.0, 25.0, 150.0, 33.0 ],
"presentation" : 1,
"fontname" : "Arial",
"id" : "obj-16",
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "< HIDE/SHOW object (whenn in presentation)",
"linecount" : 2,
"presentation_linecount" : 2,
"fontsize" : 12.0,
"presentation_rect" : [ 140.0, 58.0, 150.0, 33.0 ],
"numinlets" : 1,
"frgb" : 0.0,
"patching_rect" : [ 158.0, 188.0, 150.0, 33.0 ],
"presentation" : 1,
"fontname" : "Arial",
"id" : "obj-15",
"numoutlets" : 0
}

}
, {
"box" : {
"maxclass" : "toggle",
"presentation_rect" : [ 115.0, 58.0, 20.0, 20.0 ],
"numinlets" : 1,
"patching_rect" : [ 127.0, 188.0, 20.0, 20.0 ],
"presentation" : 1,
"id" : "obj-3",
"numoutlets" : 1,
"parameter_enable" : 0,
"outlettype" : [ "int" ]
}

}
, {
"box" : {
"maxclass" : "jit.pwindow",
"presentation_rect" : [ 60.0, 138.0, 509.0, 215.0 ],
"numinlets" : 1,
"patching_rect" : [ 20.0, 292.0, 80.0, 60.0 ],
"presentation" : 1,
"id" : "obj-7",
"numoutlets" : 2,
"outlettype" : [ "", "" ]
}

}
, {
"box" : {
"maxclass" : "toggle",
"presentation_rect" : [ 356.0, 58.0, 20.0, 20.0 ],
"numinlets" : 1,
"patching_rect" : [ 20.0, 25.0, 20.0, 20.0 ],
"presentation" : 1,
"id" : "obj-6",
"numoutlets" : 1,
"parameter_enable" : 0,
"outlettype" : [ "int" ]
}

}
],
"appversion" : {
"major" : 6,
"minor" : 1,
"revision" : 6,
"architecture" : "x86"
}

}

December 29, 2013 | 4:18 am

doh…
how can I paste a compressed patch here and have it not flood the post?

December 29, 2013 | 4:24 am

check copy-compressed feature.

December 29, 2013 | 4:35 am

really too obvious, thanks…
like so?

<code>

— Pasted Max Patch, click to expand. —

</code>

March 10, 2015 | 7:55 am

I have found another great way for the case you want to hide an object and show an other one instead. It works great for dials at least. live.dials. I have extracted it from the LFO-device.
Seems like a complex patch but hey, it works.

>The problem with the "toggle > attrui (hidden)" is, that the values of the dials sometimes aren´t stored properly or get lost.
>The problem with "toggle > presentation $1": see SHOGUN´s comment.

— Pasted Max Patch, click to expand. —
March 10, 2015 | 9:21 pm

Here’s another way using scripting name and message to [thispatcher]

Can be combined with {script sendtoback foo} and {script bringtofront bar} if dealing with layered objects too.

— Pasted Max Patch, click to expand. —
Viewing 11 posts - 1 through 11 (of 11 total)

Forums > MaxMSP