Graphics

 View Only
Expand all | Collapse all

ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

  • 1.  ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 18:41
    I'm having some trouble with some of my templates that use scripting. In designer everything works perfect (for both preview and the virtual output). When I put it on-air through the studio box it works perfect too. It does not work right in the ENPS plug-in's preview though. I have my script from OnOnline copy/pasted into the OnPreviewRender so they should be the same. What's even weirder is that some of it is working, but other parts are not. The template has an optional title banner scripted so if text is put in the title text field a banner appears behind it. This part works. For the main text I use the same kind of scripting that is suppose to put a semi-transparent black box behind the text, but this part is not working in the preview. Similarly I have it set up so the banner text moves if an image is added to the template and this part works. But then I have bullet points that are supposed to move down based on the previous bullet point line count that is not working. Again it's really weird because it works on-air, but not in preview but they're working off the same exact script. The preview is really important so our producers/reporters know what their graphic is going to look like. Anybody run into a similar problem? I should also note that our designer/studio/ENPS plug-ins are all running the same version of xpressions (v5.5 build 2722).


  • 2.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 18:43
    After copy/pasting into the OnPreviewRender field, did you re-compile (F7 or the little lighting bolt) within OnPreviewRender? The script needs to be compiled in both OnOnline and OnPreviewRender. It will only "work" where it has been compiled.

    #XPression


  • 3.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 18:43
    If there is any typo in the script it can exit partway through the script. This would explain why part of it works but other parts don't.

    Without seeing your project/scripting I don't think we can solve it through the forums. You should try to contact Tech Support for assistance.

    #XPression


  • 4.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 18:54
    Brian: there is no typo. Like I said I copy/pasted it from the on-air section and the on-air section performs 100%.

    Dan: yes I compiled both the on-air script and the OnPreviewRender script.

    I just tried doing a dumbed down version of this template where I took out some of the functions like the images. Pretty much I just kept the part about bullet point spacing. I didn't change the scripting for the bullet points at all, but now it seems to be working (only for the dumbed down version and not the full version). I'm thinking maybe the preview can only handle a limited amount of scripting maybe? Is that a thing and if so is there some way to get around it besides dumbing down my scripts?)

    #XPression


  • 5.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 19:02
    No, there should be no limit to scripting in preview.

    Can you show us your script?

    #XPression


  • 6.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 19:03

    Here is the full version:


    Dim Banner as xpBaseObject

    Dim BlueBKG(2) as xpBaseObject

    Dim FullImage as xpBaseObject

    Dim OverlayImage as xpBaseObject

    Dim Bullet(5) as xpBaseObject

    Dim BulletText(5) as xpTextObject

    Dim BannerText(2) as xpTextObject

    Dim BannerGroup as xpBaseObject

    Dim BulletGroup as xpBaseObject

    Dim BlackTrans as xpBaseObject

    Dim b as Short

    Dim y as Double

    Dim l as Long

    Dim i as Integer

    Self.GetObjectByName("BANNER", Banner)

    Self.GetObjectByName("BLUE BKG1", BlueBKG(1))

    Self.GetObjectByName("BLUE BKG2", BlueBKG(2))

    Self.GetObjectByName("FULL IMAGE", FullImage)

    Self.GetObjectByName("OVERLAY IMAGE", OverlayImage)

    Self.GetObjectByName("BANNER GROUP", BannerGroup)

    Self.GetObjectByName("BULLET GROUP", BulletGroup)

    Self.GetObjectByName("TITLE BANNER TEXT", BannerText(1))

    Self.GetObjectByName("BANNER TEXT 2", BannerText(2))

    Self.GetObjectByName("BLACK TRANSPARENT", BlackTrans)

    b = 0

    ' Banner set up

    If BannerText(1).LineCount = 1 then

    BannerText(1).visible = true

    BannerText(2).visible = false

    Else

    BannerText(2).text = BannerText(1).text

    BannerText(1).visible = false

    BannerText(2).visible = true

    End if

    If BannerText(1).Text = "" then

    BannerGroup.visible = false

    End if

    ' Bullets set up

    For i = 1 to 5

    Self.GetObjectByName("BULLET " & (i), Bullet(i))

    Self.GetObjectByName("BULLET TEXT " & (i), BulletText(i))

    If BulletText(i).Text = "" then

    Bullet(i).visible = false

    Else

    Bullet(i).visible = true

    b = b + 1

    End if

    Next i

    BulletText(1).posY = 774.07

    BulletText(2).posY = -130.50

    BulletText(3).posY = -130.50

    BulletText(4).posY = -130.50

    BulletText(5).posY = -130.50

    ' Banner on top or bottom

    If b = 0 then

    BannerGroup.posY = 540

    Else

    BannerGroup.posY = 1358

    End if

    Dim BkgMat1 as xpMaterial

    Dim BkgMat2 as xpMaterial

    Dim PicMat as xpMaterial

    ' Full image or not?

    FullImage.GetMaterial(0,PicMat)

    If PicMat.Name = "TRANSPARENT" then

    BlueBKG(1).visible = false

    BlueBKG(2).visible = true

    BlackTrans.visible = true

    Else

    BlackTrans.visible = false

    BlueBKG(1).visible = true

    BlueBKG(2).visible = false

    End if

    ' Bullet Line Counts

    For i = 1 to 4

    If BulletText(i).linecount > 1 then

    l = BulletText(i).linecount

    BulletText(i + 1).posY = BulletText(i + 1).posY - (40 * (l - 1))

    End if

    Next i

    ' Total number of lines

    l = BulletText(1).linecount + BulletText(2).linecount + BulletText(3).linecount + BulletText(4).linecount + BulletText(5).linecount

    For i = 1 to 5

    If BulletText(i).Text = "" then

    l = l - 1

    End if

    Next i

    ' squishing for too many total lines

    l = l + b - 1

    If l > 11 then

    l = ((l - 11) * 5)

    Y = BulletText(1).posY

    BulletText(1).posY = Y + l

    For i = 2 to 5

    Y = BulletText(i).posY

    BulletText(i).posY = Y + l

    Next i

    End if

    Y = BulletText(1).posY

    If BannerText(1).Text = ""

    Y = BulletText(1).posY

    BulletText(1).posY = Y + 80

    End if

    l = (l/5) + 11

    if B = 0 then

    if BannerText(1).Text = "" then

    if PicMat.Name = "TRANSPARENT" then

    BlackTrans.visible = false

    end if

    end if

    end if

    #XPression


  • 7.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 19:04
    Here is the dumbed down version:

    Dim Banner as xpBaseObject

    Dim BlueBKG(2) as xpBaseObject

    Dim FullImage as xpBaseObject

    Dim OverlayImage as xpBaseObject

    Dim Bullet(5) as xpBaseObject

    Dim BulletText(5) as xpTextObject

    Dim BannerText(2) as xpTextObject

    Dim BannerGroup as xpBaseObject

    Dim BulletGroup as xpBaseObject

    Dim BlackTrans as xpBaseObject

    Dim b as Short

    Dim y as Double

    Dim l as Long

    Dim i as Integer

    Self.GetObjectByName("BANNER", Banner)

    Self.GetObjectByName("BLUE BKG1", BlueBKG(1))

    Self.GetObjectByName("BLUE BKG2", BlueBKG(2))

    Self.GetObjectByName("FULL IMAGE", FullImage)

    Self.GetObjectByName("OVERLAY IMAGE", OverlayImage)

    Self.GetObjectByName("BANNER GROUP", BannerGroup)

    Self.GetObjectByName("BULLET GROUP", BulletGroup)

    Self.GetObjectByName("TITLE BANNER TEXT", BannerText(1))

    Self.GetObjectByName("BANNER TEXT 2", BannerText(2))

    Self.GetObjectByName("BLACK TRANSPARENT", BlackTrans)

    b = 0

    ' Banner set up

    If BannerText(1).LineCount = 1 then

    BannerText(1).visible = true

    BannerText(2).visible = false

    Else

    BannerText(2).text = BannerText(1).text

    BannerText(1).visible = false

    BannerText(2).visible = true

    End if

    If BannerText(1).Text = "" then

    BannerGroup.visible = false

    End if

    ' Bullets set up

    For i = 1 to 5

    Self.GetObjectByName("BULLET " & (i), Bullet(i))

    Self.GetObjectByName("BULLET TEXT " & (i), BulletText(i))

    If BulletText(i).Text = "" then

    Bullet(i).visible = false

    Else

    Bullet(i).visible = true

    b = b + 1

    End if

    Next i

    BulletText(1).posY = 774.07

    BulletText(2).posY = -130.50

    BulletText(3).posY = -130.50

    BulletText(4).posY = -130.50

    BulletText(5).posY = -130.50

    ' Bullet Line Counts

    For i = 1 to 4

    If BulletText(i).linecount > 1 then

    l = BulletText(i).linecount

    BulletText(i + 1).posY = BulletText(i + 1).posY - (40 * (l - 1))

    End if

    Next i

    ' Total number of lines

    l = BulletText(1).linecount + BulletText(2).linecount + BulletText(3).linecount + BulletText(4).linecount + BulletText(5).linecount

    For i = 1 to 5

    If BulletText(i).Text = "" then

    l = l - 1

    End if

    Next i

    ' squishing for too many total lines

    l = l + b - 1

    If l > 11 then

    l = ((l - 11) * 5)

    Y = BulletText(1).posY

    BulletText(1).posY = Y + l

    For i = 2 to 5

    Y = BulletText(i).posY

    BulletText(i).posY = Y + l

    Next i

    End if

    Y = BulletText(1).posY

    If BannerText(1).Text = ""

    Y = BulletText(1).posY

    BulletText(1).posY = Y + 80

    End if

    if b = 0 then

    BlackTrans.visible = false

    else

    BlackTrans.visible = true

    end if

    #XPression


  • 8.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 19:08
    My guess would be that it is failing around the `FullImage.GetMaterial(0,PicMat)` line.

    You should check to make sure that GetMaterial actually succeeds before the next line where you call PicMat.Name. If the FullImage object does not have any material assigned to it, then GetMaterial will return False and PicMat will be unitialized. As soon as you call PicMat.Name the script will abort.

    This is much safer:

    `

    if FullImage.GetMaterial(0,PicMat) then

    If PicMat.Name = "TRANSPARENT" then

    BlueBKG(1).visible = false

    BlueBKG(2).visible = true

    BlackTrans.visible = true

    Else

    BlackTrans.visible = false

    BlueBKG(1).visible = true

    BlueBKG(2).visible = false

    End if

    End if

    `

    #XPression


  • 9.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 20:11
    That worked perfectly thanks man! Only problem is I don't understand why. What I'm piecing together is the ENPS plug-in can't find the "TRANSPARENT" material (which is why it works on-air, but not in the ENPS preview... does this mean when the project is deployed the materials are sent to the output engines, but not the preview engine?). I also don't get why adding the if/then/end if to the GetMaterial fixes it. This part is really confusing because the scripting dependent on the 'If PicMat.name = "TRANSPARENT" then' was still working. What am I missing here?

    #XPression


  • 10.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 20:23
    Not quite.. What it means is that the object that FullImage is referring to does not have a material assigned to it (i.e. it would look like the unbound checkboard if you looked at it in layout mode). Is FullImage published to the ENPS plugin? If so, then it probably has no material assigned until you choose something for it in the plugin. I would expect that once you had assigned an image to it from the plugin your script would have been working as you had it; but before you choose an image from the plugin it would fail at the GetMaterial line becuase no material had been assigned yet. Hard for me to fully answer though without actually being able to see the project and how everythign is configured..

    #XPression


  • 11.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 20:39
    FullImage has a material assigned to it called "TRANSPARENT" (That is a material with an alpha of zero making it invisible). FullImage is a quad that is published so the material is editable though. The desired effect is that if I don't assign a different image to Fullimage it is invisible and uses the BlueBKG(2) quad that covers the whole area. If I do assign an image to it then it uses the BlueBKG(1) quad which is the same as BlueBKG(2), but with a hole in it that reveals the image behind it.

    Even though I don't know why that works, I think I know where I'll need to use that in future projects (or at the very least if something is not working I try that scripting to see if it fixes it). I don't always use scripting for my job, but when I do there is a lot of trial and error involved.

    #XPression


  • 12.  RE: ENPS PREVIEW NOT SHOWING SCRIPTING CHANGES

    Posted 12-22-2014 21:15
    This forum has proven to be a great sounding board for scripting ideas, as you look to future projects. With the introduction of Visual Logic, a good portion of the conversations have steered away, as a lot of the simpler stuff to script can be done via VL now.

    Even if you're someone that doesn't have much background or knowledge in scripting, having your ideas shared helps everyone here, as you might have a different solution to a problem that some of us may not see.

    #XPression