Graphics

 View Only
Expand all | Collapse all

XPression - Visual Logic or Scripting Question - Opacity

Hunter Blank

Hunter Blank10-27-2015 20:20

  • 1.  XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-19-2015 13:22
    Hi all,

    My XPression scripting knowledge is non-existent and my Visual Logic knowledge is cursory at best. I have, what I assume to be a rather complicated creative barrier and believe I can only resolve it through scripting or Visual Logic. That being said I have an NFL bracket, with a copious amount of quads, split up into groups of two. The problem I have is that I need to be able to dynamically change the opacity of any quad based on our producer's and our talent's predictions. So if Quad 1 has the winning team, then Quad 2 would have the losing team and Quad 2 would need to drop it's opacity to designated being out of the running for the super bowl. Also, if Quad 2 has the winning team we need the opacity for Quad 1, now the losing team, to drop it's opacity.

    Our quick fix was to export out a black shadow and animate it's opacity over both quads and toggle it's visibility within sequence. This just seemed a less than satisfactory option for us but indeed it is still an option.

    Is the above opacity challenge even possible? Any input is appreciated.

    Thanks!

    Hunter


  • 2.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-20-2015 16:35
    Is this doable or even understandable?

    #XPression


  • 3.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-20-2015 17:36
    Hunter, what if you mapped a macro to various keyboard shortcuts that would automatically swap out the material for a given pair? Let's say your first group would be "Alt 1 or Alt 2". if you mapped a macro there you could make it change the material on those quads depending on the keystroke. I use keystroke shortcuts to trigger various animations throughout our NBA games, such as 3 pointers which are sponsored. Does this make sense? Brian Ford would be your guy, or I can send you some if the things I have. Does this sound like something that would work for you?

    #XPression


  • 4.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-20-2015 17:45
    That sounds like it could definitely work, however I'm a little hesitant because we produce a large amount of content every single day and it is across many different sports leagues (NFL, NBA, MLB, NCAA, etc.) so we could certainly do that. I am eternally grateful for any resources you would be willing to share. My reluctance just stems from the vast amount of content over different sports and if we're going to want to use that same keystroke(s) in the future.

    #XPression


  • 5.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-20-2015 18:01
    @malthepal I'd also be happy to share you on a project file that shows kind of what I'm working with as well.

    #XPression


  • 6.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-20-2015 18:29
    Sounds good, our team will be on the road so I can play around with Xpression for a while. Brian will still be your go to guy for scripting but I think you and I can limp through this one. Go ahead and send me a link

    #XPression


  • 7.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-21-2015 05:54
    You could do this almost without scripting. Just separate the quads onto their own scenes. When you take the background use scripting to call the quads then pause the quads on the default state. Create your animation to go from the default to your eliminated state then place another pause. When you want to change a quad to the eliminated state just take the appropriate take Id again. This should let you animate each quad instead of just cutting between materials. Does that make sense?

    #XPression


  • 8.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-27-2015 17:50
    @dreiss it sort of makes sense, you're proposing the use of sequence layers here in a rather complex fashion, right? @malthepal could you dive a bit deeper into this hotkey option you were talking about earlier?

    #XPression


  • 9.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-27-2015 19:19
    From the main menu go to Edit then down to Keyboard/GPI Mapping. You can then attach an action to a specific keystroke. Once you have assigned this you can trigger a scene director inside your brackets scene/or you can attach some scripting for a specific scene. Since you could simply add more scene directors, you could trigger any number of elements in that scene. For Instance we use Alt1 through Alt6 to trigger answers in a family feud sort of game we play during basketball time outs. It spins the answer and plays a sound effect for each right answer. I'm not sure how in depth you want this info.

    #XPression


  • 10.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-27-2015 20:07
    @malthepal That sounds like it could work, however, could you show me how to get to this HotKey option within the Keyboard Mapping pane? Screenshots, if possible? The only hotkey option is visibility but I need Opacity of 'Alpha.'

    #XPression


  • 11.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-27-2015 20:20
    or 'Alpha." ** (Typo)

    #XPression


  • 12.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-27-2015 22:57
    Keyboard Mapping Script Action

    If you haven't already you'll want to make a new keyboard map (don't use the default). It's the button right beside the keyboard map dropdown.

    And you can assign any keyboard shortcut to these actions.

    And then use a script like this:

    dim output as xpoutputFramebuffer

    dim scene as xpScene

    dim dir as xpSceneDirector

    engine.Getoutputframebuffer(0, output)

    output.GetSceneonlayer(0, scene)

    scene.GetSceneDirectorByName("Refresh", dir)

    dir.playrange(0, 200)



    #XPression


  • 13.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-27-2015 23:06
    @Garner

    engine.Getoutputframebuffer( [Need the framebuffer intended to be placed in?], output)

    output.GetSceneonlayer([Need scene name?], scene)

    scene.GetSceneDirectorByName("Refresh", dir)

    dir.playrange(0, 200)

    Also, where does the manipulation of the scene object's Alpha come into play in this script here? This is a script that lives on the scene director timeline as well?

    Thank you so much for your insight!

    #XPression


  • 14.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-27-2015 23:12
    Yes, you need to put the framebuffer index into the script that matches up with what you want to do. You do not need the scenename, just the layer that the scene will be on in that framebuffer.

    For the framebuffer:

    Index 0 = Framebuffer 1

    Index 1 = Framebuffer 2

    This script just plays scenedirector(s) with a keystroke for a scene that is online. You would create scenedirector(s) with animation controllers in them that controlled all the alpha values of the objects just using normal keyframes. Just building on what Malcom and Daniel have suggested already.

    #XPression


  • 15.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 10-27-2015 23:23
    Ok I think I have a good understanding now. So, everything needs to be animated as such I'm just using this script to connect it to two different hotkeys that can interchangeable select animation controllers to use within the scene dynamically?

    #XPression


  • 16.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-04-2015 22:55
    So I'm still not sure how this is going to grab onto the quads alpha.

    #XPression


  • 17.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-04-2015 23:04
    Keyframe the quads alpha value into an animation controller or scene director so that it fades/cuts as you want it to:



    And then create a script action in the keyboard map that plays the animation controller or scene director that will animate the quads alpha (as described in the previous posts).

    The you can animate the alpha by triggering the keyboard macro.

    #XPression


  • 18.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-04-2015 23:21
    The overall scope is understood, but the exact script I would need is beyond my knowledge unfortunately, and after making a custom keyboard map and trying to setup the macro I'm hit with a small yellow caution sign next to the keyboard shortcut I set.

    I also have no GPI option.

    Thank you for responding so late by the way.

    #XPression


  • 19.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-04-2015 23:28
    I need it on an animation controller since I need to do this to some 22 or quads interchangeably.

    #XPression


  • 20.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-04-2015 23:48
    The yellow caution sign is because you have assigned the keyboard shortcut to the same as another keyboard macro. If you hover over the caution sign it will tell you what it conflicts with.

    You would use this script to trigger the animation controller:



    dim output as xpoutputFramebuffer

    dim scene as xpScene

    dim dir as xpAnimController

    'change the '0' to the framebuffer the scene will be on

    ' Index 0 = Framebuffer 1

    ' Index 1 = Framebuffer 2

    engine.Getoutputframebuffer(0, output)

    ' change the '0' to the layer of the framebuffer the scene will be on

    output.GetSceneonlayer(0, scene)

    scene.GetAnimationControllerByName("Refresh", dir)

    'this is the range of frames the anim controller will play

    dir.playrange(0, 200)



    Basically the same as the script on the previous page but using AnimationControllers instead of SceneDirectors, and I was mistaken about having to use the SceneName, you just need to specify the layer the scene will be on.

    #XPression


  • 21.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-04-2015 23:49
    You don't need any GPI boards configured for this.

    #XPression


  • 22.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-04-2015 23:55
    I should say, you don't have a GPI option because you don't have a GPI board added to your software. You don't need one for this, but you could add one and trigger this actions with GPIs if desired.

    #XPression


  • 23.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 21:29
    I'm still having trouble in trying to test it. I'm assuming it can't do this with more than two animation controllers as well. Here is a link to what I am trying to achieve in XPression --> Video here I need to be able to have the ability to dynamically change the opacity to anyone of the bottom and top boxes with the camera movements.

    #XPression


  • 24.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 21:35
    You can do this with an *infinite* number of animation controllers and/or scene directors.

    What is not working for you?

    I will try and make a sample over the weekend.

    #XPression


  • 25.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 21:42
    Here is what I'm looking at, what I've done, no shortcut error, no compile error. Perhaps I'm not hitting it at the right time?

    #XPression


  • 26.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 21:43
    This time around I'm going to just test it out on text, get it right, and then use it on the bracket video shared in a previous post.

    #XPression


  • 27.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 21:46
    These two lines:

    engine.GetOutputFramebuffer("Index 0", output)

    engine.GetSceneOnLayer("Index 0", scene)

    Should be:

    engine.GetOutputFramebuffer(0, output)

    engine.GetSceneOnLayer(0, scene)

    If you wanted to trigger a scene's animation controllers on Output 2 layer 4 it would be:

    engine.GetOutputFramebuffer(1, output)

    engine.GetSceneOnLayer(4, scene)

    #XPression


  • 28.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 21:56
    Okay,

    So I've updated to this

    engine.GetOutputFramebuffer(0, output)

    engine.GetSceneOnLayer(0, scene)

    However, I hit the macro before animating, and upon animating and its still not selecting the animation controller I chose. Here is a link to request a download of the package I'm working with.

    #XPression


  • 29.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 22:01
    Your script looks like this:

    engine.Getoutputframebuffer("0", output)

    ' change the '0' to the layer of the framebuffer the scene will be on

    output.GetSceneonlayer("0", scene)

    You need to remove the quotes so that it is:

    engine.Getoutputframebuffer(0, output)

    ' change the '0' to the layer of the framebuffer the scene will be on

    output.GetSceneonlayer(0, scene)

    #XPression


  • 30.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 22:06
    Here is exactly what I have right now. Apologies, thank you for being so patient with me.

    dim output as xpoutputFramebuffer

    dim scene as xpScene

    dim dir as xpAnimController

    'change the '0' to the framebuffer the scene will be on

    ' Index 0 = Framebuffer 1

    ' Index 1 = Framebuffer 2

    engine.Getoutputframebuffer(1, output)

    ' change the '0' to the layer of the framebuffer the scene will be on

    output.GetSceneonlayer(1, scene)

    scene.GetAnimationControllerByName("Wrestler 1 Position / Opacity", dir)

    'this is the range of frames the anim controller will play

    dir.playrange(0, 50)

    #XPression


  • 31.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 22:07
    So that is going to try and trigger the animation controller called "Wrestler 1 Position / Opacity" in the scene on layer 1 of output 2.

    #XPression


  • 32.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 22:07
    Oh yes, my bad, the scenelayer needs to be on '0'.

    #XPression


  • 33.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 22:08
    From your screen shot you only have 1 output. So you'll want your framebufffer to be 0.

    #XPression


  • 34.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 22:12
    dim output as xpoutputFramebuffer

    dim scene as xpScene

    dim dir as xpAnimController

    'change the '0' to the framebuffer the scene will be on

    ' Index 0 = Framebuffer 1

    ' Index 1 = Framebuffer 2

    engine.Getoutputframebuffer(1, output)

    ' change the '0' to the layer of the framebuffer the scene will be on

    output.GetSceneonlayer(0, scene)

    scene.GetAnimationControllerByName("Wrestler 1 Position / Opacity", dir)

    'this is the range of frames the anim controller will play

    dir.playrange(0, 50)

    I'm sorry but I still can't seem to get it to work. The animation controller is named correctly, the sequence object is on framebuffer 2, layer 0 as well.

    I even tried layer 1 and still can't get it to work.

    #XPression


  • 35.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 22:13
    I've already created a second framebuffer (framebuffer 2) and it still isn't working.

    #XPression


  • 36.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 11-13-2015 22:24
    My fault!

    The script is GetAnimControllerByName and not GetAnimationControllerByName.

    #XPression


  • 37.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 08-11-2016 17:16
    I am curious to see if this worked out. Hopefully it did.
    #XPression


  • 38.  RE: XPression - Visual Logic or Scripting Question - Opacity

    Posted 08-11-2016 17:23
    It did. Brhanson and I did some troubleshooting outside the forum as well, but the concept is accurately described in this thread
    #XPression