0

Toggleable/dismissable watermark or overlay via rvio?

Is it possible to have an overlay added in rvio that I can somehow toggle during playback in rv? Rather than having a leader frame for my slate, my ideal solution would be to have an almost-opaque overlay that can be brought up and then dismissed at any point. I've crawled through the existing documentation and hotkeys, and don't see anything that sounds like this, but I wanted to check in with everyone here before abandoning my dreams for good. :)

11 comments

  • 0
    Avatar
    Jon Morley

    Hi Aaron,

    I would start by looking at this proof of concept example package. I think it can be turned into the kind of thing you are looking for.

    https://support.shotgunsoftware.com/entries/96056467

    Thanks,
    Jon

  • 0
    Avatar
    Aaron Wilson

    Thanks, that looks like it's almost what I want. Is it possible to load in an external image as part of the overlay? I know you mentioned in the comments over there that for a floating window I'd have to implement it in OpenGL, but maybe it's easier if I just want a static image? Then I could add my text on top of my slate card just like is done in the overlay hud.

  • 0
    Avatar
    Jon Morley

    Hi Aaron,

    That will also require the us of custom GL.

    Thanks,
    Jon

  • 0
    Avatar
    Aaron Wilson

    Cool, that's what I thought. I figured I'd ask, just in case there was an easy way to do it that I hadn't come across yet. Thanks!

  • 0
    Avatar
    Aaron Wilson

    Sorry, one more followup question - let's say I want to have the option to run my slates either as leaders or as toggled overlays. Is it possible to invoke a leader script's mu code to draw the overlay? For instance, if in my HUD code I wanted to formulate arguments and pass them to simpleslate, then use the resulting rendered frame as the overlay. Could I do that? Or would I have to duplicate most of the simpleslate code within my HUD's mu code?

    Are there any examples of doing something like this that I could take a look at?

    Thanks again!

  • 0
    Avatar
    Jon Morley

    Hi Aaron,

    If you want to share code for interactive toggle-able HUD overlays and slates then I would make a Mu module and "use" or "require" it from a Mu RVIO script and a Mu RV mode package. Is that what you are asking?

    Thanks,
    Jon

  • 0
    Avatar
    Aaron Wilson

    That makes sense. I'll play around with that for a bit, and let you know if I have any troubles. Thanks!

  • 0
    Avatar
    Aaron Wilson

    I have everything pretty much working now, but I have two questions:

    1) This one is pretty minor - I couldn't find a good event to trigger off of to update my slate info. I need an event that will fire every time I choose to display a different source. I would have thought that graph-state-change would be a good catch-all, but that doesn't always work. I think maybe it's only firing the first time I view a given source? Anyway, is there an event that I can look for that will trigger anytime the front image changes? Right now I'm just caching the front image's name, and checking that during every render() call to make sure it still matches. It works, but feels a bit clunky.

    2) My slate looks beautiful in my testing - it sizes itself to my viewSize() correctly, scales correctly while keeping its aspect ratio, etc. Except then I loaded it up in our screening room and realized that it doesn't display to my presentation device at all, and viewSize() seems to be wrong on my non-presentation device when I'm in presentation mode. Do you have any guidance for getting an overlay to work on the presentation device as well?

     

    Let me know if either/both of these would be better handled in a support ticket. I can always file one and send you the current state of my package, but I figured I'd ask here first in the hopes that both would have easy answers that might be useful to other people. :)

    Thanks!

  • 0
    Avatar
    Aaron Wilson

    I'll answer a part of #2 - I had tried putting self._drawOnProjection = True in my __init__() function without any luck, but I realized that I had to move it down below any other init calls, otherwise it was getting overwritten.

    So now it's drawing on the presentation device, but basing my calculations on viewSize() seems to make it about 2x too small on the non-presentation device and 2x too big on the presentation device. I must be taking a wrong approach. Here's an excerpt of what I'm doing:

     

    ---

    State state = data();
    let pinfo = state.pixelInfo,
         iname = pinfo.front().name;

    if (slateTexId == -1)
    {
      slateBgImage = image(SLATE_IMAGE_NAME);
      slateTexId = createScalable2DTexture(slateBgImage);
    }

    let size = viewSize(),
        slateAspect = double(slateBgImage.width) / double(slateBgImage.height),
        m = margins(),
        viewAspect = double(size.x-(m[0]+m[1])) / double(size.y-(m[2]+m[3])),
        maxWidth = floor(0.8*(size.x-(m[0]+m[1]))),
        maxHeight = floor(0.8*(size.y-(m[2]+m[3])));
    int px, py, w, h;
    if (slateAspect > viewAspect)
    {
      w = maxWidth;
      h = maxWidth / slateAspect;
      px = (m[0]-m[1])/2 + (size.x - w) / 2;
      py = (m[3]-m[2])/2 + (size.y - h) / 2;
    }
    else
    {
      w = maxHeight * slateAspect;
      h = maxHeight;
      px = (m[0]-m[1])/2 + (size.x - w) / 2;
      py = (m[3]-m[2])/2 + (size.y - h) / 2;
    }
    drawTexture(slateTexId, px, py, w, h, 1.0, true);

    ---

    Sorry about the formatting. :) Let me know if there's not an obvious problem with what I'm doing, and I'll send you the full package so you can play around with it. Thanks again!

  • 0
    Avatar
    Aaron Wilson

    Okay, I did some digging through the Mu code shipped with rv, and discovered the magic setupProjection() call, which fixes all of my presentation device problems. Let me know if there's a better event I should look at for my first question, otherwise you can consider this ticket closed. :)

  • 0
    Avatar
    Jon Morley

    Hi Aaron,

    Sorry for the slow response. We were away at SIGGraph and now I am going over the weeks action while waiting at my gate. I see that you solved most of your issues here. That was a good catch to set _drawOnPresentation to true and making sure to setupProjection().

    As far as the event question is concerned I think checking during render is the best approach. There isn't any kind of event specifically designed to capture the change of the sources being rendered. That is because if you are looking at something like a sequence then truthfully the view never changes as evaluation iterates over each input source. The only way to know that the source has changed is to check the sourcesRendered() each render().

    Thanks,
    Jon

Please sign in to leave a comment.