- import System
- from System.Threading.Tasks import Task
- from Wtvision.Tools.Graphics import ETransitionType
- import helper
- def __onStart(graphicOnAirItem, momentExecution, workFlowtype):
- player = Game.SelectedPlayer
- a = []
- for i in IntelliflowController.GetGraphicOnAirItems(OutputManager.ActiveChannelOutput):
- a.append(i)
- for i in a:
- if (i.Animating or i.Busy):
- momentExecution.Message = "Wait Is Animating!!!!!!"
- momentExecution.MessageType = momentExecution.MessageType.Warning
- momentExecution.Cancel = True
- return
- if not player:
- momentExecution.Message = "Select a player first!"
- momentExecution.MessageType = momentExecution.MessageType.Warning
- momentExecution.Cancel = True
- return
- if workFlowtype.ToString() == "Preview":
- helper.AddPreviewAnimations(IntelliflowController, GraphicTemplatesManager, OutputManager, graphicOnAirItem, ["In", "Player_In"])
- timelines = graphicOnAirItem.Scene.GetTimelines()
- for timeline in timelines:
- timelineStr = timeline.ToString()
- if (timelineStr != "Player_In" and "_In" in timelineStr):
- graphicOnAirItem.Scene.GoToFrame(timelineStr, 0)
- if workFlowtype.ToString() != "Preview":
- graphic = GraphicTemplatesManager.GetGraphicByName("Online")
- helper.SetExtraData(graphic.ExtraData, "GameOnlineIsOnAir", "False")
- helper.OnlineIntersections(momentExecution,graphicOnAirItem,GraphicTemplatesManager,OutputManager,IntelliflowController)
- gameType = "UEL" if Game.Competition.Name.ToString() == "UEFA Europa League" else "UECL"
- if not Project.ProjectSettings["Competition"].Contains(gameType):
- momentExecution.Message = "THE COMPETITION OF THIS GAME IS DIFFERENT TO THE ONE SET ON PROJECT SETTINGS"
- momentExecution.Cancel = True
- return
- def __afterProgramOut(graphicOnAirItem, momentExecution):
- if graphicOnAirItem.Transition.ToString() == "0" or graphicOnAirItem.Transition.HasFlag(ETransitionType.None):
- graphic = GraphicTemplatesManager.GetGraphicByName("Online")
- helper.SetExtraData(graphic.ExtraData, "GameOnlineIsOnAir", "True")
- def __getData(graphicOnAirItem, viewBag, momentExecution,team, player):
- viewBag.SetVideo("vdPlayerIn","Videos/%s/%s/Player/in.mov" %(Project.ProjectSettings["Competition"].ToString(),graphicOnAirItem.Scene))
- viewBag.SetVideo("vdPlayerOut", "videos/%s/%s/Player/out.mov" %(Project.ProjectSettings["Competition"].ToString(),graphicOnAirItem.Scene))
- viewBag.SetImage("lgPlayerTeamLogo", "Images/%s/Badges/%s.png" %(Project.ProjectSettings["Competition"].ToString(),team.RefName))
- viewBag.SetString("tPlayerName",player.OtherNames if player.OtherNames else player.ShortName)
- viewBag.SetString("tPlayerNumber", player.Number.ToString())
- if hasattr(player.Stats.ExtraStats, "fouls_suffered"):
- val = getattr(player.Stats.ExtraStats, "fouls_suffered")
- else:
- val = 0
- if val == 1:
- viewBag.SetTranslatedText("tPlayerInformation", "%s {{Foul Suffered}}.{{Online - PlayerStats}}|filter:ToUpper " % val)
- else:
- viewBag.SetTranslatedText("tPlayerInformation", "%s {{Fouls Suffered}}.{{Online - PlayerStats}}|filter:ToUpper " % val)
- def __afterPreview(graphicOnAirItem, momentExecution):
- graphicOnAirItem.Scene.GoToFrame("Out", 49)
- graphicOnAirItem.Scene.GoToFrame("PlayerID_In", 100)
Untitled
From Beefy Gorilla, 3 Weeks ago, written in Plain Text, viewed 14 times.
This paste will expire in 3 Days.
URL https://paste.afonso.co/view/8ed998de
Embed
Download Paste or View Raw
— Expand Paste to full width of browser