Graphics

 View Only
Expand all | Collapse all

Shuffle Play A Take Item Group In Xpression

  • 1.  Shuffle Play A Take Item Group In Xpression

    Posted 23 days ago

    I'm wondering if there's a way to shuffle play a take item group in Xpression. We normally have the playout mode of the groups in our projects set to either Manual or Timed, but there's a possibility in the near future that we'll need to play the take items in a group in a random order. I've looked through the script editor, but I'm not savvy enough to know if there's a custom script to achieve this.

    If there isn't a way, I think I'll just make a few groups with the same take items, but in different orders.



    ------------------------------
    [Nick] [Kubinski]
    [Studio Production Specialist]
    [Sysmex America Inc.]
    [Vernon Hills] [USA]
    ------------------------------


  • 2.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 23 days ago

    yeah what you could do is have a dummy scene that you always take online i.e 1000 and then inside that scene onOnline have this script. 

        Dim takeItem1 As xpTakeItem
        Dim randVal As Integer
        Dim takeID As Integer
     
     
        ' Random 1–10 <-- change this to the random range you want-->
        randVal = Int((10 * Rnd) + 1)
     
        ' Base 1000 + random - <--change this to your value-->
        takeID = 1000 + randVal
     
        ' Get the take item by ID  
        engine.Sequencer.GetTakeItemByID(takeID, takeItem1)
     
        ' Execute it
        If Not takeItem1 Is Nothing Then
            takeItem1.Execute()
        End If
    if you don't want the same item to accidently play twice you could add a script to disable that item on offline.


    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 3.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 16 days ago

    I'm also trying something like this but for videos playing randomly giving the impression an animation guy is talking. Do you have the change the play out mode of the group? Also when I compile the code it come back good but does nothing when taken online other than play the one scene.

     Idk what value to put here

    Base 1000 + random - <--change this to your value-->

    i just put a 8 as that's the amount of scenes I have?

    if you could also help me out I'd appreciate sorry for the ignorance.



    ------------------------------
    Adam Reese
    ------------------------------



  • 4.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 16 days ago

    base take id number



    ------------------------------
    Simon Redmile
    Senior Graphic Programmer & Designer
    Ross Video
    Bristol United Kingdom
    ------------------------------



  • 5.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 15 days ago

    Hey Simon,

    Thanks for making that script for me. I got it to work with a take ID range of 1 - 10 with the dummy scene being take ID 1000. However, when I set the range to 351 - 360, I can't get the script to work. Below is what I've got using your original script.

    Also, in the 1 - 10 example, only a single take ID is chosen at random. Is it possible for the other take IDs in the group to play after the first one is chosen?

    Dim takeItem1 As xpTakeItem
    Dim randVal As Integer
    Dim takeID As Integer
    
        ' Random 351-360 <-- change this to the random range you want-->
        randVal = Int((360 * Rnd) + 351)
    
        ' Base 1000 + random - <--change this to your value-->
        takeID = 1000 + randVal
    
        ' Get the take item by ID
        engine.Sequencer.GetTakeItemByID(takeID, takeItem1)
    
        ' Execute it
        If Not takeItem1 Is Nothing Then
            takeItem1.Execute()
        End If


    ------------------------------
    [Nick] [Kubinski]
    [Studio Production Specialist]
    [Sysmex America Inc.]
    [Vernon Hills] [USA]
    ------------------------------



  • 6.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 11 days ago

    I was able to get the script to work with the existing take IDs! I had 2 issues, (1) I was activating the group which overrode the scene's script, and (2) I was changing the values in ((10 * rnd) + 1) to the exact take IDs I wanted to play. 

    I'm still trying to figure out how to get the other take items in the group to play after the first one is chosen at random.

    dim takeItem1 as xpTakeItem
    dim randVal as Integer
    dim takeID as Integer
    
    randVal = Int((10 * Rnd) + 1)
    
    takeID = 61 + randVal
    
    engine.Sequencer.GetTakeItemByID(takeID, takeItem1)
    
    If Not takeItem1 Is Nothing Then
    	takeItem1.Execute()
    End If


    ------------------------------
    [Nick] [Kubinski]
    [Studio Production Specialist]
    [Sysmex America Inc.]
    [Vernon Hills] [USA]
    ------------------------------



  • 7.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 10 days ago

    Hi Nick,

    If your randomly repeated take items are all the same duration, you can create a second group where you place that scene, which triggers the random start, twice. Then set that group to be timed with whatever interval you want, and configure it to repeat when done."



    ------------------------------
    Juha Koivisto
    Tampere
    Finland
    ------------------------------



  • 8.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 10 days ago

    Hi Juha,

    Unfortunately the take items are all different durations so that wouldn't work for us.



    ------------------------------
    [Nick] [Kubinski]
    [Studio Production Specialist]
    [Sysmex America Inc.]
    [Vernon Hills] [USA]
    ------------------------------



  • 9.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 9 days ago

    So I think I found a work around. I can reassign the take IDs with new random values and the operator can sort everything by Take ID and run the group as normal.

    dim takeItem1, takeItem2, takeItem3, takeItem4, takeItem5, takeItem6, takeItem7, takeItem8, takeItem9, takeItem10  as xpTakeItem
    
    dim randVal1, randVal2, randVal3, randVal4, randVal5, randVal6, randVal7, randVal8, randVal9, randVal10 as Integer
    
    dim takeID1, takeID2, takeID3, takeID4, takeID5, takeID6, takeID7, takeID8, takeID9, takeID10 as Integer
    
    engine.Sequencer.GetTakeItemByID(62, takeItem1)
    engine.Sequencer.GetTakeItemByID(63, takeItem2)
    engine.Sequencer.GetTakeItemByID(64, takeItem3)
    engine.Sequencer.GetTakeItemByID(65, takeItem4)
    engine.Sequencer.GetTakeItemByID(66, takeItem5)
    engine.Sequencer.GetTakeItemByID(67, takeItem6)
    engine.Sequencer.GetTakeItemByID(68, takeItem7)
    engine.Sequencer.GetTakeItemByID(69, takeItem8)
    engine.Sequencer.GetTakeItemByID(70, takeItem9)
    engine.Sequencer.GetTakeItemByID(71, takeItem10)
    
    randVal1 = Int((10 * Rnd) + 1)
    randVal2 = Int((10 * Rnd) + 1)
    randVal3 = Int((10 * Rnd) + 1)
    randVal4 = Int((10 * Rnd) + 1)
    randVal5 = Int((10 * Rnd) + 1)
    randVal6 = Int((10 * Rnd) + 1)
    randVal7 = Int((10 * Rnd) + 1)
    randVal8 = Int((10 * Rnd) + 1)
    randVal9 = Int((10 * Rnd) + 1)
    randVal10 = Int((10 * Rnd) + 1)
    
    takeID1 = 61 + randVal1
    takeID2 = 61 + randVal2
    takeID3 = 61 + randVal3
    takeID4 = 61 + randVal4
    takeID5 = 61 + randVal5
    takeID6 = 61 + randVal6
    takeID7 = 61 + randVal7
    takeID8 = 61 + randVal8
    takeID9 = 61 + randVal9
    takeID10 = 61 + randVal10
    
    takeItem1.ID = takeID1
    takeItem2.ID = takeID2
    takeItem3.ID = takeID3
    takeItem4.ID = takeID4
    takeItem5.ID = takeID5
    takeItem6.ID = takeID6
    takeItem7.ID = takeID7
    takeItem8.ID = takeID8
    takeItem9.ID = takeID9
    takeItem10.ID = takeID10


    ------------------------------
    [Nick] [Kubinski]
    [Studio Production Specialist]
    [Sysmex America Inc.]
    [Vernon Hills] [USA]
    ------------------------------



  • 10.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 8 days ago

    Hey Nick!

    I wrote this earlier for someone else, this should work for what you want to do. Place this in a Keyboard Shortcut script, select the group you'd like to randomize:

    dim tig as xpTakeItemGroup
    If Engine.Sequencer.GetFocusedTakeItem(tig) Then
    	dim itemCount as integer = tig.ItemCount
    	dim bottomIndex, topIndex as integer
    	dim firstItem, lastItem as xpTakeItem
    	tig.GetFirstTakeItem(firstItem)
    	tig.GetLastTakeItem(lastItem)
    	bottomIndex = firstItem.Index
    	topIndex = lastItem.Index
    
    	Randomize()
    	dim groupID as integer = tig.ID
    	dim firstID as integer = groupID + 1
    	dim lastID as integer = groupID + itemCount
    
    	dim tiFirst, tiLast as xpTakeItem
    	Engine.Sequencer.GetTakeItemByID(firstID, tiFirst)
    	If Not Engine.Sequencer.GetTakeItemByID(lastID, tiLast) Then
    		MsgBox("Unable to find final expected ID; have you renumbered (Ctrl+R) the entire list to make items sequentially numbered?")
    		return
    	End If
    	dim message as string = "Randomizing from " + vbCrLf + CStr(firstID) + ": " + tiFirst.Name + vbCrLf + "to" + vbCrLf + CStr(lastID) + ": " + tiLast.Name + vbCrLf + vbCrLf + "Does that sound right?"
    	dim response = MsgBox(message, vbYesNo, "Randomizing Items")
    	If response = vbYes Then
    		For i as integer = 0 to itemCount - 1
    			dim ti as xpTakeItem
    			Engine.Sequencer.GetTakeItemByID(groupID + 1 + i, ti)
    			dim futureNum as integer = CInt(Math.Floor((topIndex - bottomIndex + 1) * Rnd())) + bottomIndex
    			Engine.Sequencer.MoveTakeItemByIndex(ti, futureNum)
    		Next
    	End If
    End If


    ------------------------------
    Zachary Fradette
    United States
    ------------------------------



  • 11.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 5 days ago

    Hey Zachary,

    Thank you for the help. It seems that my version of Xpression doesn't have access to "takeItem.Index" or "MoveTakeItemByIndex". I can kind of get around the first one with "takeItem.UserData", but I don't have access to any move methods for Engine.Sequencer.

    I'm operating on Xpression Studio v10.55 build 1002.



    ------------------------------
    [Nick] [Kubinski]
    [Studio Production Specialist]
    [Sysmex America Inc.]
    [Vernon Hills] [USA]
    ------------------------------



  • 12.  RE: Shuffle Play A Take Item Group In Xpression

    Posted 4 days ago

    The xpSequencer.MoveTakeItem calls were added to XPression 10.7 build 5564 beta, so they are part of the v11.0 release and are included in versions beyond that. 

    -------------------------------------------