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
  1. import System
  2. from System.Threading.Tasks import Task
  3. from Wtvision.Tools.Graphics import ETransitionType
  4. import helper
  5.  
  6.  
  7. def __onStart(graphicOnAirItem, momentExecution, workFlowtype):
  8.         player = Game.SelectedPlayer
  9.         a = []
  10.         for i in IntelliflowController.GetGraphicOnAirItems(OutputManager.ActiveChannelOutput):
  11.                 a.append(i)
  12.         for i in a:
  13.                 if (i.Animating or i.Busy):
  14.                         momentExecution.Message = "Wait Is Animating!!!!!!"
  15.                         momentExecution.MessageType = momentExecution.MessageType.Warning
  16.                         momentExecution.Cancel = True
  17.                         return
  18.                        
  19.         if not player:
  20.                 momentExecution.Message = "Select a player first!"
  21.                 momentExecution.MessageType = momentExecution.MessageType.Warning
  22.                 momentExecution.Cancel = True
  23.                 return
  24.                
  25.         if workFlowtype.ToString() == "Preview":
  26.                 helper.AddPreviewAnimations(IntelliflowController, GraphicTemplatesManager, OutputManager, graphicOnAirItem, ["In", "Player_In"])
  27.                 timelines = graphicOnAirItem.Scene.GetTimelines()
  28.                 for timeline in timelines:
  29.                         timelineStr = timeline.ToString()
  30.                         if (timelineStr != "Player_In" and "_In" in timelineStr):
  31.                                 graphicOnAirItem.Scene.GoToFrame(timelineStr, 0)
  32.  
  33.         if workFlowtype.ToString() != "Preview":
  34.                 graphic = GraphicTemplatesManager.GetGraphicByName("Online")
  35.                 helper.SetExtraData(graphic.ExtraData, "GameOnlineIsOnAir", "False")
  36.                 helper.OnlineIntersections(momentExecution,graphicOnAirItem,GraphicTemplatesManager,OutputManager,IntelliflowController)
  37.        
  38.         gameType = "UEL" if Game.Competition.Name.ToString() == "UEFA Europa League" else "UECL"
  39.         if not Project.ProjectSettings["Competition"].Contains(gameType):
  40.                 momentExecution.Message = "THE COMPETITION OF THIS GAME IS DIFFERENT TO THE ONE SET ON PROJECT SETTINGS"
  41.                 momentExecution.Cancel = True
  42.                 return
  43.                                                                
  44. def __afterProgramOut(graphicOnAirItem, momentExecution):
  45.        
  46.         if graphicOnAirItem.Transition.ToString() == "0" or graphicOnAirItem.Transition.HasFlag(ETransitionType.None):
  47.                
  48.                 graphic = GraphicTemplatesManager.GetGraphicByName("Online")
  49.                 helper.SetExtraData(graphic.ExtraData, "GameOnlineIsOnAir", "True")
  50.  
  51. def __getData(graphicOnAirItem, viewBag, momentExecution,team, player):
  52.         viewBag.SetVideo("vdPlayerIn","Videos/%s/%s/Player/in.mov" %(Project.ProjectSettings["Competition"].ToString(),graphicOnAirItem.Scene))
  53.         viewBag.SetVideo("vdPlayerOut", "videos/%s/%s/Player/out.mov" %(Project.ProjectSettings["Competition"].ToString(),graphicOnAirItem.Scene))
  54.        
  55.         viewBag.SetImage("lgPlayerTeamLogo", "Images/%s/Badges/%s.png" %(Project.ProjectSettings["Competition"].ToString(),team.RefName))
  56.        
  57.         viewBag.SetString("tPlayerName",player.OtherNames if player.OtherNames else player.ShortName)
  58.         viewBag.SetString("tPlayerNumber", player.Number.ToString())
  59.        
  60.         if hasattr(player.Stats.ExtraStats, "fouls_suffered"):
  61.                 val = getattr(player.Stats.ExtraStats, "fouls_suffered")
  62.         else:
  63.                 val = 0
  64.                
  65.         if val == 1:
  66.                 viewBag.SetTranslatedText("tPlayerInformation", "%s {{Foul Suffered}}.{{Online - PlayerStats}}|filter:ToUpper " % val)
  67.         else:
  68.                 viewBag.SetTranslatedText("tPlayerInformation", "%s {{Fouls Suffered}}.{{Online - PlayerStats}}|filter:ToUpper " % val)
  69.  
  70.  
  71. def __afterPreview(graphicOnAirItem, momentExecution):
  72.         graphicOnAirItem.Scene.GoToFrame("Out", 49)
  73.         graphicOnAirItem.Scene.GoToFrame("PlayerID_In", 100)

Reply to "Untitled"

Here you can reply to the paste above