Graphics

 View Only
  • 1.  Change Take Item Name using script

    Posted 06-12-2017 20:29
    I have a roster of players that I am importing into my sequence. I want one of my text fields to designate that name that is given to the take item. Right now, when I launch the take items using relid, the names just increase (Graphic1, Graphic2,Graphic3).

    I want them to be named (FirstNameLastName, FirstNameLastName, FirstNameLastName) based off the data in the graphic.


  • 2.  RE: Change Take Item Name using script

    Posted 06-23-2017 01:02
    I tried to get this working but I can't figure it out. I know how to name a take item through scripting, but I can't actually figure out how to get out of the text object and find the take item it lives in again. I can only name a take item if I already know it's ID or where it's online. But if it has an unknown ID, or isn't currently online I can't find it to give it a name from its own text. I'm going to keep looking but I'm not sure this can be done in a simple way.
    #XPression


  • 3.  RE: Change Take Item Name using script

    Posted 06-26-2017 14:04
    Thanks @garner When I build out using RELID, it is possible to know the TakeID, although not really possible to expand to a system-wide script. ex: Group 100 is a stat L3, so 101 would be Jersey 1's stat L3. Maybe that might help a bit?
    #XPression


  • 4.  RE: Change Take Item Name using script

    Posted 03-29-2018 19:24
    Bumping this thread back up. @garner if you still have it, would you be able to post what script you were using to get started. Maybe I can finish it or at least get it working for me.
    #XPression


  • 5.  RE: Change Take Item Name using script

    Posted 03-30-2018 10:09

    Hello Brett,

    Here is a sample code that may do what you want ::

    It loops thru all take items of a group called "MyGroup" .
    For each takeItem, it gets the text of a published object named "PlayerName" and udpate the name of takeItem :

    Dim takeItem as xpTakeItem
    Dim takeGroup as xpTakeItemGroup
    Dim currentItem as xpTakeItem


    'get group of take items by his name
    if Engine.Sequencer.GetGroupByName("MyGroup", takeGroup) then



    ' loop thru all items
    if takeGroup.GetFirstTakeItem(takeItem) then

    do
    ' get published text
    dim publishedObject as xpPublishedObject
    takeItem.GetPublishedObjectByName("PlayerName", publishedObject)

    'update take item name
    dim str as string
    publishedObject.GetPropertyString(0,str)
    takeItem.Name = str

    ' next item
    currentItem = takeItem
    loop while ( takeGroup.GetNextTakeItem(currentItem,takeItem))

    end if

    end if



    See test project attached : [ATTACH]n15634[/ATTACH]

    The script is triggered from another scene ( "SceneTrigger" ) when preview is rendered and published text "TextUsedToTriggerScript" is set to yes.

    see screenshot before/after applying the script :



    Hope it helps,
    Antoine


    #XPression


  • 6.  RE: Change Take Item Name using script

    Posted 04-24-2018 20:21
    This is amazing @amignon although unfortunately my PlayerName comes from a DataLinq source.

    Is there another property I can call for instead of "Published Text" in the Line 26 area?
    #XPression


  • 7.  RE: Change Take Item Name using script

    Posted 04-26-2018 14:59
    I don't know if it's a bug that the string is not updated when we are using a datalinq bounding ...

    #XPression


  • 8.  RE: Change Take Item Name using script

    Posted 05-10-2024 21:22

    Anyone ever figure out how to make this work when the "published text" is from a datalinq source? i have the script working but it only works with the published text that is static or static with a user control list.



    ------------------------------
    Will Compton
    Technical Director
    NorthStar Church
    ------------------------------



  • 9.  RE: Change Take Item Name using script

    Posted 05-16-2024 09:36

    The XPression API has a "GetDatalinqValue" function that can be used, though it will only work after an item has been focused, so you would need to focus it first. Optionally, you could GetSceneCopy from the TakeItem, and then retrieve the actual object inside of the Scene and can force a Scene-wide Datalinq refresh.



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