Graphics

 View Only
Expand all | Collapse all

Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

  • 1.  Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 02-12-2019 17:33
    I don't want someone to write the whole thing for me. I just want one example and I will go from there. I have an object that moves along the x vector between numbered positions. The operator will select START and END positions using text input. Animation length is 200 frames. I have set up user input selectors so that when the operator selects a given position, the x position of that point is sent to a StartPos hidden text field along with x and y position of the camera using assigned columns in the user input. I want to take these numbers and apply them to keyframes for the object and camera. In the mean time I will continue plugging away. Thanks.


  • 2.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    Posted 02-12-2019 18:23
    This example shows how in scripting to add keyframes to an animation controller: https://transfer.rossvideo.com/f/2fc7eafba0dfafee
    The example is not what you need (as this example sorts a bunch of numbers and builds an animation to rearrange a list of text objects); but you can at least look at the part that sets the keyframes.
    #XPression


  • 3.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    Posted 10-17-2022 20:57
    Hello, 

    I'm also looking into scripting keyframe values, but the download link is down.

    Can this be posted again?

    Thanks

    ------------------------------
    Koji Kameda
    Broadcast Director
    Bento GG LLC
    ------------------------------



  • 4.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 10-17-2022 22:03
    I think I still have the project. I will post the script that was shared with me.

    Sent from my iPhone




  • 5.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 02-12-2019 18:52
    Thanks Brian. The learning curve continues to steepen. Ah, the bezier curve
    #XPression


  • 6.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 02-12-2019 22:42
    FTP site seems to be down. I will try later. Thank you Brian.
    #XPression


  • 7.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 02-20-2019 23:59
    Finally downloaded this Brian. I don't see where all the magic takes place. I see no scripting, no visual logic. DISREGARD: I finally found the script on the scene director. Thank you.
    #XPression


  • 8.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 03-14-2019 16:35
    Applying the values of the keyframes was a piece of cake Brian, thank you. However I need to somehow convert a text "number" into a double. I was thinking of doing if num="1" then pos = -212. But then I would have to do it for all 25 numbers, for object x position and camera x and y.
    But I know there has to be a cleaner way. Any ideas?
    #XPression


  • 9.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 06-19-2019 22:17

    Brian,

    We have resurrected this project and I am moving along well. My next hurdle: I need to run the script AFTER the scene is already on line and paused. Can I move the scripting from a text object to an event on a scene director? I can only assume that I would then have to getObject by name and grab the text objects that hold the scripting now. #InOverMyHead


    #XPression


  • 10.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    Posted 07-31-2022 21:00
    I'm looking to do something similar with scripting keyframes but am at the limits of my knowledge. The download link from post 2 is not working for me. Is that example still available somewhere?





  • 11.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    Ross Staff
    Posted 08-01-2022 06:29
    Tell me what you want to achieve maybe I can help.

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



  • 12.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 08-04-2022 01:13
    I used this to take a number value for "Cliffhanger" like in the price is right. We did it with a Jazz Bear on a motorcycle. Anyway, a dashboard did the math resulting in a number. Then I would use this number that had the bear x position on the ramp and x and y positions of the camera to follow the bear. I think I still have the script that works for me. Let me know if this is the direction you want to go.

    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------



  • 13.  RE: Scripting help: Extract a value from a text field and apply it to an X or Y position of on screen object at a given keyframe position

    MalThePal
    Posted 10-19-2022 13:48
    Here is the script I used to move the Jazz Bear along a line between 0 and 25. I then Rotated this group on the Z axis so that he is driving up a hill. The main workhorse is the lower third of the script. The rest is just positioning camera and the "Bear". This script assigns values to set the end keyframe.


    dim bs as integer
    dim bf as integer
    dim cXf as integer
    dim cYf as integer
    dim sd as xpSceneDirector

    dim obj as xpBaseObject

    dim AC as xpAnimController

    dim cam as xpCameraObject

    if text = "0" then
    bf = -833
    cXf = 108
    cYf = 22
    else if text ="1"
    bf = -782
    cXf = 90
    cYf = -54
    else if text ="2"
    bf = -740
    cXf = 143
    cYf = -29
    else if text ="3"
    bf = -702
    cXf = 190
    cYf = -7
    else if text ="4"
    bf = -656
    cXf = 249
    cYf = 18
    else if text ="5"
    bf = -615
    cXf = 300
    cYf = 47
    else if text ="6"
    bf = -577
    cXf = 345
    cYf = 67
    else if text ="7"
    bf = -536
    cXf = 394
    cYf = 93
    else if text ="8"
    bf = -491
    cXf = 451
    cYf = 117
    else if text ="9"
    bf = -451
    cXf = 502
    cYf = 142
    else if text ="10"
    bf = -407
    cXf= 556
    cYf= 147
    else if text ="11"
    bf = -368
    cXf = 602
    cYf = 190
    else if text ="12"
    bf = -325
    cXf = 655
    cYf = 213
    else if text ="13"
    bf = -286
    cXf = 704
    cYf = 233
    else if text ="14"
    bf = -242
    cXf = 757
    cYf = 258
    else if text ="15"
    bf = -203
    cXf = 806
    cYf = 281
    else if text ="16"
    bf = -161
    cXf = 857
    cYf = 306
    else if text ="17"
    bf = -119
    cXf = 910
    cYf = 331
    else if text ="18"
    bf = -76
    cXf = 965
    cYf = 354
    else if text ="19"
    bf = -37
    cXf = 1014
    cYf = 377
    else if text ="20"
    bf = 5
    cXf = 1066
    cYf = 402
    else if text ="21"
    bf = 47
    cXf = 1117
    cYf = 426
    else if text ="22"
    bf = 88
    cXf = 1168
    cYf = 450
    else if text ="23"
    bf = 130
    cXf = 1220
    cYf = 475
    else if text ="24"
    bf = 173
    cXf = 1273
    cYf = 499
    else if text ="25"
    bf = 214
    cXf = 1325
    cYf = 523
    end if


    if Scene.GetObjectByName("Bear",obj) then
    Scene.GetAnimControllerByName("go bear", AC)
    Scene.GetObjectByName("Camera",cam)
    AC.clearKeyFrames
    AC.SetKeyFrameValue(obj, 200, "Position.X", bf)
    AC.SetKeyFrameValue(cam, 200, "Position.X", cXf)
    AC.SetKeyFrameValue(cam, 200, "Position.Y", cYf)

    Scene.GetSceneDirectorByName("set keys", sd)

    end if

    sd.play

    ------------------------------
    Malcolm Thorpe
    Free Lance Xpression Designer/Carbonite TD
    ------------------------------