How to show root patch via button/command

I have a patch that I start from a .bat file with the -r startup argument. That way it only shows the renderer, which has its own clickable GUI. In the GUI I have the option to show the root (the main vvvv patch window in that case) and I can hide and show it using Window Handler. This is working fine once the root window is there.

But how do I first bring up the root patch without using the Alt-R shortcut? Is there a way to execute that command using vvvv? Couldnt find anything and obviously window handler only shows the root once it has been opened one time.



Nope, sorry, nothing…

@h99 - thanks, yeah I thought as much, but thought maybe there is something I missed. Just trying to simulate the keyboard command using this example: Simulate the pressure of a key

Working fine when you hook up a spread of <ALT> and r, just somehow cant get it to work in my patch yet, but I think thats because I use the keyboard node somewhere else already, so probably interfering.

It does not work by the way.
The point is, I think, that root patch has no parent patch, obviously, thus, you can’t decide to have it InAWindow, for example, at start.
But… could you build your own root, and build another patch that changes stuff in root? If this is possible, you’d not need to open root, just the patch leading the changes.
In root you would have the project (the fullscreen renderer) patch and the “ruling” patch saved in it.
You would then end with something like
@ECHO OFF start vvvv.exe /r "newRoot.v4p"
You’d be able to change values in ruling patch as it is opened.
I do not know if there’s any possible conflict, root patch would be created before ruling patch, though first depends on latter, nor if windows order would match your needs. You could just /r and then /o the other patches. I don’t know.

That is what I am doing. I have a main patch, which contains the renderer and all subpatches, but is also the root patch. I start everything using exactly that method in a .bat file:

start vvvv.exe /r "newRoot.v4p"

Opening and closing the root/main patch from the GUI works fine using windowhandler, but only if the root was open once. Now I could just open everything with the root open then immediately hide it, but I like how cleanly it starts with just the renderer and GUI showing.

Triggering the ALT-R shortcut only for the first opening of the root (after that window handler can just hide/unhide it), works in a standalone patch, but not in my large patch. If I look at the Keyboard output if I bang <ALT> to the keyboard input, the output shows <CONTROL>!?!? In the standalone patch which works, keyboard output is not outputting anything and correctly opens the root patch. Weird.

open_root.v4p (3.2 KB)

Just tried without /r and then hiding the main patch and 0.v4p using window handler. But looks really messy to have them shown during startup, which takes about 30 seconds to load everything, before it finally hides the windows :/

here is a solution that uses SetPatch:
ShowRoot.v4p (5.5 KB)

I was partially wrong. SetPatch makes wonders.

Thanks @joreg. I have been trying this for ages now and cant seem to get it to work.

For some reason if I start with /r it always shows the root (my main patch) after opening the patch. If I open with /r and /shutup then the root is hidden during startup, but cant be opened using your example (set to the correct path of course) or even Alt-R. The title bar of renderer briefly flashes, but the root patch isn’t opened.

If I open with just /shutup vvvv opens with no windows and no renderer at all, which is totally weird.

Not sure what I am doing wrong. I’ll try and make a demo patch to show whats happening.

What dictates if the root patch is shown or not on startup?

I am now using your example to set the patch to hidden, which hides the root patch before the .NET error interrupts loading, so is only visible for a split second. I guess that will have to do for now.

the rule is: when starting up and no window (renderer or patch) is open, then show the root patch.

so if you open a patch with /r and that in turn opens any other renderer or patch, the root patch itself should not be visible. can you confirm that?

Yeah, thats what isnt happening. I open with /r and it opens the renderer AND the root window!? How can I start to check why this is happening?

just tested, works for me. please try with a new simple patch and send that patch if it doesn’t work.

Yeah it works for me for me too. I think the problem is with SetPatch - even though it has a ForceUpdate pin, it automatically gets triggered on load. Just tried with using <PATCH windowmode="Hidden"></PATCH>. As soon as I connect it to SetPatch it hides the patch itsself amd even using Alt-R shows the window but immediately hides it again. My trigger patch which is a child of the root patch also gets hidden, so I end up with no windows and no way to get them back.

Would be nicer if SetPatch had an Update pin or an enable pin, so it can be triggered at a certain point and not on input change and load.

indeed, SetPatch triggering OnInputChange is weird. but you should be able to work around that using a Switch (String) which returns an empty string by default, right?

Okay, I made a small example which shows whats happening. If you just open showroot it will show the green renderer, then you can click inside it to toggle showing of the root. I have it so the normal state of SetPatch sets it to hidden, but you can briefly see it during loading, which is what I want to avoid.

But when I open it with the .bat file with /r it also shows the root, even though it shouldn’t. If I also add /shutup you cant open the root any more - not by clicking in the renderer or Alt-R.

What do you think? (3.0 KB)

open ShowRoot.v4p in a texteditor and remove the attribute


from the PATCH tag to prevent it from flickering once on startup.

for /shutup the behavior you see is by design: in this mode we don’t ever want to show any patches, only renderers.

Yes, that works as a workaround, but only works once really. As soon as I use the GUI to show the root, then do some changes and save, then the root gets saved in the open state, because I cant save again once it is closed and only the renderer is showing.

Is there a way to “Save All” with a command so I can trigger that before triggering the Quit from my GUI and it would save the windows as they are at that moment?

I think in the long term a very good solution would be the introduction of a taskbar icon for vvvv. That would enable vvvv to maintain its minimal and “in the background” appearance, without visible GUI, but would negate the need for always having that 0.v4p file open and no way to interact with vvvv once /shutup is used. It could just start out with some simple things like: Open, New Patch, Save, Save All, Save Window layout, Show Root, Show Inspector, and what ever else would make sense. But then it finally wouldn’t matter if any patch windows are open at all and you still have a very nicely hidden way of interacting with vvvv, even when its minimized or just running a renderer on a different screen. Also for boygrouping and such things it would make sense to have vvvv running in the taskbar. Would love to hear your thoughts on this.

EDIT: I mean the icon bar on the bottom right in Windows, not sure what the exact name of it is. I realise taskbar is the one on the left where vvvv is showing. Also just noticed you can turn the taskbar icon off, which would even more point to vvvv being able to run completely in the background and an icon in the icon tray(?) would make even more sense as a way to still be able to interact with vvvv at all times, but being otherwise hidden if wanted.

EDIT 2: Doh, just realized you CAN run vvvv in the tray already using the VVVV node. But it doesnt have any GUI, does it? Why no right-click menu? Something similar to for example todoist:

As far as I can tell, the tray icon has no function whatsoever other than telling you that vvvv is running, right?

Just noticed that DoQuit does have a query save pin, but even setting that to 1, when I hide the root patch and quit, it doesnt ask me to save and therefore root doesn’t get saved in the Hidden windowMode. Just tried it a second time and this time it DID ask me to save or not, but maybe that was because I did a change in the root file (or rather the one I open AS root) itself. It however didnt save the fact that the root was hidden again before saving. Man, this is really annoying - its so unpredictable.

I am aware that there is another discussion coincidentally happening in parallel which discusses something very similar - what constitute a file change and what doesn’t, especially related to window layout changes. Difficult question. Can I ask why vvvv never got a Settings Window? That would be one of those issues where people are divided, so why not give them the option of which behavior to use? I dont think you could make vvvv regarding those UX issues and get them perfect for everyone. We all have our ideas of how it should work and sometimes these ideas also change, like when we start working on something together, etc. I think giving us the option to choose the save-layout-markdirty-behavior would be the easiest solution.

please retry and report with latest alpha after this fix

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.